http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45857
Summary: memory exhausted compiling some variadic templates Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: g...@abeckmann.de Created attachment 21933 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=21933 minimized testcase This looks like a regression in 4.5, couldn't reproduce it in 4.3, 4.4 or 4.6. $ ulimit -v 2600000 # 2.5 GB $ ulimit -t 120 $ g++-4.5.x -v -std=c++0x -O2 -c memory_hog.min.cpp Using built-in specs. COLLECT_GCC=/opt/software/x86_64/gcc-4.5.x/bin/g++-4.5.x COLLECT_LTO_WRAPPER=/opt/software/x86_64/gcc-4.5.x/libexec/gcc/x86_64-unknown-linux-gnu/4.5.2/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4_5-branch/configure --prefix=/opt/software/x86_64/gcc-4.5.x --program-suffix=-4.5.x --enable-languages=c,c++ --enable-checking Thread model: posix gcc version 4.5.2 20100930 (prerelease) (GCC) COLLECT_GCC_OPTIONS='-v' '-std=c++0x' '-O2' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /opt/software/x86_64/gcc-4.5.x/libexec/gcc/x86_64-unknown-linux-gnu/4.5.2/cc1plus -quiet -v -D_GNU_SOURCE memory_hog.min.cpp -quiet -dumpbase memory_hog.min.cpp -mtune=generic -march=x86-64 -auxbase memory_hog.min -O2 -std=c++0x -version -o /tmp/cciTomr1.s GNU C++ (GCC) version 4.5.2 20100930 (prerelease) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.5.2 20100930 (prerelease), GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 ignoring nonexistent directory "/opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2 /opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/x86_64-unknown-linux-gnu /opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/backward /usr/local/include /opt/software/x86_64/gcc-4.5.x/include /opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/include /opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/include-fixed /usr/include End of search list. GNU C++ (GCC) version 4.5.2 20100930 (prerelease) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.5.2 20100930 (prerelease), GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 Compiler executable checksum: 1be67b2d58ac92677e3812da572956df memory_hog.min.cpp: In instantiation of ‘_Tuple_impl<0, void*, X<> >’: memory_hog.min.cpp:28:1: instantiated from ‘tuple<void*, X<> >’ memory_hog.min.cpp:51:27: instantiated from here memory_hog.min.cpp:15:1: warning: direct base ‘_Head_base’ inaccessible in ‘_Tuple_impl<0, void*, X<> >’ due to ambiguity virtual memory exhausted: Cannot allocate memory