This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR39207, bogus alias warnings again
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 Feb 2009 14:36:06 +0100 (CET)
- Subject: [PATCH] Fix PR39207, bogus alias warnings again
We shouldn't warn about dereferecing { NULL } with a strict-aliasing
warning.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2009-02-17 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39207
* tree-ssa-structalias.c (find_what_p_points_to): Do not emit
strict-aliasing warnings for pointers pointing to NULL.
Index: gcc/tree-ssa-structalias.c
===================================================================
*** gcc/tree-ssa-structalias.c (revision 144226)
--- gcc/tree-ssa-structalias.c (working copy)
*************** find_what_p_points_to (tree p)
*** 4935,4940 ****
--- 4935,4941 ----
{
pi->pt_vars = NULL;
if (pruned > 0
+ && !pi->pt_null
&& pi->is_dereferenced
&& warn_strict_aliasing > 0
&& !SSA_NAME_IS_DEFAULT_DEF (p))