This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH PING] varargs debug info
- From: Paul Brook <paul at codesourcery dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 21 Dec 2009 13:57:47 +0000
- Subject: Re: [PATCH PING] varargs debug info
- References: <200907091300.38573.paul@codesourcery.com> <200912071653.53875.paul@codesourcery.com> <4B22D5EB.7090503@redhat.com>
On Friday 11 December 2009, Jason Merrill wrote:
> On 12/07/2009 11:53 AM, Paul Brook wrote:
> > * defaults.h (ARG_POINTER_CFA_OFFSET): Add pretend_args_size.
>
> Shouldn't this go in FIRST_PARM_OFFSET rather than
> ARG_POINTER_CFA_OFFSET? The CFA and the first incoming parameter are
> still in the same place even if the prologue is pushing pretend outgoing
> args.
We're talking about pretend incoming arguments, I'll assume that was a typo.
F_P_O defines the location of the "first argument". This is determined by the
code generated in the body of the caller, not the external ABI. i.e. it must
include the pretend args. The default "#define A_P_C_O F_P_O" effectively
points the CFA at the first argument, independent of the choice of argument
pointer.
On ARM the arg pointer is a virtual register, so I could choose to bias the
arg pointer by the size of the pretend arguments. i.e.
#define FIRST_PARAM_OFFSET foo + pretend_args_size
#define ARG_POINTER_CFA_OFFSET foo
However I don't think this makes any more sense, and may actually harm code
quality as it gives a greater offsets between virtual arg and hard frame/stack
pointers, increasing the risk reload having to fixup out of range addressing
modes.
Paul