PATCH: Fix 20000724-1.c

Mark Mitchell mark@codesourcery.com
Mon Apr 30 14:03:00 GMT 2001


>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:

    Jakub> But the pushes there are just to simulate real-world
    Jakub> situation where the current task sleeps in between the
    Jakub> stack adjustement and the end of the asm volatile. If the
    Jakub> task sleeps inside of the kernel, then everything below
    Jakub> current %esp can be clobered, likewise if a task sleeps and
    Jakub> during the sleep a signal is sent to it (and is not using
    Jakub> alternate stack).  So the asm does not have to use "memory"
    Jakub> clobber to get area below stack pointer clobbered.

Right; that comes from the bit in the manual I didn't find until my
last message that says a volatile asm can do anything it wants
*without* describing what it's doing.

It's clear to me, then, that we can't combine stack adjustments across
one of these.  A volatile asm could, for example, fiddle with the
stack pointer without explicitly clobberring it; that would be legal
by the semantics in the manual.

Once someone confirms that, then I know how to fix the bug.

Note that Jan's patch (as you described it) is incorrect in light of
that sentence in the documentation.  The whole world gets completely
clobberred at a volatile asm.  If we assume anything else, we've
broken our documented contract with the user.

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com



More information about the Gcc-patches mailing list