aboutsummaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@st.com>2005-06-01 11:38:53 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2005-06-01 12:38:53 +0100
commit5fffc382a653d195d175a0e03f0262fb07962a3e (patch)
tree9aa79da08f8f0253c34a6a51b34ed733dc7fbacf /gcc/ifcvt.c
parent8e0a600bdd9dee1b4eb8f3e5ce840e76fdabf133 (diff)
downloadgcc-5fffc382a653d195d175a0e03f0262fb07962a3e.zip
gcc-5fffc382a653d195d175a0e03f0262fb07962a3e.tar.gz
gcc-5fffc382a653d195d175a0e03f0262fb07962a3e.tar.bz2
re PR rtl-optimization/21767 (if-convert leaves invalid REG_EQUAL notes)
PR rtl-optimization/21767 * rtl.h (function_invariant_p): Re-add declaration. * reload1.c (function_invariant_p): No longer static. * ifcvt.c (dead_or_predicable): Remove REG_EQUAL notes that might have become invalid. From-SVN: r100448
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 5c822b6..d4b66a5 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -3430,12 +3430,31 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
/* Move the insns out of MERGE_BB to before the branch. */
if (head != NULL)
{
+ rtx insn;
+
if (end == BB_END (merge_bb))
BB_END (merge_bb) = PREV_INSN (head);
if (squeeze_notes (&head, &end))
return TRUE;
+ /* PR 21767: When moving insns above a conditional branch, REG_EQUAL
+ notes might become invalid. */
+ insn = head;
+ do
+ {
+ rtx note, set;
+
+ if (! INSN_P (insn))
+ continue;
+ note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
+ if (! note)
+ continue;
+ set = single_set (insn);
+ if (!set || !function_invariant_p (SET_SRC (set)))
+ remove_note (insn, note);
+ } while (insn != end && (insn = NEXT_INSN (insn)));
+
reorder_insns (head, end, PREV_INSN (earliest));
}