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


> I've come up with a better patch that tries to determine what the
> expressions for the loop initial and final values are if they are not
> constant.  If the initial and final expressions are the sum of an
> equivalent base register and some constants, then the initial and
> final values are replaced with the constants.  The number of loop
> iterations is now simply calculable and thus the loop unroll and loop
> BCT optimisations are happy.

I have the suspicion that this will miscompile this testcase:

int
f (unsigned start)
{
  int i, j;

  for (j = 0, i = start; i < start + 5; i++)
    j++;
  return j;
}

int
main ()
{
  int i;

  i = f (0U-1);
  if (i)
    abort ();
  exit (0);
}


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