This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Global null pointer test
- To: <gcc at gcc dot gnu dot org>
- Subject: Global null pointer test
- From: "John Carter" <john dot carter at tait dot co dot nz>
- Date: Tue, 19 Jun 2001 10:01:51 +1200 (NZST)
I was looking at the V3.0 feature list when I came upon the global
null pointer test elimination optimization. I _love_ what what one can
do with full access to the internal compiler structures.
On the otherhand, if that optimization was ever applied to I anything
that I wrote, I would _much_ rather have a warning than have it
quietly optimized away.
Why? Because it clearly indicates that I'm in two minds on the
validity of that pointer, and equally clearly one of those two minds
is wrong...
Looking at gcse.c I suspect it would be fairly easy to add a very
small tweak that spat out a warning (if -Wnull-pointer-test is set) and
then did the optimization.
Should I have a bash at that? Or would the author of that code please
add it?
Thanks,
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand