summaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-27 21:09:28 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-27 21:09:28 +0000
commitc0edfcc4dff63bcbbfdb726a7e1f36fd42c53c3c (patch)
tree0c91c9696e61dce79382b8d1c685a31b922c6dda /gcc/optabs.c
parentf812daaa13b06de601680b2246bfc021458d7cac (diff)
downloadgcc-c0edfcc4dff63bcbbfdb726a7e1f36fd42c53c3c.tar.gz
* optabs.c (no_conflict_move_test): Check if a result of a
to-be-moved insn would be clobbered by an originally preceding insn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104709 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 7ca39167390..31212cbc007 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3026,10 +3026,16 @@ no_conflict_move_test (rtx dest, rtx set, void *p0)
|| (CALL_P (p->first) && (find_reg_fusage (p->first, USE, dest)))
|| reg_used_between_p (dest, p->first, p->insn)
/* Likewise if this insn depends on a register set by a previous
- insn in the list. */
+ insn in the list, or if it sets a result (presumably a hard
+ register) that is set or clobbered by a previous insn.
+ N.B. the modified_*_p (SET_DEST...) tests applied to a MEM
+ SET_DEST perform the former check on the address, and the latter
+ check on the MEM. */
|| (GET_CODE (set) == SET
&& (modified_in_p (SET_SRC (set), p->first)
- || modified_between_p (SET_SRC (set), p->first, p->insn))))
+ || modified_in_p (SET_DEST (set), p->first)
+ || modified_between_p (SET_SRC (set), p->first, p->insn)
+ || modified_between_p (SET_DEST (set), p->first, p->insn))))
p->must_stay = true;
}