aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-08-20 20:56:49 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-08-20 20:56:49 +0200
commit07bc8ae8abd68eaf968f77f453e33ec60c371bb3 (patch)
tree013abe1ce3cdfba67f32519713150bc97ed65657 /gcc
parent59e08d4f0996d95bb83730f86cc369c53716f79e (diff)
downloadgcc-07bc8ae8abd68eaf968f77f453e33ec60c371bb3.zip
gcc-07bc8ae8abd68eaf968f77f453e33ec60c371bb3.tar.gz
gcc-07bc8ae8abd68eaf968f77f453e33ec60c371bb3.tar.bz2
re PR rtl-optimization/54294 ([alpha] Bootstrap comparison failure due to fwprop handling of debug insns)
PR rtl-optimization/54294 * fwprop.c (all_uses_available_at): Ignore debug insns in between def_insn and target_insn when checking whether the shortcut is possible. From-SVN: r190541
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/fwprop.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0bec6d2..83cda06 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2012-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/54294
+ * fwprop.c (all_uses_available_at): Ignore debug insns in between
+ def_insn and target_insn when checking whether the shortcut is
+ possible.
+
2012-08-20 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sparc.h (MAX_FIXED_MODE_SIZE): Define.
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index d1cba88..e64e76d 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -1,5 +1,5 @@
/* RTL-based forward propagation pass for GNU compiler.
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Paolo Bonzini and Steven Bosscher.
@@ -799,13 +799,17 @@ all_uses_available_at (rtx def_insn, rtx target_insn)
df_ref *use_rec;
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
rtx def_set = single_set (def_insn);
+ rtx next;
gcc_assert (def_set);
/* If target_insn comes right after def_insn, which is very common
- for addresses, we can use a quicker test. */
- if (NEXT_INSN (def_insn) == target_insn
- && REG_P (SET_DEST (def_set)))
+ for addresses, we can use a quicker test. Ignore debug insns
+ other than target insns for this. */
+ next = NEXT_INSN (def_insn);
+ while (next && next != target_insn && DEBUG_INSN_P (next))
+ next = NEXT_INSN (next);
+ if (next == target_insn && REG_P (SET_DEST (def_set)))
{
rtx def_reg = SET_DEST (def_set);