mirror of git://gcc.gnu.org/git/gcc.git
xtensa.c (xtensa_va_arg): Fix to handle arguments for which MUST_PASS_IN_STACK is true (e.g....
* config/xtensa/xtensa.c (xtensa_va_arg): Fix to handle arguments for which MUST_PASS_IN_STACK is true (e.g., variable-sized types). From-SVN: r51700
This commit is contained in:
parent
ed4168d56f
commit
bcf88f9b91
|
@ -1,3 +1,8 @@
|
||||||
|
2002-04-01 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
|
* config/xtensa/xtensa.c (xtensa_va_arg): Fix to handle arguments
|
||||||
|
for which MUST_PASS_IN_STACK is true (e.g., variable-sized types).
|
||||||
|
|
||||||
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
|
2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
|
||||||
|
|
||||||
* c-common.c (unsigned_conversion_warning, convert_and_check,
|
* c-common.c (unsigned_conversion_warning, convert_and_check,
|
||||||
|
|
|
@ -2496,26 +2496,32 @@ xtensa_va_arg (valist, type)
|
||||||
|
|
||||||
/* Check if the argument is in registers:
|
/* Check if the argument is in registers:
|
||||||
|
|
||||||
if ((AP).__va_ndx <= __MAX_ARGS_IN_REGISTERS * 4)
|
if ((AP).__va_ndx <= __MAX_ARGS_IN_REGISTERS * 4
|
||||||
|
&& !MUST_PASS_IN_STACK (type))
|
||||||
__array = (AP).__va_reg;
|
__array = (AP).__va_reg;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
lab_false = gen_label_rtx ();
|
|
||||||
lab_over = gen_label_rtx ();
|
|
||||||
array = gen_reg_rtx (Pmode);
|
array = gen_reg_rtx (Pmode);
|
||||||
|
|
||||||
emit_cmp_and_jump_insns (expand_expr (ndx, NULL_RTX, SImode, EXPAND_NORMAL),
|
if (!MUST_PASS_IN_STACK (VOIDmode, type))
|
||||||
GEN_INT (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD),
|
{
|
||||||
GT, const1_rtx, SImode, 0, lab_false);
|
lab_false = gen_label_rtx ();
|
||||||
|
lab_over = gen_label_rtx ();
|
||||||
|
|
||||||
r = expand_expr (reg, array, Pmode, EXPAND_NORMAL);
|
emit_cmp_and_jump_insns (expand_expr (ndx, NULL_RTX, SImode,
|
||||||
if (r != array)
|
EXPAND_NORMAL),
|
||||||
emit_move_insn (array, r);
|
GEN_INT (MAX_ARGS_IN_REGISTERS
|
||||||
|
* UNITS_PER_WORD),
|
||||||
|
GT, const1_rtx, SImode, 0, lab_false);
|
||||||
|
|
||||||
emit_jump_insn (gen_jump (lab_over));
|
r = expand_expr (reg, array, Pmode, EXPAND_NORMAL);
|
||||||
emit_barrier ();
|
if (r != array)
|
||||||
emit_label (lab_false);
|
emit_move_insn (array, r);
|
||||||
|
|
||||||
|
emit_jump_insn (gen_jump (lab_over));
|
||||||
|
emit_barrier ();
|
||||||
|
emit_label (lab_false);
|
||||||
|
}
|
||||||
|
|
||||||
/* ...otherwise, the argument is on the stack (never split between
|
/* ...otherwise, the argument is on the stack (never split between
|
||||||
registers and the stack -- change __va_ndx if necessary):
|
registers and the stack -- change __va_ndx if necessary):
|
||||||
|
@ -2545,7 +2551,8 @@ xtensa_va_arg (valist, type)
|
||||||
if (r != array)
|
if (r != array)
|
||||||
emit_move_insn (array, r);
|
emit_move_insn (array, r);
|
||||||
|
|
||||||
emit_label (lab_over);
|
if (!MUST_PASS_IN_STACK (VOIDmode, type))
|
||||||
|
emit_label (lab_over);
|
||||||
|
|
||||||
|
|
||||||
/* Given the base array pointer (__array) and index to the subsequent
|
/* Given the base array pointer (__array) and index to the subsequent
|
||||||
|
|
Loading…
Reference in New Issue