Hi We should not combine insns cross volatile insns. Combine.c already does this check, postreload should also do so.
Bootstrapped and regtested on x86_64-unknown-linux-gnu. Regtested on arm qemu. thanks Carrot ChangeLog: 2011-09-19 Wei Guozhi <car...@google.com> PR 49452 * postreload.c (reload_combine): Invalidate use information when across volatile insn. Index: postreload.c =================================================================== --- postreload.c (revision 178938) +++ postreload.c (working copy) @@ -1312,7 +1312,8 @@ reload_combine (void) is and then later disable any optimization that would cross it. */ if (LABEL_P (insn)) last_label_ruid = reload_combine_ruid; - else if (BARRIER_P (insn)) + else if (BARRIER_P (insn) + || (INSN_P (insn) && volatile_insn_p (PATTERN (insn)))) for (r = 0; r < FIRST_PSEUDO_REGISTER; r++) if (! fixed_regs[r]) reg_state[r].use_index = RELOAD_COMBINE_MAX_USES;