]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
re PR tree-optimization/43679 (ice in gen_lsm_tmp_name, at tree-ssa-loop-im.c:1812)
authorRichard Guenther <rguenther@suse.de>
Thu, 8 Apr 2010 10:25:57 +0000 (10:25 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 8 Apr 2010 10:25:57 +0000 (10:25 +0000)
2010-04-08  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/43679
* tree-ssa-pre.c (eliminate): Only propagate copies.

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

From-SVN: r158113

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr43679.c [new file with mode: 0644]
gcc/tree-ssa-pre.c

index 3d66cf106c952006239f77121a5c11ab7ab7b0e0..903860cca21489b7efa1a03654eeba7b3f5728c5 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-08  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/43679
+       * tree-ssa-pre.c (eliminate): Only propagate copies.
+
 2010-04-08  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/43670
index fbff59e38941533b7dbc58a4870fe655369b1ce5..ca0a6fd306b34e253c91b8c7a6bb10285dfc81dc 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-08  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/43679
+       * gcc.c-torture/compile/pr43679.c: New testcase.
+
 2010-04-08  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/43670
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr43679.c b/gcc/testsuite/gcc.c-torture/compile/pr43679.c
new file mode 100644 (file)
index 0000000..c45ef9f
--- /dev/null
@@ -0,0 +1,33 @@
+unsigned g_5;
+int g_7;
+int g_23[2];
+int *g_29 = &g_23[0];
+int **g_59;
+unsigned long g_186;
+
+int foo (int, int);
+int bar (int);
+
+void func_37 (long p_38)
+{
+  int *l_39 = &g_7;
+  *l_39 = (*l_39
+             ||
+             (foo
+              (((*g_29 != *l_39, ((bar (g_59 != &l_39), 0), 0))),
+               0)));
+  foo (*l_39, 0);
+  int **l_256 = &l_39;
+  {
+    for (0; g_186; 0)
+      {
+        *l_256 = *l_256;
+        if (g_5)
+          goto lbl_270;
+        *l_39 &= 0;
+      }
+  }
+lbl_270:
+  ;
+}
+
index 24172f731886c86d4fe47df1fb5c9ed4aa72665c..88012c126b1516eb9dbd88e7e4ed5687c2e795d2 100644 (file)
@@ -4379,15 +4379,16 @@ eliminate (void)
   for (i = 0; VEC_iterate (gimple, to_remove, i, stmt); ++i)
     {
       tree lhs = gimple_assign_lhs (stmt);
+      tree rhs = gimple_assign_rhs1 (stmt);
       use_operand_p use_p;
       gimple use_stmt;
 
       /* If there is a single use only, propagate the equivalency
         instead of keeping the copy.  */
       if (TREE_CODE (lhs) == SSA_NAME
+         && TREE_CODE (rhs) == SSA_NAME
          && single_imm_use (lhs, &use_p, &use_stmt)
-         && may_propagate_copy (USE_FROM_PTR (use_p),
-                                gimple_assign_rhs1 (stmt)))
+         && may_propagate_copy (USE_FROM_PTR (use_p), rhs))
        {
          SET_USE (use_p, gimple_assign_rhs1 (stmt));
          update_stmt (use_stmt);