Steven Bosscher <stevenb....@gmail.com> writes: > On Wed, Jul 11, 2012 at 1:24 PM, Bernd Schmidt <ber...@codesourcery.com> > wrote>> We're moving a load across a call since we don't recognize calls as >> memory-clobbering. >> >> Bootstrapping and testing now on 4.7 x86_64-linux, ok everywhere? > > Maybe: > + if (CALL_P (insn) > + && ! RTL_CONST_OR_PURE_CALL_P (insn))
AIUI pure functions can read memory, and const functions can read arguments that the ABI says must be passed on the stack. So it sounds like it should be something like: if (CALL_P (insn)) { if (RTL_CONST_OR_PURE_CALL_P (insn)) /* Pure functions can read from memory. Const functions can read from arguments that the ABI has forced onto the stack. Neither sort of read can be volatile. */ memrefs_in_across |= MEMREF_NORMAL; else { memrefs_in_across |= MEMREF_VOLATILE; mem_sets_in_across |= MEMREF_VOLATILE; } } OK with that change if you agree. Richard