This is the mail archive of the 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]

PATCH: Re: gcj non-optimization curiosity

Bryce McKinlay writes:
 > When explicit null pointer checks got added (for MMU-less targets), 
 > calls to java_check_reference were introduced with the 
 > flag_check_references argument. But for some reason - presumably a 
 > mistake - the check that occurs during array bounds checks uses "1"!

If I recall correctly, the explicit pointer check was there before --
but commented out for some reason -- and when the explicit null
pointer checks were added that behavour wasn't left in.

 > I guess that with the java_check_reference the optimizer could not 
 > eliminate the check because it doesn't know that "new" can never return 
 > null, but why it couldn't move it out of the loop is a mystery!

I presume that NullPointerException will be thrown in the right place
even without the check.  I must say that I'd be very interested to
know why the check isn't being hoisted out of the loop, though.  I
guess the answer is that our loop optimizer needs some more attention.


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