https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70794
--- Comment #4 from numien at deathwyrm dot com --- $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper Target: x86_64-redhat-linux Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 5.3.1 20151207 (Red Hat 5.3.1-2) (GCC) $ ulimit -m unlimited $ ulimit -v unlimited $ g++ -m64 -O2 -save-temps -o test test.cpp (no output) $ ./test Reported max: 18446744073709551615 4294932terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc 4294967297 Aborted (core dumped) Preprocessed source attached... just in case my headers are different from the standard somehow. It's certainly possible that the problem is local to my system, though I'm not sure why it would be, it's a pretty average setup.