This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: java aliasing rules
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Cc: tromey at redhat dot com, Dan Nicolaescu <dann at godzilla dot ics dot uci dot edu>, java at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Sat, 30 Mar 2002 09:35:54 -0500 (EST)
- Subject: Re: java aliasing rules
On Sat, 30 Mar 2002, Bryce McKinlay wrote:
> With this code, if "ps2" is null then the second load (lhz) will throw
> before the ps1.f1 is seen as incremented.
That's a shame.
> The optimal, correct code for
> Java is really something like:
>
> lhz r9, [ps1.f1]
> addi r9,r9,1
> sth r9, [ps1.f1]
Wouldn't accessing r9 immediately after the load cause a pipeline stall?
Assuming an in-order processor? That would be a significant performance
hit.
Come to think of it, what happens on an out-of-order processor (e.g.
Alpha EV6) when an instruction traps? Are preceding instructions
guaranteed to have completed? I'm curious.
Jeff