+2012-02-01 Georg-Johann Lay <avr@gjlay.de>
+
+ PR rtl-optimization/51374
+ * combine.c (can_combine_p): Don't allow volatile_refs_p insns
+ to cross other volatile_refs_p insns.
+
2012-02-01 Richard Guenther <rguenther@suse.de>
* doc/invoke.texi (fno-inline): Clarify documentation.
rtx link;
#endif
bool all_adjacent = true;
+ int (*is_volatile_p) (const_rtx);
if (succ)
{
&& REG_P (dest) && REGNO (dest) < FIRST_PSEUDO_REGISTER)
return 0;
- /* If there are any volatile insns between INSN and I3, reject, because
- they might affect machine state. */
+ /* If INSN contains volatile references (specifically volatile MEMs),
+ we cannot combine across any other volatile references.
+ Even if INSN doesn't contain volatile references, any intervening
+ volatile insn might affect machine state. */
+ is_volatile_p = volatile_refs_p (PATTERN (insn))
+ ? volatile_refs_p
+ : volatile_insn_p;
+
for (p = NEXT_INSN (insn); p != i3; p = NEXT_INSN (p))
- if (INSN_P (p) && p != succ && p != succ2 && volatile_insn_p (PATTERN (p)))
+ if (INSN_P (p) && p != succ && p != succ2 && is_volatile_p (PATTERN (p)))
return 0;
/* If INSN contains an autoincrement or autodecrement, make sure that
+2012-02-01 Georg-Johann Lay <avr@gjlay.de>
+
+ PR rtl-optimization/51374
+ * testsuite/gcc.target/avr/torture/pr51374-1.c: New.
+
2012-01-31 Tobias Burnus <burnus@net-b.de>
PR fortran/52024
--- /dev/null
+/* PR rtl-optimization/51374 */
+/* { dg-do compile } */
+
+void vector_18 (void)
+{
+ extern char slot;
+ unsigned char status = (*(volatile unsigned char*) 0x2B);
+ unsigned char data = (*(volatile unsigned char*) 0x2C);
+
+ if (status & 0x10)
+ slot = 0;
+}
+
+/* { dg-final { scan-assembler-not "\tsbic " } } */