]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/43367 (ice: in may_propagate_copy, at tree-ssa-copy.c:85)
authorRichard Guenther <rguenther@suse.de>
Mon, 15 Mar 2010 13:18:45 +0000 (13:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 15 Mar 2010 13:18:45 +0000 (13:18 +0000)
2010-03-15  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/43367
* tree-cfg.c (gimple_can_merge_blocks_p): Simplify PHI
elimination check.

* gcc.c-torture/compile/pr43367.c: New testcase.

From-SVN: r157458

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr43367.c [new file with mode: 0644]
gcc/tree-cfg.c

index bd0736436c83753de31bfb7d47d12ba7b7c53a7b..434288ebdba1875b95a436c8a91588b1a8a429e0 100644 (file)
@@ -1,3 +1,9 @@
+2010-03-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/43367
+       * tree-cfg.c (gimple_can_merge_blocks_p): Simplify PHI
+       elimination check.
+
 2010-03-15  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/43317
index 65c465fa02b4953ebf03f140f04624740a2ec218..bd2f07b7b4c895eafd90bfdd28abd0f3713742fc 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/43367
+       * gcc.c-torture/compile/pr43367.c: New testcase.
+
 2010-03-15  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/43317
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43367.c b/gcc/testsuite/gcc.c-torture/compile/pr43367.c
new file mode 100644 (file)
index 0000000..5c620c1
--- /dev/null
@@ -0,0 +1,30 @@
+unsigned char g_17;
+
+const unsigned char func_39 (unsigned char p_40, unsigned char * p_41)
+{
+  return 0;
+}
+
+void int327 (const unsigned char p_48, unsigned char p_49)
+{
+  unsigned l_52;
+  unsigned char l_58[2];
+  int i, j;
+  if (func_39 (l_52, &p_49), p_48) {
+      unsigned char *l_60;
+      unsigned char *l = &l_58[1];
+      for (j; j; j++) {
+lbl_59:
+         break;
+      }
+      for (l = 0; 1; l += 1) {
+         for (p_49 = 1; p_49; p_49 += 0) {
+             unsigned char **l_61[1][6];
+             for (j = 0; j < 1; j++)
+               l_61[i][j] = &l_60;
+             goto lbl_59;
+         }
+      }
+  }
+}
+
index e5ed9ec7006a0b1ab7b52e8a9256ddf39f62d62e..6f4e4167a6bc2bd66c40a68f3752964197747e9b 100644 (file)
@@ -1438,27 +1438,12 @@ gimple_can_merge_blocks_p (basic_block a, basic_block b)
     return false;
 
   /* It must be possible to eliminate all phi nodes in B.  If ssa form
-     is not up-to-date, we cannot eliminate any phis; however, if only
-     some symbols as whole are marked for renaming, this is not a problem,
-     as phi nodes for those symbols are irrelevant in updating anyway.  */
+     is not up-to-date and a name-mapping is registered, we cannot eliminate
+     any phis.  Symbols marked for renaming are never a problem though.  */
   phis = phi_nodes (b);
-  if (!gimple_seq_empty_p (phis))
-    {
-      gimple_stmt_iterator i;
-
-      if (name_mappings_registered_p ())
-       return false;
-
-      for (i = gsi_start (phis); !gsi_end_p (i); gsi_next (&i))
-       {
-         gimple phi = gsi_stmt (i);
-
-         if (!is_gimple_reg (gimple_phi_result (phi))
-             && !may_propagate_copy (gimple_phi_result (phi),
-                                     gimple_phi_arg_def (phi, 0)))
-           return false;
-       }
-    }
+  if (!gimple_seq_empty_p (phis)
+      && name_mappings_registered_p ())
+    return false;
 
   return true;
 }