]> gcc.gnu.org Git - gcc.git/commitdiff
builtins.c (expand_builtin_apply_args_1): Add pretend args size to the virtual incomi...
authorNathan Sidwell <nathan@codesourcery.com>
Mon, 29 Dec 2003 18:47:20 +0000 (18:47 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 29 Dec 2003 18:47:20 +0000 (18:47 +0000)
* builtins.c (expand_builtin_apply_args_1): Add pretend args size
to the virtual incoming args pointer for downward stacks.

From-SVN: r75207

gcc/ChangeLog
gcc/builtins.c

index 486b98145a8c28e89d800e3761ccaebcf2b2b6cf..9541d659244775d3273cfa46e88df38f2f96f044 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        PR fortran/12632
index d3dfb8824d75f38aa4d254abb63ce4b823485ddb..c9449fa5ca6ab3a69ba0b248671014ef35dc0f8a 100644 (file)
@@ -1096,7 +1096,7 @@ result_vector (int savep, rtx result)
 static rtx
 expand_builtin_apply_args_1 (void)
 {
-  rtx registers;
+  rtx registers, tem;
   int size, align, regno;
   enum machine_mode mode;
   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)
   for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
     if ((mode = apply_args_mode[regno]) != VOIDmode)
       {
-       rtx tem;
-
        align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT;
        if (size % align != 0)
          size = CEIL (size, align) * align;
@@ -1127,8 +1125,14 @@ expand_builtin_apply_args_1 (void)
       }
 
   /* Save the arg pointer to the block.  */
-  emit_move_insn (adjust_address (registers, Pmode, 0),
-                 copy_to_reg (virtual_incoming_args_rtx));
+  tem = 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);
 
   /* Save the structure value address unless this is passed as an
This page took 0.086094 seconds and 5 git commands to generate.