re PR target/13557 (deviation from the psABI for small structures)

PR target/13557
	* config/sparc/sparc.c (function_arg): Reorder the cases.

From-SVN: r76202
This commit is contained in:
Eric Botcazou 2004-01-20 08:38:18 +01:00 committed by Eric Botcazou
parent 54020b29a8
commit 4043d6fb40
2 changed files with 28 additions and 23 deletions

View File

@ -1,3 +1,8 @@
2004-01-20 Eric Botcazou <ebotcazou@libertysurf.fr>
PR target/13557
* config/sparc/sparc.c (function_arg): Reorder the cases.
2004-01-19 Per Bothner <per@bothner.com>
Move cpp_reader's line_maps field to a shared global.

View File

@ -5353,13 +5353,34 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode,
reg = gen_rtx_REG (mode, regno);
return reg;
}
if (type && TREE_CODE (type) == RECORD_TYPE)
{
/* Structures up to 16 bytes in size are passed in arg slots on the
stack and are promoted to registers where possible. */
if (int_size_in_bytes (type) > 16)
abort (); /* shouldn't get here */
return function_arg_record_value (type, mode, slotno, named, regbase);
}
else if (type && TREE_CODE (type) == UNION_TYPE)
{
enum machine_mode mode;
int bytes = int_size_in_bytes (type);
if (bytes > 16)
abort ();
mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 0);
reg = gen_rtx_REG (mode, regno);
}
/* v9 fp args in reg slots beyond the int reg slots get passed in regs
but also have the slot allocated for them.
If no prototype is in scope fp values in register slots get passed
in two places, either fp regs and int regs or fp regs and memory. */
if ((GET_MODE_CLASS (mode) == MODE_FLOAT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
else if ((GET_MODE_CLASS (mode) == MODE_FLOAT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
&& SPARC_FP_REG_P (regno))
{
reg = gen_rtx_REG (mode, regno);
@ -5423,27 +5444,6 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode,
}
}
}
else if (type && TREE_CODE (type) == RECORD_TYPE)
{
/* Structures up to 16 bytes in size are passed in arg slots on the
stack and are promoted to registers where possible. */
if (int_size_in_bytes (type) > 16)
abort (); /* shouldn't get here */
return function_arg_record_value (type, mode, slotno, named, regbase);
}
else if (type && TREE_CODE (type) == UNION_TYPE)
{
enum machine_mode mode;
int bytes = int_size_in_bytes (type);
if (bytes > 16)
abort ();
mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 0);
reg = gen_rtx_REG (mode, regno);
}
else
{
/* Scalar or complex int. */