This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Re-run of loop pass
- To: m dot hayes at elec dot canterbury dot ac dot nz (Michael Hayes)
- Subject: Re: Re-run of loop pass
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Thu, 5 Nov 1998 00:34:41 +0000 (GMT)
- Cc: m dot hayes at elec dot canterbury dot ac dot nz, toon at moene dot indiv dot nluug dot nl, rth at cygnus dot com, law at cygnus dot com, egcs at cygnus dot com
> 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);
}