GCC Bugzilla has been upgraded from version 4.4.9 to 5.0rc3. If you see any problem, please report it to bug 64968.
Bug 13479 - [3.4 regression] 20-30% compile-time regression with template-heavy code
Summary: [3.4 regression] 20-30% compile-time regression with template-heavy code
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: compile-time-hog
Depends on:
Blocks: 8361
  Show dependency treegraph
 
Reported: 2003-12-23 14:50 UTC by Giovanni Bajo
Modified: 2004-01-17 04:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-12-23 18:15:00


Attachments
Preprocessed source for G++ 3.2 (159.61 KB, application/octet-stream)
2003-12-23 14:53 UTC, Giovanni Bajo
Details
Preprocessed source for G++ 3.3 (128.93 KB, application/octet-stream)
2003-12-23 14:53 UTC, Giovanni Bajo
Details
Preprocessed source for G++ 3.4 (130.01 KB, application/octet-stream)
2003-12-23 14:54 UTC, Giovanni Bajo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giovanni Bajo 2003-12-23 14:50:58 UTC
I attacched three preprocessed files for 3.2, 3.3 and 3.4. Compile times on my 
machine are as follows

        3.2    3.3    3.4

-O0     16.0s  14.9s  17.5s  +17%
-O1     20.7s  19.5s  23.2s  +18%
-O2     25.0s  23.6s  32.2s  +36%
-O3     27.3s  27.5s  34.2s  +24%

I am using 3.2.2, 3.3.1, 3.4 CVS 20031203.
This is better than PR8361, but still a big regression. I didn't test tree-ssa.
Comment 1 Giovanni Bajo 2003-12-23 14:53:08 UTC
Created attachment 5361 [details]
Preprocessed source for G++ 3.2
Comment 2 Giovanni Bajo 2003-12-23 14:53:37 UTC
Created attachment 5362 [details]
Preprocessed source for G++ 3.3
Comment 3 Giovanni Bajo 2003-12-23 14:54:08 UTC
Created attachment 5363 [details]
Preprocessed source for G++ 3.4
Comment 4 Andrew Pinski 2003-12-23 18:14:58 UTC
Steven B. says this is most likely the same (real) issue of 8361.
You tested with checking disabled, right?
Comment 5 Andrew Pinski 2003-12-23 18:17:50 UTC
What target are you on also.
Comment 6 Steven Bosscher 2003-12-27 16:45:51 UTC
Seems to be related to templates.  Test case: 
 
template<class type> 
class foo { 
  private: 
    int size; 
    type *a; 
 
  public: 
    foo<type> (int max) { 
      size = max; 
      a = new type[size]; 
    } 
 
    type& foo<type>::operator[] (int index) { 
      if (index > size) 
        index = size; 
      return a[index]; 
    } 
}; 
 
int test (void) 
{ 
  foo<int> bar(2); 
  bar[1] = 1; 
} 
 
gives, 
CPROP of ~PtO^HØ , pass 1: 2304 bytes needed, 0 const props, 0 copy props 
BYPASS of ~PtO^HØ : 3 basic blocks, 2304 bytes 
etc. 
 
Comment 7 Steven Bosscher 2003-12-27 17:09:06 UTC
Ignore my last comment, it has ended up in the wrong PR by accident :-/ 
Comment 8 Giovanni Bajo 2004-01-02 02:31:16 UTC
Looks like checking was on :(
Sorry everyone.
Comment 9 Giovanni Bajo 2004-01-02 02:32:33 UTC
Maybe someone wants to try this on tree-ssa. It's smaller than 8361, so if it 
shows the same regression there, it might be useful.