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 12:22:11PM -0700, Mark Mitchell wrote:
> >>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:
>
> >> Sorry, I don't understand. Can you expand on this?
>
> Richard> Suppose that the asm doesn't clobber memory. Suppose
> Richard> that it reads it and copies it into magic device
> Richard> registers or something else the compiler doesn't know or
> Richard> care about.
>
> Richard> In which case there would be no need for the "memory"
> Richard> clobber.
>
> I'm still being dense.
>
> In this test-case, if there was no overwriting of the memory, things
> would work OK.
>
> What I'm trying to say is that if there were no writes to memory, then
> moving the stack pointer around would be harmless; that doesn't change
> memory. It's the pushes that clobber the local variable.
But the pushes there are just to simulate real-world situation where the
current task sleeps in between the stack adjustement and the end of the asm
volatile. If the task sleeps inside of the kernel, then everything below
current %esp can be clobered, likewise if a task sleeps and during the sleep
a signal is sent to it (and is not using alternate stack).
So the asm does not have to use "memory" clobber to get area below stack
pointer clobbered.
Jakub