Bug 16834 - [3.3/3.4 Regression] huge compilation time increase from 3.2.3 to 3.3.2
Summary: [3.3/3.4 Regression] huge compilation time increase from 3.2.3 to 3.3.2
Status: RESOLVED DUPLICATE of bug 17503
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: 3.4.3
Assignee: Richard Henderson
URL:
Keywords: compile-time-hog
Depends on:
Blocks:
 
Reported: 2004-07-30 14:30 UTC by Jozef Kruger
Modified: 2004-10-13 16:59 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-10-12 21:26:20


Attachments
gzipped version of source file that shows the bug (59.38 KB, application/octet-stream)
2004-07-30 14:32 UTC, Jozef Kruger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jozef Kruger 2004-07-30 14:30:31 UTC
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
Comment 1 Jozef Kruger 2004-07-30 14:32:07 UTC
Created attachment 6856 [details]
gzipped version of source file that shows the bug

gzipped because original was 4.7M, this one is 112k
Comment 2 Gabriel Dos Reis 2004-08-03 07:48:47 UTC
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

Comment 3 Jozef Kruger 2004-08-03 08:56:52 UTC
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.
Comment 4 Mark Mitchell 2004-08-29 18:47:36 UTC
Postponed until GCC 3.4.3.
Comment 5 Richard Henderson 2004-10-12 21:26:19 UTC
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.
Comment 6 Richard Henderson 2004-10-13 16:59:15 UTC
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 ***