From: bwilson Date: Mon, 1 Apr 2002 19:52:18 +0000 (+0000) Subject: * config/xtensa/xtensa.c (xtensa_va_arg): Fix to handle arguments X-Git-Tag: upstream/4.9.2~87582 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89d4bc5e939251b80d0d555b57f2700c0b6c20f2;p=platform%2Fupstream%2Flinaro-gcc.git * config/xtensa/xtensa.c (xtensa_va_arg): Fix to handle arguments for which MUST_PASS_IN_STACK is true (e.g., variable-sized types). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51700 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba1c60b..fa98fbb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-04-01 Bob Wilson + + * 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 * c-common.c (unsigned_conversion_warning, convert_and_check, diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 0455737..c6bc959 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -2496,26 +2496,32 @@ xtensa_va_arg (valist, type) /* 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; */ - lab_false = gen_label_rtx (); - lab_over = gen_label_rtx (); array = gen_reg_rtx (Pmode); - emit_cmp_and_jump_insns (expand_expr (ndx, NULL_RTX, SImode, EXPAND_NORMAL), - GEN_INT (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD), - GT, const1_rtx, SImode, 0, lab_false); + if (!MUST_PASS_IN_STACK (VOIDmode, type)) + { + lab_false = gen_label_rtx (); + lab_over = gen_label_rtx (); - r = expand_expr (reg, array, Pmode, EXPAND_NORMAL); - if (r != array) - emit_move_insn (array, r); + emit_cmp_and_jump_insns (expand_expr (ndx, NULL_RTX, SImode, + EXPAND_NORMAL), + GEN_INT (MAX_ARGS_IN_REGISTERS + * UNITS_PER_WORD), + GT, const1_rtx, SImode, 0, lab_false); - emit_jump_insn (gen_jump (lab_over)); - emit_barrier (); - emit_label (lab_false); + r = expand_expr (reg, array, Pmode, EXPAND_NORMAL); + if (r != array) + 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 registers and the stack -- change __va_ndx if necessary): @@ -2545,7 +2551,8 @@ xtensa_va_arg (valist, type) if (r != array) 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