This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/13479] [3.4 regression] 20-30% compile-time regression with template-heavy code


------- Additional Comments From steven at gcc dot gnu dot org  2003-12-27 16:45 -------
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. 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13479


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]