Bug 3083

Summary: C++ frontend consumes inacceptable amounts of CPU with -O3
Product: gcc Reporter: Gerald Pfeifer <gerald>
Component: rtl-optimizationAssignee: Mark Mitchell <mmitchel>
Status: RESOLVED FIXED    
Severity: critical CC: gcc-bugs, gerald
Priority: P1    
Version: 3.0   
Target Milestone: ---   
Host: i686-pc-linux-gnu Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu Known to work:
Known to fail: Last reconfirmed:
Attachments: generate.ii.bz2

Description Gerald Pfeifer 2001-06-08 03:36:01 UTC
Compared to GCC 2.95, we now need four times as much CPU and
memory to compile the same code with -O3:

g@viech[298]:~/dlv.bench% \time gcc -c -O3 generate.C
199.10user 2.41system 3:21.52elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (2433major+116454minor)pagefaults 0swaps

g@viech[299]:~/dlv.bench% \time gccvs -c -O3 generate.C
962.93user 10.36system 16:15.34elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (4643major+463190minor)pagefaults 0swaps

This is a relatively recent regression on the 3.0 branch,
as far as I can see.

More detailed information:

contrib/gcc_update -rgcc-3_0-branch -D2001-05-08
contrib/gcc_update -rgcc-3_0-branch -D2001-05-11
contrib/gcc_update -rgcc-3_0-branch -D2001-05-13
contrib/gcc_update -rgcc-3_0-branch -D2001-05-18
contrib/gcc_update -rgcc-3_0-branch -D2001-05-23
contrib/gcc_update -rgcc-3_0-branch -D2001-05-25
contrib/gcc_update -rgcc-3_0-branch -D2001-05-27
contrib/gcc_update -rgcc-3_0-branch -D2001-05-28

taygeta% \time gcc-2.95.2 -O3 -c generate.C
      129.70 real       119.54 user         1.63 sys

taygeta% \time /files/pfeifer/2001-05-08/bin/gcc -O3 -c generate.C
      303.02 real       268.33 user         3.41 sys

taygeta% \time /files/pfeifer/2001-05-11/bin/gcc -O3 -c generate.C
      279.83 real       266.28 user         3.25 sys

taygeta% \time /files/pfeifer/2001-05-13/bin/gcc -O3 -c generate.C
      279.17 real       267.39 user         3.00 sys

taygeta% \time /files/pfeifer/2001-05-18/bin/gcc -O3 -c generate.C
  generate.C: In member function `bool MODEL_GENERATOR::
    PropagatePositiveFromMustBeTrue(const GATOM&, GINTERPRET&)':
  generate.C:3484: Internal error: Segmentation fault
  Please submit a full bug report, with preprocessed source if appropriate.
      224.09 real       219.25 user         3.94 sys

taygeta% \time /files/pfeifer/2001-05-23/bin/gcc -O3 -c generate.C
  generate.C: In member function `bool MODEL_GENERATOR::
    PropagatePositiveFromMustBeTrue(const GATOM&, GINTERPRET&)':
  generate.C:3484: Internal error: Segmentation fault
  Please submit a full bug report, with preprocessed source if appropriate.
      227.05 real       221.61 user         4.12 sys

taygeta% \time /files/pfeifer/2001-05-25/bin/gcc -O3 -c generate.C
  generate.C: In member function `bool MODEL_GENERATOR::
    PropagatePositiveFromMustBeTrue(const GATOM&, GINTERPRET&)':
  generate.C:3484: Internal error: Segmentation fault
  Please submit a full bug report, with preprocessed source if appropriate.
      225.75 real       220.67 user         3.97 sys

taygeta% \time /files/pfeifer/2001-05-27/bin/gcc -O3 -c generate.C
      695.35 real       675.30 user         7.02 sys

taygeta% \time /files/pfeifer/2001-05-28/bin/gcc -O3 -c generate.C
      704.28 real       683.03 user         6.79 sys

Release:
gcc version 3.0 20010607 (prerelease)

Environment:
System: Linux viech 2.2.18 #1 Fri Jan 19 22:10:35 GMT 2001 i686 unknown
Architecture: i686

host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /cvs/gcc-3.0/configure --prefix=/sw/gcc --enable-languages=c,c++,objc,java
Comment 1 Gerald Pfeifer 2001-07-11 03:48:07 UTC
Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-Why: As requested by Mark.
Comment 2 Gerald Pfeifer 2002-04-23 17:50:40 UTC
From: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: optimization/3083: C++ frontend consumes inacceptable amounts
 of CPU with -O3
Date: Tue, 23 Apr 2002 17:50:40 +0200 (CEST)

 http://gcc.gnu.org/ml/gcc/2002-04/msg01168.html contains a detailed
 analysis of build times, binary sizes and benchmark performance for
 GCC 2.95, 3.0, 3.0.3, the 3.1-branch as of 2002-04-22 (with various
 -finline-limit settings) and mainline as of 2002-04-22.
 
Comment 3 Mark Mitchell 2002-10-16 12:13:16 UTC
State-Changed-From-To: open->closed
State-Changed-Why: This ancient PR is perhaps still applicable -- but we have 
    done what we can for now, and there aren't major benefits
    in keeping the bug open.
Comment 4 Gerald Pfeifer 2002-12-07 12:19:30 UTC
From: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
To: gcc-gnats@gcc.gnu.org, "" <gcc-prs@gcc.gnu.org>, "" <gcc-bugs@gcc.gnu.org>
Cc:  
Subject: Re: optimization/3083: C++ frontend consumes inacceptable amounts
 of CPU with -O3
Date: Sat, 7 Dec 2002 12:19:30 +0100 (CET)

 Add a forward reference to PR 8361.