This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Fix 20000724-1.c
On Mon, Apr 30, 2001 at 11:17:30AM -0700, Mark Mitchell wrote:
> Richard> No, as it would be legal to just read the memory rather
> Richard> than modify it.
>
> Sorry, I don't understand. Can you expand on this?
Suppose that the asm doesn't clobber memory. Suppose that it reads it
and copies it into magic device registers or something else the compiler
doesn't know or care about.
In which case there would be no need for the "memory" clobber.
> And why not a non-volatile asm? A non-volatile asm that has a memory
> clobber could have the exact same effect; it's just that the compiler
> is given more freedom to eliminate/move the asm.
I don't like keying off "asm" either -- I did say worse come to worse.
As for rationale, a volatile asm is already treated specially in that
it is a scheduling barrier. If a non-volatile asm was used in the
original test case, it's likely to fail *even without* the stack pointer
combination -- the epilogue instruction to deallocate the stack frame
could just as easily be scheduled in front of the asm, because there
is no knowledge of the dependancy.
r~