diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-07-02 03:25:39 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-07-02 03:25:39 +0000 |
commit | f474c2ef2f359c4c28960e114daf7c00392a287c (patch) | |
tree | e7cf4c04b77f6099add1f9e5f5540ee564e3162b /gcc/reorg.c | |
parent | 909f50d301534f1ded5c7ef11c84e748b0f357da (diff) | |
download | gcc-f474c2ef2f359c4c28960e114daf7c00392a287c.tar.gz |
(redundant_insn): If INSN or possible match has REG_UNUSED note, don't
have match.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14370 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r-- | gcc/reorg.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c index 5f24cfc200c..77279f9d812 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -1997,6 +1997,11 @@ redundant_insn (insn, target, delay_list) struct resources needed, set; int i; + /* If INSN has any REG_UNUSED notes, it can't match anything since we + are allowed to not actually assign to such a register. */ + if (find_reg_note (insn, REG_UNUSED, NULL_RTX) != 0) + return 0; + /* Scan backwards looking for a match. */ for (trial = PREV_INSN (target); trial; trial = PREV_INSN (trial)) { @@ -2035,7 +2040,8 @@ redundant_insn (insn, target, delay_list) resource requirements as we go. */ for (i = XVECLEN (pat, 0) - 1; i > 0; i--) if (GET_CODE (XVECEXP (pat, 0, i)) == GET_CODE (insn) - && rtx_equal_p (PATTERN (XVECEXP (pat, 0, i)), ipat)) + && rtx_equal_p (PATTERN (XVECEXP (pat, 0, i)), ipat) + && ! find_reg_note (XVECEXP (pat, 0, i), REG_UNUSED, NULL_RTX)) break; /* If found a match, exit this loop early. */ @@ -2043,7 +2049,8 @@ redundant_insn (insn, target, delay_list) break; } - else if (GET_CODE (trial) == GET_CODE (insn) && rtx_equal_p (pat, ipat)) + else if (GET_CODE (trial) == GET_CODE (insn) && rtx_equal_p (pat, ipat) + && ! find_reg_note (trial, REG_UNUSED, NULL_RTX)) break; } |