From 74a3d2c3aae2f04b2630898a1d41d3922ded71ce Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Tue, 31 Aug 2010 14:22:47 +0000 Subject: [PATCH] v850-protos.h (function_arg): Delete. * config/v850/v850-protos.h (function_arg): Delete. * config/v850/v850.h (FUNCTION_ARG): Delete. (FUNCTION_ARG_ADVANCE): Move code to... * config/v850/v850.c (v850_function_arg_advance): ...here. (v850_function_arg): Make static. Take a const_tree and a bool. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. From-SVN: r163674 --- gcc/ChangeLog | 9 +++++++++ gcc/config/v850/v850-protos.h | 5 +---- gcc/config/v850/v850.c | 34 +++++++++++++++++++++++++++++----- gcc/config/v850/v850.h | 28 ---------------------------- 4 files changed, 39 insertions(+), 37 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c61a41794dd..4f92137d31f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-08-31 Nathan Froyd + + * config/v850/v850-protos.h (function_arg): Delete. + * config/v850/v850.h (FUNCTION_ARG): Delete. + (FUNCTION_ARG_ADVANCE): Move code to... + * config/v850/v850.c (v850_function_arg_advance): ...here. + (v850_function_arg): Make static. Take a const_tree and a bool. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + 2010-08-31 Nathan Froyd * config/m32r/m32r.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Move diff --git a/gcc/config/v850/v850-protos.h b/gcc/config/v850/v850-protos.h index 3fe08797da7..7d26e051a0c 100644 --- a/gcc/config/v850/v850-protos.h +++ b/gcc/config/v850/v850-protos.h @@ -48,11 +48,8 @@ extern int v850_float_nz_comparison_operator (rtx, Mmode); extern rtx v850_gen_compare (enum rtx_code, Mmode, rtx, rtx); extern Mmode v850_gen_float_compare (enum rtx_code, Mmode, rtx, rtx); extern Mmode v850_select_cc_mode (RTX_CODE, rtx, rtx); -#ifdef TREE_CODE -extern rtx function_arg (CUMULATIVE_ARGS *, Mmode, tree, int); #endif -#endif -#endif /* TREE_CODE */ +#endif /* RTX_CODE */ #ifdef TREE_CODE extern int v850_interrupt_function_p (tree); diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index 0879726a026..8f8cd14cdd1 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -75,6 +75,10 @@ static bool v850_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, static int v850_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); static bool v850_strict_argument_naming (CUMULATIVE_ARGS *); +static rtx v850_function_arg (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); +static void v850_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); static bool v850_can_eliminate (const int, const int); static void v850_asm_trampoline_template (FILE *); static void v850_trampoline_init (rtx, tree, rtx); @@ -197,6 +201,12 @@ static const struct attribute_spec v850_attribute_table[] = #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES v850_arg_partial_bytes +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG v850_function_arg + +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE v850_function_arg_advance + #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE v850_can_eliminate @@ -299,11 +309,9 @@ v850_strict_argument_naming (CUMULATIVE_ARGS * ca ATTRIBUTE_UNUSED) and type TYPE will be passed to a function. If the result is NULL_RTX, the argument will be pushed. */ -rtx -function_arg (CUMULATIVE_ARGS * cum, - enum machine_mode mode, - tree type, - int named) +static rtx +v850_function_arg (CUMULATIVE_ARGS * cum, enum machine_mode mode, + const_tree type, bool named) { rtx result = NULL_RTX; int size, align; @@ -399,6 +407,22 @@ v850_arg_partial_bytes (CUMULATIVE_ARGS * cum, enum machine_mode mode, return 4 * UNITS_PER_WORD - cum->nbytes; } +/* Update the data in CUM to advance over an argument + of mode MODE and data type TYPE. + (TYPE is null for libcalls where that information may not be available.) */ + +static void +v850_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named ATTRIBUTE_UNUSED) +{ + cum->nbytes += (((type && int_size_in_bytes (type) > 8 + ? GET_MODE_SIZE (Pmode) + : (mode != BLKmode + ? GET_MODE_SIZE (mode) + : int_size_in_bytes (type))) + UNITS_PER_WORD - 1) + & -UNITS_PER_WORD); +} + /* Return the high and low words of a CONST_DOUBLE */ static void diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index 1a3905fc28c..1fb87f3d269 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -608,22 +608,6 @@ enum reg_class #define CUMULATIVE_ARGS struct cum_arg struct cum_arg { int nbytes; int anonymous_args; }; -/* Define where to put the arguments to a function. - Value is zero to push the argument on the stack, - or a hard register in which to store the argument. - - MODE is the argument's machine mode. - TYPE is the data type of the argument (as a tree). - This is null for libcalls where that information may - not be available. - CUM is a variable of type CUMULATIVE_ARGS which gives info about - the preceding args and about the function being called. - NAMED is nonzero if this argument is a named parameter - (otherwise it is an extra parameter matching an ellipsis). */ - -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - function_arg (&CUM, MODE, TYPE, NAMED) - /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */ @@ -631,18 +615,6 @@ struct cum_arg { int nbytes; int anonymous_args; }; #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ ((CUM).nbytes = 0, (CUM).anonymous_args = 0) -/* Update the data in CUM to advance over an argument - of mode MODE and data type TYPE. - (TYPE is null for libcalls where that information may not be available.) */ -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - ((CUM).nbytes += \ - ((((TYPE) && int_size_in_bytes (TYPE) > 8) \ - ? GET_MODE_SIZE (Pmode) \ - : ((MODE) != BLKmode \ - ? GET_MODE_SIZE ((MODE)) \ - : int_size_in_bytes ((TYPE)))) \ - + UNITS_PER_WORD - 1) & -UNITS_PER_WORD) - /* When a parameter is passed in a register, stack space is still allocated for it. */ #define REG_PARM_STACK_SPACE(DECL) 0