This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Why does GCJ generate so many explicit checks for null pointers?
Jeff Sturm writes:
> On Mon, 28 Jul 2003, David Daney wrote:
> > Why check before the constructor call? Is it ever possible for
> > _Jv_AllocObjectNoFinalizer to return null?
>
> No, but the backend optimizers don't know that, or else DCE would
> eliminate the test.
> Currently only a few java-specific optimizations are done by gcj.
Null pointer check elimination isn't really Java specific.
The plan is to do this optimization in tree-SSA. With that framework
it isn't very difficult.
Andrew.