Bug 7441 - [3.2 regression] string array initialization compilation time regression from seconds to minutes
Summary: [3.2 regression] string array initialization compilation time regression from...
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: compile-time-hog
Depends on:
Reported: 2002-07-30 00:46 UTC by tsv
Modified: 2004-12-04 20:18 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:

t.ii.bz2 (243.96 KB, application/octet-stream)
2003-05-21 15:16 UTC, tsv

Note You need to log in before you can comment on or make changes to this bug.
Description tsv 2002-07-30 00:46:01 UTC
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

gcc version 3.2 2002-07-26 (prerelease)

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:
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 (i386-redhat-linux) using BFD version
 /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

g++ -c t.ii
Comment 1 Wolfgang Bangerth 2002-10-28 13:40:39 UTC
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...
Comment 2 Joe Buck 2003-04-25 19:46:05 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3 and in the trunk, and 3.2 branch is now closed.