This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix PR53908


Steven Bosscher <stevenb.gcc@gmail.com> writes:
> On Wed, Jul 11, 2012 at 1:24 PM, Bernd Schmidt <bernds@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]