This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Strange (wrong?) aliasing outcome
- From: Michael Veksler <VEKSLER at il dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Andrew Haley <aph at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Mon, 25 Oct 2004 22:42:51 +0200
- Subject: Re: Strange (wrong?) aliasing outcome
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