This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH PING] varargs debug info


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]