Bug 13479

Summary: [3.4 regression] 20-30% compile-time regression with template-heavy code
Product: gcc Reporter: Giovanni Bajo <giovannibajo>
Component: rtl-optimizationAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: normal CC: gcc-bugs
Priority: P2 Keywords: compile-time-hog
Version: 3.4.0   
Target Milestone: 3.4.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2003-12-23 18:15:00
Bug Depends on:    
Bug Blocks: 8361    
Attachments: Preprocessed source for G++ 3.2
Preprocessed source for G++ 3.3
Preprocessed source for G++ 3.4

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.