{
/* Not EABI. */
int align;
+ HOST_WIDE_INT min_offset;
/* ??? The original va-mips.h did always align, despite the fact
that alignments <= UNITS_PER_WORD are preserved by the va_arg
t = build (PLUS_EXPR, TREE_TYPE (valist), valist,
build_int_2 (align - 1, 0));
t = build (BIT_AND_EXPR, TREE_TYPE (t), t, build_int_2 (-align, -1));
+
+ /* If arguments of type TYPE must be passed on the stack,
+ set MIN_OFFSET to the offset of the first stack parameter. */
+ if (!MUST_PASS_IN_STACK (TYPE_MODE (type), type))
+ min_offset = 0;
+ else if (TARGET_NEWABI)
+ min_offset = current_function_pretend_args_size;
+ else
+ min_offset = REG_PARM_STACK_SPACE (current_function_decl);
+
+ /* Make sure the new address is at least MIN_OFFSET bytes from
+ the incoming argument pointer. */
+ if (min_offset > 0)
+ t = build (MAX_EXPR, TREE_TYPE (valist), t,
+ make_tree (TREE_TYPE (valist),
+ plus_constant (virtual_incoming_args_rtx,
+ min_offset)));
+
t = build (MODIFY_EXPR, TREE_TYPE (valist), valist, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);