gcj non-optimization curiosity

Per Bothner per@bothner.com
Sun Dec 16 13:29:00 GMT 2001


Tom Tromey wrote:
> There are a few things I don't understand about this code that I would
> like to understand.
>> * Why isn't the null-pointer check hoisted out of the loop?
> We know `foo' doesn't change during the loop, so this would be safe.
>> * Why is the length of the array ("movl 4(%eax), %edx") re-loaded each
> time through the loop?
>> * Why isn't the array index check eliminated? We've already done the
> comparison once; we know this can't fail.

Because nobody has written the necessary optimizations?
I'm not sure I understand what you're getting at. Is there some
claim that we *do* do these optimizations?
In any case, these questions might be better asked to the general
gcc list, since you are talking about optimizations that depend
on data flow analysis, though they also depend on Java-specific
semantics (e.g. that an array can't change size).
-- 
	--Per Bothner
per@bothner.com http://www.bothner.com/per/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /