This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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: gcj non-optimization curiosity


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/


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