aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-01-26 16:35:44 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-01-26 16:35:44 +0000
commit1cc9f5f5f9bee93d16022839b10454929034585d (patch)
treea021ec8671c81d141c21190dd32e2ce8ae30b597
parent558d352a12750bdd8230b8bb4bf7775f977433dd (diff)
downloadgcc-1cc9f5f5f9bee93d16022839b10454929034585d.zip
gcc-1cc9f5f5f9bee93d16022839b10454929034585d.tar.gz
gcc-1cc9f5f5f9bee93d16022839b10454929034585d.tar.bz2
arm.c (TARGET_SETUP_INCOMING_VARARGS): New.
* config/arm/arm.c (TARGET_SETUP_INCOMING_VARARGS): New. (arm_setup_incoming_varargs): Likewise. * config/arm/arm.h (SETUP_INCOMING_VARARGS): Remove. From-SVN: r76643
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arm/arm.c24
-rw-r--r--gcc/config/arm/arm.h26
3 files changed, 33 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7dbfb88..a678fec 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 692432b..768678d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -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);
/* 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;
/* 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;
+}
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index d169f18..df71f642 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -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)
-/* 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. */