This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: nested functions on Arm
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: nested functions on Arm
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Sat, 16 Sep 2000 14:22:01 +0100
- Cc: Michael Meissner <meissner at cygnus dot com>, Ulrich Drepper <drepper at cygnus dot com>, gcc-bugs at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
> On Wed, Sep 13, 2000 at 03:20:44PM -0400, Michael Meissner wrote:
> > Either that or you can probably add a new macro that passes the static chain
> > register as the first argument (much like we can do for structure returns).
>
> This is almost certainly the correct option.
>
>
> r~
Except there is no way for a trampoline to convert a normal call into a
static-chain based call (the trampoline would have to push one of the
registers onto the stack and the caller would then have to know to pop it
afterwards -- it doesn't, so the stack will become corrupt).
It's a similar problem with using a call-saved register for the static
chain -- it works ok (well, it should work ok) when the function is called
directly, but there is no way that a trampoline can save the register it
is about to corrupt.
R.