From d6600130faf0a670610f412c88dd3614be5886c0 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 19 Jan 2010 13:39:42 +0100 Subject: [PATCH] re PR tree-optimization/42719 ("-fcompare-debug failure" with "-O2 -ftracer") PR tree-optimization/42719 * tree-outof-ssa.c (trivially_conflicts_p): Don't consider debug stmt uses. * gcc.dg/pr42719.c: New test. From-SVN: r156038 --- gcc/ChangeLog | 4 ++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/pr42719.c | 14 ++++++++++++++ gcc/tree-outof-ssa.c | 2 ++ 4 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr42719.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b6ea293c4e8..18dccd607c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2010-01-19 Jakub Jelinek + 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. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f2a4f8a1984..a4aafda48b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2010-01-19 Jakub Jelinek + 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 index 00000000000..94a58e41a1a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr42719.c @@ -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]; +} diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c index a82cec824fd..32aa464948b 100644 --- a/gcc/tree-outof-ssa.c +++ b/gcc/tree-outof-ssa.c @@ -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)