This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa/java] remaining null-pointer-check hits
- From: Steven Bosscher <stevenb at suse dot de>
- To: law at redhat dot com
- Cc: gcc at gcc dot gnu dot org, java at gcc dot gnu dot org
- Date: Tue, 4 May 2004 20:35:29 +0200
- Subject: Re: [tree-ssa/java] remaining null-pointer-check hits
- Organization: SUSE Labs
- References: <200405041529.i44FTsxS018536@speedy.slc.redhat.com>
On Tuesday 04 May 2004 17:29, law@redhat.com wrote:
> I've got the changes necessary to allow DOM to see through these casts
> (it's only a few lines of code). This picks up most of the cases where
> the RTL null pointer check elimination code was finding something useful
> to do.
Cool.
> I've also made a trivial extension to DOM which allows it to propagate the
> non-null property through PHI nodes. ie, if all arguments to a PHI node
> are known to be nonzero, then the result of the PHI node must also be
> nonzero. That fixed the half-dozen cases we missed in GCC itself.
Isn't this something ccp can do instead? Or did you add this to keep
all the null checks together in one file? It's a bit unintiutive that
DOM would have to look through dominance frontiers ;-)
> The net result is we're left one case we're not handling. Specifically if
> we have multiple paths where a pointer is dereferenced and there is no
> PHI node at their join point. ie
>
> BLOCK1 BLOCK 2
> p1->field p1->field
> \ /
> \ /
> \ /
> \ /
> BLOCK 3
> if (p1) ...
How many of these appear in other important software (e.g. kernel, glibc,
SPEC)?
> Anyway, I'll check these bits in once the merge is complete. Barring
> objections I'll also wipe the RTL null pointer check elimination code.
Whee, one down, NaN to go!
Gr.
Steven