]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/57214 (ice: tree check: expected ssa_name, have integer_cst...
authorRichard Biener <rguenther@suse.de>
Fri, 10 May 2013 12:20:36 +0000 (12:20 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 10 May 2013 12:20:36 +0000 (12:20 +0000)
2013-05-10  Richard Biener  <rguenther@suse.de>

PR tree-optimization/57214
* tree-ssa-loop-ivcanon.c (propagate_constants_for_unrolling): Do
not propagate from SSA names that occur in abnormal PHI nodes.

From-SVN: r198773

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr57214.c [new file with mode: 0644]
gcc/tree-ssa-loop-ivcanon.c

index bdc8bc50e10ce080f92bea8cdd37cfc4b69b3ddf..8980e5e199c25fae14a7c8c629d2cf121a480e9b 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-10  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/57214
+       * tree-ssa-loop-ivcanon.c (propagate_constants_for_unrolling): Do
+       not propagate from SSA names that occur in abnormal PHI nodes.
+
 2013-05-10  Marc Glisse  <marc.glisse@inria.fr>
 
        * stor-layout.c (element_precision): New function.
index d8e13548d966dcb38707f34d4d3650de48ecbc07..6ab94b216f7ab123cb7b740935c5f6861d243d40 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-10  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/57214
+       * tree-ssa-loop-ivcanon.c (propagate_constants_for_unrolling): Do
+       not propagate from SSA names that occur in abnormal PHI nodes.
+
 2013-05-10  Marc Glisse  <marc.glisse@inria.fr>
 
        * gcc.dg/vector-shift.c: New testcase.
diff --git a/gcc/testsuite/gcc.dg/torture/pr57214.c b/gcc/testsuite/gcc.dg/torture/pr57214.c
new file mode 100644 (file)
index 0000000..d51067d
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+extern int baz (void);
+extern int foo (void) __attribute__ ((returns_twice));
+
+void
+bar (_Bool b)
+{
+  int buf[1];
+  while (1)
+    {
+      _Bool x = 1;
+      if (b)
+       baz ();
+      b = 1;
+      baz ();
+      x = 0;
+      int i;
+      while (buf[i] && i)
+       i++;
+      foo ();
+      if (!x)
+       b = 0;
+    }
+}
index c57e4f6a30d3ce727c15ee040debb8639d07635e..b5751cb7f7fcc11b7706eff9a8f7e1eed33c7036 100644 (file)
@@ -1085,8 +1085,9 @@ propagate_constants_for_unrolling (basic_block bb)
       tree lhs;
 
       if (is_gimple_assign (stmt)
+         && gimple_assign_rhs_code (stmt) == INTEGER_CST
          && (lhs = gimple_assign_lhs (stmt), TREE_CODE (lhs) == SSA_NAME)
-         && gimple_assign_rhs_code (stmt) == INTEGER_CST)
+         && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
        {
          propagate_into_all_uses (lhs, gimple_assign_rhs1 (stmt));
          gsi_remove (&gsi, true);
This page took 0.073678 seconds and 5 git commands to generate.