This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Fix 20000724-1.c
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: PATCH: Fix 20000724-1.c
- From: Richard Henderson <rth at redhat dot com>
- Date: Mon, 30 Apr 2001 09:49:28 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20010430075941M.mitchell@codesourcery.com>
On Mon, Apr 30, 2001 at 07:59:41AM -0700, Mark Mitchell wrote:
> In looking at it carefully, I think the extended asm is bogus. In
> particular, we have:
>
> ! asm volatile("call ___checkme" : : "c" (x) : "memory");
>
> where `__checkme' is a function which fiddles around with the stack.
> The asm doesn't clobber the stack pointer, which is wrong; GCC has no
> way to know that this instruction messes with that register.
This analysis is incorrect, as far as I can tell. The asm
does not need to describe the change in the stack pointer
because it should have the same value before and after.
Yes, the call pushes a return address, but the ret in checkme
removes it.
The actual flaw is that we've lost track of the fact that
there is an outstanding reference to a stack address in a
register, and we decide that we can deallocate the stack
frame before that reference is used.
r~