From 1cc9f5f5f9bee93d16022839b10454929034585d Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 26 Jan 2004 16:35:44 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm.c | 24 ++++++++++++++++++++++++ gcc/config/arm/arm.h | 26 +++----------------------- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7dbfb88854f4..a678fecd89b8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-01-26 Kazu Hirata + + * 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 * config/cris/cris.c (TARGET_SETUP_INCOMING_VARARGS): New. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 692432b3bdf7..768678d1b51b 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 d169f180f817..df71f64248cf 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. */