OSDN Git Service

* config/arm/arm.c (TARGET_SETUP_INCOMING_VARARGS): New.
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Jan 2004 16:35:44 +0000 (16:35 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Jan 2004 16:35:44 +0000 (16:35 +0000)
(arm_setup_incoming_varargs): Likewise.
* config/arm/arm.h (SETUP_INCOMING_VARARGS): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76643 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.h

index 7dbfb88..a678fec 100644 (file)
@@ -1,5 +1,11 @@
 2004-01-26  Kazu Hirata  <kazu@cs.umass.edu>
 
+       * config/arm/arm.c (TARGET_SETUP_INCOMING_VARARGS): New.
+       (arm_setup_incoming_varargs): Likewise.
+       * config/arm/arm.h (SETUP_INCOMING_VARARGS): Remove.
+
+2004-01-26  Kazu Hirata  <kazu@cs.umass.edu>
+
        * config/cris/cris.c (TARGET_SETUP_INCOMING_VARARGS): New.
        (cris_setup_incoming_varargs): Likewise.
        * config/cris/cris.h (SETUP_INCOMING_VARARGS): Remove.
index 692432b..768678d 100644 (file)
@@ -151,6 +151,8 @@ static void aof_file_start (void);
 static void aof_file_end (void);
 #endif
 static rtx arm_struct_value_rtx (tree, int);
+static void arm_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
+                                       tree, int *, int);
 
 \f
 /* Initialize the GCC target structure.  */
@@ -242,6 +244,9 @@ static rtx arm_struct_value_rtx (tree, int);
 #undef TARGET_STRUCT_VALUE_RTX
 #define TARGET_STRUCT_VALUE_RTX arm_struct_value_rtx
 
+#undef  TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS arm_setup_incoming_varargs
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 \f
 /* Obstack for minipool constant handling.  */
@@ -13350,3 +13355,22 @@ arm_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
   return gen_rtx_REG (Pmode, ARG_REGISTER (1));
 #endif
 }
+
+/* Worker function for TARGET_SETUP_INCOMING_VARARGS.
+
+   On the ARM, PRETEND_SIZE is set in order to have the prologue push the last
+   named arg and all anonymous args onto the stack.
+   XXX I know the prologue shouldn't be pushing registers, but it is faster
+   that way.  */
+
+static void
+arm_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
+                           enum machine_mode mode ATTRIBUTE_UNUSED,
+                           tree type ATTRIBUTE_UNUSED,
+                           int *pretend_size,
+                           int second_time ATTRIBUTE_UNUSED)
+{
+  cfun->machine->uses_anonymous_args = 1;
+  if (cum->nregs < NUM_ARG_REGS)
+    *pretend_size = (NUM_ARG_REGS - cum->nregs) * UNITS_PER_WORD;
+}
index d169f18..df71f64 100644 (file)
@@ -1703,9 +1703,9 @@ typedef struct
 
    On the ARM, normally the first 16 bytes are passed in registers r0-r3; all
    other arguments are passed on the stack.  If (NAMED == 0) (which happens
-   only in assign_parms, since SETUP_INCOMING_VARARGS is defined), say it is
-   passed in the stack (function_prologue will indeed make it pass in the
-   stack if necessary).  */
+   only in assign_parms, since TARGET_SETUP_INCOMING_VARARGS is
+   defined), say it is passed in the stack (function_prologue will
+   indeed make it pass in the stack if necessary).  */
 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
   arm_function_arg (&(CUM), (MODE), (TYPE), (NAMED))
 
@@ -1764,26 +1764,6 @@ typedef struct
   arm_va_arg (valist, type)
 
 \f
-/* Perform any actions needed for a function that is receiving a variable
-   number of arguments.  CUM is as above.  MODE and TYPE are the mode and type
-   of the current parameter.  PRETEND_SIZE is a variable that should be set to
-   the amount of stack that must be pushed by the prolog to pretend that our
-   caller pushed it.
-
-   Normally, this macro will push all remaining incoming registers on the
-   stack and set PRETEND_SIZE to the length of the registers pushed.
-
-   On the ARM, PRETEND_SIZE is set in order to have the prologue push the last
-   named arg and all anonymous args onto the stack.
-   XXX I know the prologue shouldn't be pushing registers, but it is faster
-   that way.  */
-#define SETUP_INCOMING_VARARGS(CUM, MODE, TYPE, PRETEND_SIZE, NO_RTL)  \
-{                                                                      \
-  cfun->machine->uses_anonymous_args = 1;                              \
-  if ((CUM).nregs < NUM_ARG_REGS)                                      \
-    (PRETEND_SIZE) = (NUM_ARG_REGS - (CUM).nregs) * UNITS_PER_WORD;    \
-}
-
 /* If your target environment doesn't prefix user functions with an
    underscore, you may wish to re-define this to prevent any conflicts.
    e.g. AOF may prefix mcount with an underscore.  */