From: Jim Wilson Date: Wed, 16 Feb 1994 20:42:34 +0000 (-0800) Subject: (alpha_builtin_saveregs): Don't include current_function_arg_offset_rtx in argsize. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29587b1c562162ec7f706aadb9805d05089e1987;p=gcc.git (alpha_builtin_saveregs): Don't include current_function_arg_offset_rtx in argsize. (alpha_builtin_saveregs): Don't include current_function_arg_offset_rtx in argsize. Subtract 48 from arg base address when no int registers stored on the stack. From-SVN: r6576 --- diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 923c5f41c49..00ca472da6b 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -1056,10 +1056,23 @@ alpha_builtin_saveregs (arglist) != void_type_node)); /* Compute the current position into the args, taking into account - both registers and memory. */ + both registers and memory. Both of these are already included in + current_function_args_info. */ - argsize = plus_constant (current_function_arg_offset_rtx, - current_function_args_info * UNITS_PER_WORD); + argsize = GEN_INT (current_function_args_info * UNITS_PER_WORD); + + /* SETUP_INCOMING_VARARGS moves the starting address base up by 48, + storing fp arg registers in the first 48 bytes, and the integer arg + registers in the next 48 bytes. This is only done, however, if any + integer registers need to be stored. + + If no integer registers need be stored, then we must subtract 48 in + order to account for the integer arg registers which are counted in + argsize above, but which are not actually stored on the stack. */ + + addr = (current_function_args_info < 6 + ? plus_constant (virtual_incoming_args_rtx, 6 * UNITS_PER_WORD) + : plus_constant (virtual_incoming_args_rtx, - (6 * UNITS_PER_WORD))); /* Allocate the va_list constructor */ block = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD); @@ -1067,12 +1080,9 @@ alpha_builtin_saveregs (arglist) RTX_UNCHANGING_P (XEXP (block, 0)) = 1; /* Store the address of the first integer register in the - __va_base member. */ - - emit_move_insn (change_address (block, DImode, XEXP (block, 0)), - force_operand (plus_constant (virtual_incoming_args_rtx, - 6 * UNITS_PER_WORD), - NULL_RTX)); + __va_base member. */ + emit_move_insn (change_address (block, Pmode, XEXP (block, 0)), + force_operand (addr, NULL_RTX)); /* Store the argsize as the __va_offset member. */ emit_move_insn (change_address (block, Pmode,