]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR tree-optimization/42719
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Jan 2010 12:39:42 +0000 (12:39 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Jan 2010 12:39:42 +0000 (12:39 +0000)
* tree-outof-ssa.c (trivially_conflicts_p): Don't consider debug
stmt uses.

* gcc.dg/pr42719.c: New test.

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

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

index b6ea293c4e8bb47d9b4c1c28f21d1712dedd1a3d..18dccd607c77b4b9715c1c44d17ff502e22c27f3 100644 (file)
@@ -1,5 +1,9 @@
 2010-01-19  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/42719
+       * tree-outof-ssa.c (trivially_conflicts_p): Don't consider debug
+       stmt uses.
+
        PR debug/42728
        * fwprop.c (all_uses_available_at): Return false if def_set dest
        is a REG that is used in def_insn.
index f2a4f8a198486f0769cd62de979f39d9acdfd66b..a4aafda48b73d829af33ff5761e65c5822ef7fc8 100644 (file)
@@ -1,5 +1,8 @@
 2010-01-19  Jakub Jelinek  <jakub@redhat.com>
 
+       PR tree-optimization/42719
+       * gcc.dg/pr42719.c: New test.
+
        PR debug/42728
        * gcc.dg/pr42728.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/pr42719.c b/gcc/testsuite/gcc.dg/pr42719.c
new file mode 100644 (file)
index 0000000..94a58e4
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR tree-optimization/42719 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftracer -fcompare-debug" } */
+
+int *v;
+
+void
+foo (int a)
+{
+  int i, j;
+  for (j = i = a; i != -1; j = i, i = v[i])
+    ;
+  v[j] = v[a];
+}
index a82cec824fdf201795c4f1eceff6a947a88125ea..32aa464948b3ce0dbb89bf89be628eb0a6a795b8 100644 (file)
@@ -956,6 +956,8 @@ trivially_conflicts_p (basic_block bb, tree result, tree arg)
   FOR_EACH_IMM_USE_FAST (use, imm_iter, result)
     {
       gimple use_stmt = USE_STMT (use);
+      if (is_gimple_debug (use_stmt))
+       continue;
       /* Now, if there's a use of RESULT that lies outside this basic block,
         then there surely is a conflict with ARG.  */
       if (gimple_bb (use_stmt) != bb)