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]
Other format: [Raw text]

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


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