extern int a[];
int foo(int w) {
int n = w;
while (n >= 512)
{
a[n] = 42;
n -= 256;
}
}

On Aug 30, 2005, at 9:25 AM, Sebastian Pop wrote:

Thanks for looking at this. But...

Dale Johannesen wrote:
I think this is a simple pasto; this code was evidently copied from
the previous block:

I don't think that this was a simple pasto. The code looks correct.
We have the same code in tree-ssa-loop-niter.c around line 436, since
we inherited this code from the rtl-level.

No, look closer. The version in loop-iv.c does a NEG of 'step' just before what's
shown here. The version in tree-ssa-loop-niter.c doesn't. Reversing the
operator does make them do the same thing. As a sanity check, try the same
loop going the other direction:

extern int a[];
int foo(int w) {
int n = w;
while (n <= 512)
{
a[n] = 42;
n += 256;
}
}

and you'll see it does do the doloop transformation.

Reply via email to