This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/38984] [4.2/4.3/4.4 Regression] NULL pointers always considered distinct by PTA, even with -fno-delete-null-pointer-checks
- From: "bonzini at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jan 2009 12:27:31 -0000
- Subject: [Bug tree-optimization/38984] [4.2/4.3/4.4 Regression] NULL pointers always considered distinct by PTA, even with -fno-delete-null-pointer-checks
- References: <bug-38984-7849@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from bonzini at gnu dot org 2009-01-27 12:27 -------
>From PR38985:
> These passes are able to propagate the address to the load: CCP, VRP, DOM. If
> we decide that it's an invalid transformation, fixing them would fix this bug.
The interesting part is that after you disable them... you find out PTA is not
actually able to use the NULL special variable because *NULL and *ANYTHING
conflict! The pointed-to sets are okay though:
pD.1230_1(D), is dereferenced, its value escapes, points-to anything
nullD.1234_3, is dereferenced, points-to anything, points-to NULL
The patch in comment #1 however works (tested with -fno-tree-ccp -fno-tree-vrp
-fno-tree-dominator-opts, and looking at the constraints for null). So my plan
would be:
1) apply the patch after regtesting, XFAILing the testcase;
2) when PR38985 is fixed, the testcase will pass and the XFAIL will be removed.
Sounds okay?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38984