diff options
author | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-02 15:46:26 +0000 |
---|---|---|
committer | steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-12-02 15:46:26 +0000 |
commit | 44433d3b0feeabc2871f72d1edba81522eeb8c48 (patch) | |
tree | 413cf367e7b936822c65e09dddbfcca70f28aceb /gcc/fwprop.c | |
parent | d052c312c5545c50dee633d0d2a2436ea4e7af21 (diff) | |
download | gcc-44433d3b0feeabc2871f72d1edba81522eeb8c48.tar.gz |
* optabs.c (add_equal_note): Do not create self-referencing REG_EQUAL
notes.
* fwprop.c (forward_propagate_and_simplify): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194054 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fwprop.c')
-rw-r--r-- | gcc/fwprop.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fwprop.c b/gcc/fwprop.c index 0f2ee49ac14..35c82d7ed7f 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) |