summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1993-10-19 04:42:27 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1993-10-19 04:42:27 +0000
commit5d71471bd35db6b6ae4a6a48bb78c71fd9cb00c3 (patch)
treeff769c66ea9f3e5b329adb8fcdbbe270ee1331c5 /gcc/combine.c
parent4e8dd66b8914945fa16adfff4e7f49f5da981747 (diff)
downloadgcc-5d71471bd35db6b6ae4a6a48bb78c71fd9cb00c3.tar.gz
(can_combine_p): Don't combine instructions across a volatile insn.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5802 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index bee4d534272..fd559471dd6 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -927,6 +927,14 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc)
&& p != succ && volatile_refs_p (PATTERN (p)))
return 0;
+ /* If there are any volatile insns between INSN and I3, reject, because
+ they might affect machine state. */
+
+ for (p = NEXT_INSN (insn); p != i3; p = NEXT_INSN (p))
+ if (GET_RTX_CLASS (GET_CODE (p)) == 'i'
+ && p != succ && volatile_insn_p (PATTERN (p)))
+ return 0;
+
/* If INSN or I2 contains an autoincrement or autodecrement,
make sure that register is not used between there and I3,
and not already used in I3 either.