This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Null pointer check elimination
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: Joe dot Buck at synopsys dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 14 Nov 05 21:25:38 EST
- Subject: Re: Null pointer check elimination
Maybe the middle end should only have one pointer type, but with at
least two attributes, one to tell the debugger to auto-dereference,
one to mark those pointers that cannot point to null. This might
enable more optimization.
That would certainly be my recommendation. It would also get rid of the
TYPE_REFERENCE_TO field in types, which would save space.
We originally had at most one POINTER_TYPE and at most one REFERENCE_TYPE
pointing at each type. But that changed with code (partly mine) that allowed
for a sort of "variant" of pointers, so that they could have a different mode
and a "deref aliases all" flag. Added the suggested flags would just be an
extension of this, would eliminate the question of "what's the difference
between POINTER_TYPE and REFERENCE_TYPE" once and for all, and would simplify
some code. Because build_reference_type would still exist, front end changes
would be minimized.