Commit 88e541e1 by Nathan Sidwell Committed by Nathan Sidwell

builtins.c (expand_builtin_apply_args_1): Add pretend args size to the virtual…

builtins.c (expand_builtin_apply_args_1): Add pretend args size to the virtual incoming args pointer for downward stacks.

	* builtins.c (expand_builtin_apply_args_1): Add pretend args size
	to the virtual incoming args pointer for downward stacks.

From-SVN: r75207
parent 30a03508
2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.
2003-12-29 Roger Sayle <roger@eyesopen.com> 2003-12-29 Roger Sayle <roger@eyesopen.com>
PR fortran/12632 PR fortran/12632
......
...@@ -1096,7 +1096,7 @@ result_vector (int savep, rtx result) ...@@ -1096,7 +1096,7 @@ result_vector (int savep, rtx result)
static rtx static rtx
expand_builtin_apply_args_1 (void) expand_builtin_apply_args_1 (void)
{ {
rtx registers; rtx registers, tem;
int size, align, regno; int size, align, regno;
enum machine_mode mode; enum machine_mode mode;
rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1); rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1);
...@@ -1114,8 +1114,6 @@ expand_builtin_apply_args_1 (void) ...@@ -1114,8 +1114,6 @@ expand_builtin_apply_args_1 (void)
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if ((mode = apply_args_mode[regno]) != VOIDmode) if ((mode = apply_args_mode[regno]) != VOIDmode)
{ {
rtx tem;
align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT; align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT;
if (size % align != 0) if (size % align != 0)
size = CEIL (size, align) * align; size = CEIL (size, align) * align;
...@@ -1127,8 +1125,14 @@ expand_builtin_apply_args_1 (void) ...@@ -1127,8 +1125,14 @@ expand_builtin_apply_args_1 (void)
} }
/* Save the arg pointer to the block. */ /* Save the arg pointer to the block. */
emit_move_insn (adjust_address (registers, Pmode, 0), tem = copy_to_reg (virtual_incoming_args_rtx);
copy_to_reg (virtual_incoming_args_rtx)); #ifdef STACK_GROWS_DOWNWARDS
/* We need the pointer as the caller actually passed them to us, not
as we might have pretended they were passed. */
tem = plus_constant (tem, current_function_pretend_args_size);
#endif
emit_move_insn (adjust_address (registers, Pmode, 0), tem);
size = GET_MODE_SIZE (Pmode); size = GET_MODE_SIZE (Pmode);
/* Save the structure value address unless this is passed as an /* Save the structure value address unless this is passed as an
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment