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 c++/17332] [3.3/3.4 Regression] Missed inline opportunity


------- Additional Comments From giovannibajo at libero dot it  2004-09-06 11:47 -------
Confirmed. It looks like that, for some reason, the function call is not 
inlined (not even at -O3) for the template case.

It used to work for GCC 3.2.2 so it is a regression on the 3.3 and 3.4 branch.

Notice that this is fixed already in mainline, by the new tree optimizers. The 
optimized tree dumps are the following, for both the template and non-template 
case:

<bb 0>:
  p1.6 = &c1[0];
  p2.7 = &c2[0];
  idx = 0;

<L0>:;
  p2 = p2.7 + 1B;
  p1 = p1.6 + 1B;
  *p2.7 = *p1.6;
  idx = idx + 1;
  if (idx <= 49999999) goto <L7>; else goto <L2>;

<L7>:;
  p1.6 = p1;
  p2.7 = p2;
  goto <bb 1> (<L0>);


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |missed-optimization
      Known to fail|                            |3.3.3 3.4.0
      Known to work|                            |3.5.0 3.2.2
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-06 11:47:40
               date|                            |
            Summary|templated code optimization |[3.3/3.4 Regression] Missed
                   |fails on fixed boolean      |inline opportunity
                   |template parameter          |
   Target Milestone|---                         |3.4.3


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


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