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: java aliasing rules


On Sun, 31 Mar 2002, Bryce McKinlay wrote:
> >>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.
> >
> 
> Right, its not optimal scheduling, but there's no way to avoid that and 
> still have the correct behaviour for NullPointers. And as you suggest, a 
> modern processor may be speculativly executing the following loads, so 
> it probibly doesn't matter too much.

Am I correct in thinking this is only an issue for -fnon-call-exceptions?

It might be useful to turn this "correctness" off with a compiler option,
as we do with -fno-bounds-check.  I habitually check for null in my code,
and don't do anything useful with a NullPointerException besides aborting.
I suspect that's true of a great deal of Java code.

(As an aside, it's hard to classify a "modern" processor...  SPARC
and IA-64 are in-order, and likely to remain that way.)

Jeff


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