OSDN Git Service

2010-05-03 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 May 2010 16:12:12 +0000 (16:12 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 04:57:32 +0000 (13:57 +0900)
PR tree-optimization/43971
* tree-ssa-structalias.c (get_constraint_for_1): Fix
constraints in the !flag_delete_null_pointer_checks case.

* gcc.dg/pr43971.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158991 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/tree-ssa-structalias.c

index e62e9ab..e461f4b 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-03  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/43971
+       * tree-ssa-structalias.c (get_constraint_for_1): Fix
+       constraints in the !flag_delete_null_pointer_checks case.
+
 2010-05-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/43972
index 5fe4b1d..019661e 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-03  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/43971
+       * gcc.dg/pr43971.c: New testcase.
+
 2010-05-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/43972
index fce39de..89b5c9c 100644 (file)
@@ -3286,16 +3286,18 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p)
      in that case *NULL does not fail, so it _should_ alias *anything.
      It is not worth adding a new option or renaming the existing one,
      since this case is relatively obscure.  */
-  if (flag_delete_null_pointer_checks
-      && ((TREE_CODE (t) == INTEGER_CST
-          && integer_zerop (t))
-         /* The only valid CONSTRUCTORs in gimple with pointer typed
-            elements are zero-initializer.  But in IPA mode we also
-            process global initializers, so verify at least.  */
-         || (TREE_CODE (t) == CONSTRUCTOR
-             && CONSTRUCTOR_NELTS (t) == 0)))
-    {
-      temp.var = nothing_id;
+  if ((TREE_CODE (t) == INTEGER_CST
+       && integer_zerop (t))
+      /* The only valid CONSTRUCTORs in gimple with pointer typed
+        elements are zero-initializer.  But in IPA mode we also
+        process global initializers, so verify at least.  */
+      || (TREE_CODE (t) == CONSTRUCTOR
+         && CONSTRUCTOR_NELTS (t) == 0))
+    {
+      if (flag_delete_null_pointer_checks)
+       temp.var = nothing_id;
+      else
+       temp.var = anything_id;
       temp.type = ADDRESSOF;
       temp.offset = 0;
       VEC_safe_push (ce_s, heap, *results, &temp);