This is the mail archive of the gcc@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]

Re: Re-run of loop pass


Toon Moene writes:

 > I think we're talking at cross purposes - the above code doesn't  
 > have a constant iteration count.  The iteration count is N / 4 iff N  
 > % 4 == 0 (in fact, the code as shown assumes this).  The code was  
 > just meant to show why we're running loop unrolling *after* the  
 > second pass through loop opt ...

Oops, it's 15+ years since I used to program in Fortran.  I assumed N
was a constant.

 > If -funroll-loops nevertheless generates worse code, than that's  
 > due to something I haven't foreseen.

It only generates poorer code for loops with a constant iteration
count on machines with autoincrement addressing when using loop
unrolling or BCT optimisations.  The same problem is exhibited on a
single loop pass for examples such as

void fcopy1(float *a, float *b)
{
  float *c;
    
  for (c = a; c < a + 4; )
    *c++ = *b++;
}

Michael.




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