summaryrefslogtreecommitdiff
path: root/gcc/fwprop.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fwprop.c')
-rw-r--r--gcc/fwprop.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 0c5c7280ad5..708ab3f8edc 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -818,17 +818,23 @@ all_uses_available_at (rtx def_insn, rtx target_insn)
}
else
{
+ rtx def_reg = REG_P (SET_DEST (def_set)) ? SET_DEST (def_set) : NULL_RTX;
+
/* Look at all the uses of DEF_INSN, and see if they are not
killed between DEF_INSN and TARGET_INSN. */
for (use_rec = DF_INSN_INFO_USES (insn_info); *use_rec; use_rec++)
{
df_ref use = *use_rec;
+ if (def_reg && rtx_equal_p (DF_REF_REG (use), def_reg))
+ return false;
if (use_killed_between (use, def_insn, target_insn))
return false;
}
for (use_rec = DF_INSN_INFO_EQ_USES (insn_info); *use_rec; use_rec++)
{
df_ref use = *use_rec;
+ if (def_reg && rtx_equal_p (DF_REF_REG (use), def_reg))
+ return false;
if (use_killed_between (use, def_insn, target_insn))
return false;
}