On 8/14/19 1:08 AM, Segher Boessenkool wrote: > On Tue, Aug 13, 2019 at 10:32:27PM -0500, William Tambe wrote: >> On Tue, Aug 13, 2019 at 9:44 PM Jeff Law <law@xxxxxxxxxx> wrote: >>> >>> On 8/13/19 7:41 PM, William Tambe wrote: >>>> Are pretend arguments included in the outgoing argument region ? >>>> In other words, when ACCUMULATE_OUTGOING_ARGS is nonzero, does >>>> crtl->outgoing_args_size include crtl->args.pretend_args_size ? >>>> >>> I think it varies depending on the target's ABI. >>> OUTGOING_REG_PARM_STACK_SPACE, STACK_PARMS_IN_REG_PARM_AREA, >>> REG_PARM_STACK_SPACE, etc likely come into play here. >>> >>> It may be better for you to describe the ABI you're working with. >>> There's a reasonable chance it'll line up with an existing port's ABI >>> and you can crib from that existing port. Make sure to describe how >>> varargs/stdarg is supposed to work, whether or not you have arguments >>> passed partially in registers and partially in memory, >> >> The ABI I am working with pass arguments through registers where >> NUM_ARG_REGS is the number of registers used to pass arguments. >> >> Given the following #define, is it enough to assume that pretend >> arguments will be included in the outgoing argument region and that >> crtl->outgoing_args_size will include crtl->args.pretend_args_size ? >> >> #define ACCUMULATE_OUTGOING_ARGS 1 >> #define REG_PARM_STACK_SPACE(F) (NUM_ARG_REGS*UNITS_PER_WORD) >> #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1 >> #define STACK_PARMS_IN_REG_PARM_AREA > > Given your description, should you define any of the REG_PARM macros > at all? *Is* there an "outgoing argument region" in your ABI, if all > args are passed in registers? Right. And how does stdarg/varargs work? In particular what does the callee do with register parameters if the callee is a varargs/stdarg function? Some will pull parameters from registers, others flush the registers back to the stack in a args flushback area). It's important. jeff