aboutsummaryrefslogtreecommitdiff
path: root/gcc/fwprop.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2012-12-02 15:46:26 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2012-12-02 15:46:26 +0000
commit853f8f1c1ced73b423dc1b56c81f4e78c6e5f734 (patch)
tree413cf367e7b936822c65e09dddbfcca70f28aceb /gcc/fwprop.c
parentfa967f341ce38053b0baf106454139e29786d061 (diff)
downloadgcc-853f8f1c1ced73b423dc1b56c81f4e78c6e5f734.zip
gcc-853f8f1c1ced73b423dc1b56c81f4e78c6e5f734.tar.gz
gcc-853f8f1c1ced73b423dc1b56c81f4e78c6e5f734.tar.bz2
optabs.c (add_equal_note): Do not create self-referencing REG_EQUAL notes.
* optabs.c (add_equal_note): Do not create self-referencing REG_EQUAL notes. * fwprop.c (forward_propagate_and_simplify): Likewise. From-SVN: r194054
Diffstat (limited to 'gcc/fwprop.c')
-rw-r--r--gcc/fwprop.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 0f2ee49..35c82d7 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -1315,9 +1315,12 @@ forward_propagate_and_simplify (df_ref use, rtx def_insn, rtx def_set)
/* Do not replace an existing REG_EQUAL note if the insn is not
recognized. Either we're already replacing in the note, or we'll
separately try plugging the definition in the note and simplifying.
- And only install a REQ_EQUAL note when the destination is a REG,
- as the note would be invalid otherwise. */
- set_reg_equal = (note == NULL_RTX && REG_P (SET_DEST (use_set)));
+ And only install a REQ_EQUAL note when the destination is a REG
+ that isn't mentioned in USE_SET, as the note would be invalid
+ otherwise. */
+ set_reg_equal = (note == NULL_RTX && REG_P (SET_DEST (use_set))
+ && ! reg_mentioned_p (SET_DEST (use_set),
+ SET_SRC (use_set)));
}
if (GET_MODE (*loc) == VOIDmode)