From 8b4bd662e0e3c266e4ee8a56e88e24b502e39fa9 Mon Sep 17 00:00:00 2001 From: froydnj Date: Sat, 9 Oct 2010 14:21:10 +0000 Subject: [PATCH] * config/pa/pa-protos.h (function_arg): Delete. * config/pa/pa.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/pa/pa.c (function_arg): Rename to... (pa_function_arg): ...this. Make static. Take a const_tree and a bool. (pa_function_arg_advance): New function. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165228 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/pa/pa-protos.h | 4 ---- gcc/config/pa/pa.c | 31 ++++++++++++++++++++++++++++--- gcc/config/pa/pa.h | 17 ----------------- 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f0b5968f79d..9c2e1cac1d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,15 @@ 2010-10-09 Nathan Froyd + * config/pa/pa-protos.h (function_arg): Delete. + * config/pa/pa.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. + * config/pa/pa.c (function_arg): Rename to... + (pa_function_arg): ...this. Make static. Take a const_tree and + a bool. + (pa_function_arg_advance): New function. + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + +2010-10-09 Nathan Froyd + * config/m68k/m68k.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/m68k/m68k.c (m68k_function_arg): New function. (m68k_function_arg_advance): New function. diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index 8097c58cdbb..085b6489cb7 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -151,10 +151,6 @@ extern int cmpib_comparison_operator (rtx, enum machine_mode); /* Miscellaneous functions in pa.c. */ #ifdef TREE_CODE extern int reloc_needed (tree); -#ifdef RTX_CODE -extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, - tree, int); -#endif extern bool pa_return_in_memory (const_tree, const_tree); #endif /* TREE_CODE */ diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index e114dd1fc14..08d63e51255 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -160,6 +160,10 @@ static bool pa_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static int pa_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); +static void pa_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); +static rtx pa_function_arg (CUMULATIVE_ARGS *, enum machine_mode, + const_tree, bool); static struct machine_function * pa_init_machine_status (void); static reg_class_t pa_secondary_reload (bool, rtx, reg_class_t, enum machine_mode, @@ -334,6 +338,10 @@ static size_t n_deferred_plabels = 0; #define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES pa_arg_partial_bytes +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG pa_function_arg +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE pa_function_arg_advance #undef TARGET_EXPAND_BUILTIN_SAVEREGS #define TARGET_EXPAND_BUILTIN_SAVEREGS hppa_builtin_saveregs @@ -9365,6 +9373,23 @@ pa_function_value_regno_p (const unsigned int regno) return false; } +/* 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 +pa_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named ATTRIBUTE_UNUSED) +{ + int arg_size = FUNCTION_ARG_SIZE (mode, type); + + cum->nargs_prototype--; + cum->words += (arg_size + + ((cum->words & 01) + && type != NULL_TREE + && arg_size > 1)); +} + /* Return the location of a parameter that is passed in a register or NULL if the parameter has any component that is passed in memory. @@ -9373,9 +9398,9 @@ pa_function_value_regno_p (const unsigned int regno) ??? We might want to restructure this so that it looks more like other ports. */ -rtx -function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, - int named ATTRIBUTE_UNUSED) +static rtx +pa_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named ATTRIBUTE_UNUSED) { int max_arg_words = (TARGET_64BIT ? 8 : 4); int alignment = 0; diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index ae768b2ed97..e637e684ecc 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -634,17 +634,6 @@ struct hppa_args {int words, nargs_prototype, incoming, indirect; }; ? (HOST_WIDE_INT) GET_MODE_SIZE (MODE) \ : int_size_in_bytes (TYPE)) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) -/* 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).nargs_prototype--; \ - (CUM).words += FUNCTION_ARG_SIZE(MODE, TYPE) \ - + (((CUM).words & 01) && (TYPE) != 0 \ - && FUNCTION_ARG_SIZE(MODE, TYPE) > 1); \ -} - /* Determine where to put an argument to a function. Value is zero to push the argument on the stack, or a hard register in which to store the argument. @@ -707,12 +696,6 @@ struct hppa_args {int words, nargs_prototype, incoming, indirect; }; #define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ function_arg_padding ((MODE), (TYPE)) -/* Do not expect to understand this without reading it several times. I'm - tempted to try and simply it, but I worry about breaking something. */ - -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - function_arg (&CUM, MODE, TYPE, NAMED) - /* If defined, a C expression that gives the alignment boundary, in bits, of an argument with the specified mode and type. If it is not defined, `PARM_BOUNDARY' is used for all arguments. */ -- 2.11.0