/* Number of registers to use. 0 means put the whole arg in registers.
Also 0 if not passed in registers. */
int partial;
- /* Non-zero if argument must be passed on stack.
+ /* Nonzero if argument must be passed on stack.
Note that some arguments may be passed on the stack
even though pass_on_stack is zero, just because FUNCTION_ARG says so.
pass_on_stack identifies arguments that *cannot* go in registers. */
struct args_size alignment_pad;
};
-/* A vector of one char per byte of stack space. A byte if non-zero if
+/* A vector of one char per byte of stack space. A byte if nonzero if
the corresponding stack location has been used.
This vector is used to prevent a function call within an argument from
clobbering any stack already set up. */
/* Scan X expression if it does not dereference any argument slots
we already clobbered by tail call arguments (as noted in stored_args_map
bitmap).
- Return non-zero if X expression dereferences such argument slots,
+ Return nonzero if X expression dereferences such argument slots,
zero otherwise. */
static int
/* Scan sequence after INSN if it does not dereference any argument slots
we already clobbered by tail call arguments (as noted in stored_args_map
bitmap). Add stack slots for ARG to stored_args_map bitmap afterwards.
- Return non-zero if sequence after INSN dereferences such argument slots,
+ Return nonzero if sequence after INSN dereferences such argument slots,
zero otherwise. */
static int
emit_move_insn (value, mem_value);
}
else if (value != 0)
- emit_move_insn (value, hard_libcall_value (outmode));
+ emit_move_insn (value, valreg);
else
- value = hard_libcall_value (outmode);
+ value = valreg;
}
if (ACCUMULATE_OUTGOING_ARGS)
FNDECL is the declaration of the function we are calling.
- Return non-zero if this arg should cause sibcall failure,
+ Return nonzero if this arg should cause sibcall failure,
zero otherwise. */
static int
{
/* BLKmode, at least partly to be pushed. */
+ unsigned int parm_align;
int excess;
rtx size_rtx;
NULL_RTX, TYPE_MODE (sizetype), 0);
}
+ /* Some types will require stricter alignment, which will be
+ provided for elsewhere in argument layout. */
+ parm_align = MAX (PARM_BOUNDARY, TYPE_ALIGN (TREE_TYPE (pval)));
+
+ /* When an argument is padded down, the block is aligned to
+ PARM_BOUNDARY, but the actual argument isn't. */
+ if (FUNCTION_ARG_PADDING (arg->mode, TREE_TYPE (pval)) == downward)
+ {
+ if (arg->size.var)
+ parm_align = BITS_PER_UNIT;
+ else if (excess)
+ {
+ int excess_align = (excess & -excess) * BITS_PER_UNIT;
+ parm_align = MIN (parm_align, excess_align);
+ }
+ }
+
if ((flags & ECF_SIBCALL) && GET_CODE (arg->value) == MEM)
{
/* emit_push_insn might not work properly if arg->value and
{
rtx size_rtx1 = GEN_INT (reg_parm_stack_space - arg->offset.constant);
emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx1,
- MAX (PARM_BOUNDARY, TYPE_ALIGN (TREE_TYPE (pval))),
- partial, reg, excess, argblock,
+ parm_align, partial, reg, excess, argblock,
ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space,
ARGS_SIZE_RTX (arg->alignment_pad));
}
emit_push_insn (arg->value, arg->mode, TREE_TYPE (pval), size_rtx,
- MAX (PARM_BOUNDARY, TYPE_ALIGN (TREE_TYPE (pval))),
- partial, reg, excess, argblock,
+ parm_align, partial, reg, excess, argblock,
ARGS_SIZE_RTX (arg->offset), reg_parm_stack_space,
ARGS_SIZE_RTX (arg->alignment_pad));