(can_combine_p): Don't combine instructions across a volatile insn.
authorRichard Stallman <rms@gnu.org>
Tue, 19 Oct 1993 04:42:27 +0000 (04:42 +0000)
committerRichard Stallman <rms@gnu.org>
Tue, 19 Oct 1993 04:42:27 +0000 (04:42 +0000)
From-SVN: r5802

gcc/combine.c

index bee4d5342721e4c818985912885d391e19bf8faa..fd559471dd64f0bf3d8d32a54a436a5adec07042 100644 (file)
@@ -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.