re PR tree-optimization/57442 (ICE in appears_later_in_bb, at tree-ssa-reassoc.c...
authorEaswaran Raman <eraman@google.com>
Wed, 29 May 2013 17:30:43 +0000 (17:30 +0000)
committerEaswaran Raman <eraman@gcc.gnu.org>
Wed, 29 May 2013 17:30:43 +0000 (17:30 +0000)
2013-05-29  Easwaran Raman  <eraman@google.com>

PR tree-optimization/57442
* tree-ssa-reassoc.c (appears_later_in_bb): Return correct value
when control exits the main loop.

2013-05-29  Easwaran Raman  <eraman@google.com>

PR tree-optimization/57442
* gcc.dg/tree-ssa/reassoc-30.c: New testcase.

From-SVN: r199418

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/reassoc-30.c [new file with mode: 0644]
gcc/tree-ssa-reassoc.c

index 13807be66ce8baf6e1be747455b366644a197ed0..dda218445715002b637d78b6a734ec0ba454d583 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-29  Easwaran Raman  <eraman@google.com>
+
+       PR tree-optimization/57442
+       * tree-ssa-reassoc.c (appears_later_in_bb): Return correct value
+       when control exits the main loop.
+
 2013-05-29  Sandeep Kumar Singh  <Sandeep.Singh2@kpitcummins.com>
 
        * rx/rx.h (TARGET_CPU_CPP_BUILTINS): Add macros for RX100, RX200,
index 4aedfc94fb7507f5d421317fae895dff682b7b73..64b0f58c158f32dd725ecc9d54a7de222e183a69 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-29  Easwaran Raman  <eraman@google.com>
+
+       PR tree-optimization/57442
+       * gcc.dg/tree-ssa/reassoc-30.c: New testcase.
+
 2013-05-29  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR tree-optimization/57441
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-30.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-30.c
new file mode 100644 (file)
index 0000000..6628984
--- /dev/null
@@ -0,0 +1,13 @@
+/* PR tree-optimization/57442 */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+short a;
+unsigned b;
+long c;
+int d;
+
+void f(void)
+{
+    b = a ? : (a = b) - c + (d - (b + b));
+}
+
index 24ad390333c5bdd06c377e2e8aa4db285056b8e4..784477b5922c0a7658bc88343332d96fa8ee3360 100644 (file)
@@ -2888,7 +2888,7 @@ appears_later_in_bb (gimple stmt1, gimple stmt2)
       else if (stmt == stmt2)
         return stmt2;
     }
-  gcc_unreachable ();
+  return stmt1;
 }
 
 /* Find the statement after which STMT must be moved so that the