I'm compiling the LLVM compiler infrastructure and have noticed that GCC 4.1 takes an excessively long time to compile versus GCC 4.0. In particular, one file (albeit 2 million source lines) takes over 10 minutes (618.97 seconds) of CPU time to compile. On the exact same source, GCC 4.0.2 takes just over 2 minutes (130.68 seconds). GCC 3.4 was even faster (from memory).
Here are the heavy-hitters (from -ftime-report) from highest to lowest: usr sys wall mem tree SSA incremental : 172.76 (30%) 0.61 ( 1%) 175.39 (22%) 9356kB ( 1%) ggc tree PHI insertion : 55.86 (10%) 0.30 ( 1%) 57.54 ( 7%) 6346kB ( 1%) ggc dominance frontiers : 40.15 ( 7%) 0.10 ( 0%) 40.02 ( 5%) 0kB ( 0%) ggc dominator optimization: 24.50 ( 4%) 0.57 ( 1%) 34.06 ( 4%) 74359kB ( 8%) ggc tree PTA : 19.51 ( 3%) 1.44 ( 3%) 22.90 ( 3%) 15806kB ( 2%) ggc PRE : 19.09 ( 3%) 6.52 (15%) 27.10 ( 3%) 1960kB ( 0%) ggc TOTAL : 576.55 42.42 794.94 957564 kB Attached is a tarball that contains pre-compiled source code, and the timing statistics for both 4.0.2 and 4.1.0 as generated by GCC. This problem may have already been reported by or related to the following bugs: bug 18419, bug 17895, bug 17596. Another thing to note. The object file for 4.1.0 is 21% larger than for 4.0.2 (1454880 vs 1759292). Platform: (Linux FC3 with updates): Linux 2.6.12-1.1381_FC3smp #1 SMP Fri Oct 21 04:03:26 EDT 2005 i686 i686 i386 GNU/Linux gcc -v: (slow) Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.1.0/configure --prefix=/proj/install --enable-languages=c,c++,java --with-gnuas --with-gnuld Thread model: posix gcc version 4.1.0 gcc -v: (fast) Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../svn/configure --prefix=/proj/install2 --enable-languages=c,c++ --with-gnuld --with-gnuas Thread model: posix gcc version 4.0.2 -- Summary: Compiling LLVM now takes nearly 5x as long with 4.1 as it did with 4.0 Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rspencer at x10sys dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27140