+2004-11-10 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * config/sparc/sparc.c (function_arg_union_value): New 'slotno'
+ argument. When the union is passed in the 6th slot, build a
+ PARALLEL with only one element.
+ (function_arg): Adjust call to function_arg_union_value.
+ (function_value): Likewise.
+
2004-11-10 Fariborz Jahanian <fjahanian@apple.com>
PR tree-optimization/17892
static void function_arg_record_value_1
(tree, HOST_WIDE_INT, struct function_arg_record_value_parms *, bool);
static rtx function_arg_record_value (tree, enum machine_mode, int, int, int);
-static rtx function_arg_union_value (int, enum machine_mode, int);
+static rtx function_arg_union_value (int, enum machine_mode, int, int);
/* A subroutine of function_arg_record_value. Traverse the structure
recursively and determine how many registers will be required. */
REGNO is the hard register the union will be passed in. */
static rtx
-function_arg_union_value (int size, enum machine_mode mode, int regno)
+function_arg_union_value (int size, enum machine_mode mode, int slotno,
+ int regno)
{
int nwords = ROUND_ADVANCE (size), i;
rtx regs;
if (nwords == 0)
return gen_rtx_REG (mode, regno);
+ if (slotno == SPARC_INT_ARG_MAX - 1)
+ nwords = 1;
+
regs = gen_rtx_PARALLEL (mode, rtvec_alloc (nwords));
for (i = 0; i < nwords; i++)
if (size > 16)
abort (); /* shouldn't get here */
- return function_arg_union_value (size, mode, regno);
+ return function_arg_union_value (size, mode, slotno, regno);
}
else if (type && TREE_CODE (type) == VECTOR_TYPE)
{
if (size > 32)
abort (); /* shouldn't get here */
- return function_arg_union_value (size, mode, regbase);
+ return function_arg_union_value (size, mode, 0, regbase);
}
else if (AGGREGATE_TYPE_P (type))
{
try to be unduly clever, and simply follow the ABI
for unions in that case. */
if (mode == BLKmode)
- return function_arg_union_value (bytes, mode, regbase);
+ return function_arg_union_value (bytes, mode, 0, regbase);
else
mclass = MODE_INT;
}