This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch for broken thunk on sparc
- From: Alexey Starovoytov <alexey dot starovoytov at sun dot com>
- To: Eric Botcazou <ebotcazou at libertysurf dot fr>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 8 Apr 2006 00:33:55 -0700 (PDT)
- Subject: Re: patch for broken thunk on sparc
On Sat, 8 Apr 2006, Eric Botcazou wrote:
> > With STACK_POINTER_OFFSET you'll write to REG_PARM_STACK_SPACE that can
> > be used to store parameters.
> > In other words for -m32 STACK_POINTER_OFFSET = 68, so you'll be storing
> > to [sp+68] and theoretical callee of such function can use the same space
> > to store %i0 there with [fp+68].
>
> STACK_POINTER_OFFSET would of course be used in conjunction with the dummy
> frame, for which there is essentially no callee (the PIC helper doesn't count
> here), the dummy frame being necessary in my opinion because otherwise you'll
> clobber the previous frame. The thunk currently has no frame at all.
If you add a frame you'd need to do a tail call at the end of the thunk.
Not the best way for -O0 code.
Also you can't use FIRST_PARM_OFFSET(0) + 2*UNITS_PER_WORD as the size of
the frame.
Per ABI it has to be at least FIRST_PARM_OFFSET + REG_PARM_STACK_SPACE.
imho the only problem with proposed patch is that it assumes a valid frame
of the caller of the thunk, but I guess it's a valid assumption.
Could you illustrate your assertion of 'clobber the previous frame' in
the current patch?
Alex.