Compiling the GCC testsuite file alias3.C with -O1 -finline-functions exhausts memory on checking=all or =yes builds of GCC 4.1.1, on Ubuntu 5.04 with virtual memory limited to 500M. Roughly similar behavior on Mac OSX 10.4.6 with a checking=all build of GCC 4.1.0, though ulimit is broken on the Mac, so I had to kill the process manually. A checking=all build of GCC 4.0.2 compiles without error. The symptoms are similar to my PR26774, but that's fixed in 4.1.1, and didn't require optimization. Here's the Delta-reduced file:
namespace A{ struct X{}; void f(X&); namespace a_very_long_namespace_name{ } } namespace B = A; void B::f(A::X& x) { B::f(x); f(x); } ============ Here's the session; I'll attach the preprocessed file. 131> /opt/gcc411-chk-all/bin/gcc -v -save-temps -c -O1 -finline-functions ../cpp/bugfiles/GCC_bugfiles/noerror/131415_alias3_min.cpp Using built-in specs. Target: i686-pc-linux-gnu Configured with: /third-party_source/gcc-4.1.1/configure --enable-checking=all --prefix=/opt/gcc411-chk-all/ --enable-languages=c,c++ --with-comment=PalmSource checking=all build by Flash Sheridan 5/31/06 on Kondal Thread model: posix gcc version 4.1.1 /home/opt/gcc411-chk-all/bin/../libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1plus -E -quiet -v -iprefix /home/opt/gcc411-chk-all/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/ -D_GNU_SOURCE ../cpp/bugfiles/GCC_bugfiles/noerror/131415_alias3_min.cpp -mtune=pentiumpro -finline-functions -O1 -fpch-preprocess -o 131415_alias3_min.ii ignoring nonexistent directory "/home/opt/gcc411-chk-all/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/include" ignoring duplicate directory "/opt/gcc411-chk-all//lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1" ignoring duplicate directory "/opt/gcc411-chk-all//lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/i686-pc-linux-gnu" ignoring duplicate directory "/opt/gcc411-chk-all//lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/backward" ignoring duplicate directory "/opt/gcc411-chk-all//lib/gcc/i686-pc-linux-gnu/4.1.1/include" ignoring nonexistent directory "/opt/gcc411-chk-all//lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /home/opt/gcc411-chk-all/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1 /home/opt/gcc411-chk-all/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/i686-pc-linux-gnu /home/opt/gcc411-chk-all/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/backward /home/opt/gcc411-chk-all/bin/../lib/gcc/i686-pc-linux-gnu/4.1.1/include /usr/local/include /opt/gcc411-chk-all//include /usr/include End of search list. /home/opt/gcc411-chk-all/bin/../libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1plus -fpreprocessed 131415_alias3_min.ii -quiet -dumpbase 131415_alias3_min.cpp -mtune=pentiumpro -auxbase 131415_alias3_min -O1 -version -finline-functions -o 131415_alias3_min.s GNU C++ version 4.1.1 (i686-pc-linux-gnu) compiled by GNU C version 3.3.5 (Debian 1:3.3.5-8ubuntu2). GGC heuristics: --param ggc-min-expand=0 --param ggc-min-heapsize=0 Compiler executable checksum: 0017ab69adc149664c23a10e9b6eba83 virtual memory exhausted: Cannot allocate memory --- http://pobox.com/~flash Quality Lead for Compilers and Debuggers PalmSource, Inc. Tools Quality Assurance PalmSource bug 131415 -- Summary: Memory exhausted with -finline-functions on testsuite file alias3.C Product: gcc Version: 4.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: flash at pobox dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27881