Strange (wrong?) aliasing outcome
Michael Veksler
VEKSLER@il.ibm.com
Mon Oct 25 23:53:00 GMT 2004
Richard Henderson <rth@redhat.com> wrote on 2004-10-25 19:31:13:
> On Mon, Oct 25, 2004 at 12:50:03PM +0200, Michael Veksler wrote:
> > I don't understand why when 'f' is not inlined, the (expensive)
> > division is not moved to the beginning of the function.
>
> It's quite obvious if you look at the dump:
....
>
> So the division instruction is emitted as soon as it could be.
> The write to pb->v[1] just happens in parallel.
Thanks, now I see how it makes sense. It is possible that the
different ISA of PPC will make GCC emit what I originally expected
(more like what xlC does). I'll check this later (after gcc
bootstrap on AIX).
By changing the first line of f() from:
pb->v[1]= pa->v0;
to
pb->v[1]= pa->v0 - pa->v1;
This gave me the wanted scenario where inputs to '/' are
read before the store to pv->v[1].
Thanks
Michael
More information about the Gcc
mailing list