This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj non-optimization curiosity
- From: Per Bothner <per at bothner dot com>
- To: tromey at redhat dot com
- Cc: java at gcc dot gnu dot org
- Date: Sun, 16 Dec 2001 13:29:44 -0800
- Subject: Re: gcj non-optimization curiosity
- References: <87vgf628c4.fsf@creche.redhat.com>
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/