aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-06-23 07:54:14 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-06-23 07:54:14 -0400
commit963d6142cc5339d919bccf902a53a507ba7cc3d6 (patch)
tree0324d1b9a4c27af7dce89a387ff9cdd7b99df9c9
parentc71ebae3c4909d3ccad83bf87a6e36a21744182f (diff)
downloadgcc-963d6142cc5339d919bccf902a53a507ba7cc3d6.zip
gcc-963d6142cc5339d919bccf902a53a507ba7cc3d6.tar.gz
gcc-963d6142cc5339d919bccf902a53a507ba7cc3d6.tar.bz2
(fill_slots_from_thread): When replacing a use of a register with what it was set to...
(fill_slots_from_thread): When replacing a use of a register with what it was set to, don't do it when either the destination or source of the copy is set in the insn. From-SVN: r4716
-rw-r--r--gcc/reorg.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 3b6b205..5b89943 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -3237,9 +3237,11 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely,
but it doesn't seem worth it. It might also be a good idea to try
to swap the two insns. That might do better.
- We can't do this if the next insn modifies our source, because that
- would make the replacement into the insn invalid. This also
- prevents updating the contents of a PRE_INC. */
+ We can't do this if the next insn modifies our destination, because
+ that would make the replacement into the insn invalid. We also can't
+ do this if it modifies our source, because it might be an earlyclobber
+ operand. This latter test also prevents updating the contents of
+ a PRE_INC. */
if (GET_CODE (trial) == INSN && GET_CODE (pat) == SET
&& GET_CODE (SET_SRC (pat)) == REG
@@ -3250,6 +3252,7 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely,
if (next && GET_CODE (next) == INSN
&& GET_CODE (PATTERN (next)) != USE
&& ! reg_set_p (SET_DEST (pat), next)
+ && ! reg_set_p (SET_SRC (pat), next)
&& reg_referenced_p (SET_DEST (pat), PATTERN (next)))
validate_replace_rtx (SET_DEST (pat), SET_SRC (pat), next);
}