g++ frontend takes about 1m40s to compile the attached code gcc frontend compile the same code in 2 seconds gcc version 3.0.4 and 2.91 doesn't have the same problem Release: gcc version 3.2 2002-07-26 (prerelease) Environment: g++ -v -save-temps t.cxx Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs Configured with: ./configure --enable-threads --enable-languages=c,c++ Thread model: posix gcc version 3.2 2002-07-26 (prerelease) /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/cpp0 -lang-c++ -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ t.cxx t.ii GNU CPP version 3.2 2002-07-26 (prerelease) (cpplib) (i386 Linux/ELF) ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include/c++/3.2 /usr/local/include/c++/3.2/i686-pc-linux-gnu /usr/local/include/c++/3.2/backward /usr/local/include /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/include /usr/include End of search list. /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/cc1plus -fpreprocessed t.ii -quiet -dumpbase t.cxx -version -o t.s GNU CPP version 3.2 2002-07-26 (prerelease) (cpplib) (i386 Linux/ELF) GNU C++ version 3.2 2002-07-26 (prerelease) (i686-pc-linux-gnu) compiled by GNU C version 3.0.4. as --traditional-format -V -Qy -o t.o t.s GNU assembler version 2.11.90.0.8 (i386-redhat-linux) using BFD version 2.11.90.0.8 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/crtbegin.o -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2 -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/../../.. t.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/crtend.o /usr/lib/crtn.o How-To-Repeat: g++ -c t.ii
State-Changed-From-To: open->analyzed State-Changed-Why: I can confirm this. Compile times go through the roof from 1.5 sec (gcc 2.95) to about 3 minutes (3.2.1 and CVS). The underlying problem is initialization of an insanely large array of string constants. This is a C++ front end problem, since if the file is compiled with the C front end, compile times are negligible. Note that for the problem, one needs not even specify optimization flags. Thus, there is no way to avoid it...
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed for 3.3 and in the trunk, and 3.2 branch is now closed.