I noticed that moving from gcc 3.2.3 to gcc 3.3.2 made compilation time of files with huge expressions increase by a lot. What we compile here are simulators for our processors and those programs can include huge expressions. Attached to this email you'll find a file that contains a number of expressions of almost 80.000 characters. (it has been preprocessed and can be easily compiled with: gcc -c -xc toplevel.s.i ) The problem is that with 3.2.3 compilation takes 32 seconds: time gcc -c -xc toplevel.s.i gcc -c -xc toplevel.s.i 31.17s user 0.66s system 99% cpu 32.001 total With 3.3.2 it takes 38 minutes: time ggcc -c -xc toplevel.s.i gcc -c -xc toplevel.s.i 2269.29s user 4.87s system 99% cpu 38:04.19 total The system was an Intel(R) Xeon(TM) CPU 2.80GHz with 4gb memory... I gzipped the file because the src was 4.7M, the gzipped one is only 112k :) gcc -v: Reading specs from /cadappl/gcc/3.3.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs Configured with: /home/hooft/Level/Work/gcc/gcc-3.3.2/gcc-3.3.2/configure --prefix=/cadappl/gcc/3.3.2 --enable-shared --enable-languages=c,c++,f77 --enable-__cxa_atexit --with-as=/cadappl/binutils/2.13.2/bin/as --with-ld=/cadappl/binutils/2.13.2/bin/ld --with-as=/cadappl/binutils/2.13.2/bin/as --with-ld=/cadappl/binutils/2.13.2/bin/ld Thread model: posix gcc version 3.3.2
Created attachment 6856 [details] gzipped version of source file that shows the bug gzipped because original was 4.7M, this one is 112k
Subject: Re: [3.3 Regression] huge compilation time increase from 3.2.3 to 3.3.2 "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes: | -- | What |Removed |Added | ---------------------------------------------------------------------------- | Keywords| |compile-time-hog | Summary|huge compilation time |[3.3 Regression] huge | |increase from 3.2.3 to 3.3.2|compilation time increase | | |from 3.2.3 to 3.3.2 | Target Milestone|--- |3.3.5 I don't think anyone wants to touch the C front-end on gcc-3_3-branch at this point. So, let's just recognize we're faulty and say we won't fix it for 3.3.x. -- Gaby
The same behaviour is also shown by gcc 3.4.1. There it takes 26 minutes. Also, when adding the -O1 option, it only takes 12 minutes. On 3.3.2 the difference was even bigger, adding -O1 decreased compilation time to 1.30 minutes.
Postponed until GCC 3.4.3.
This is essentially a duplicate of pr17503. I'm backporting the patch from that PR from mainline to the 3.4 branch. With that, compilation time for the testcase is 1 minute instead of 30.
Patch committed for 3.4.3. I did try the patch against 3.3 branch, but it doesn't do much good. In that case there are other reload related bits that are snarfing up time: % cumulative self self total time seconds seconds calls s/call s/call name 36.00 227.89 227.89 102804 0.00 0.01 find_equiv_reg 26.39 394.97 167.08 703271664 0.00 0.00 single_set_2 23.97 546.71 151.74 1749021956 0.00 0.00 true_regnum 3.01 565.78 19.07 162045491 0.00 0.00 subreg_regno_offset I'm not planning to look into this further. *** This bug has been marked as a duplicate of 17503 ***