diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2004-01-26 15:54:45 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2004-01-26 15:54:45 +0000 |
commit | 558d352a12750bdd8230b8bb4bf7775f977433dd (patch) | |
tree | 7db523f24743a8c78ff1588d12b4360f30627046 | |
parent | 044701ce86d2eb1028ca5466ab10ac88638a8804 (diff) | |
download | gcc-558d352a12750bdd8230b8bb4bf7775f977433dd.zip gcc-558d352a12750bdd8230b8bb4bf7775f977433dd.tar.gz gcc-558d352a12750bdd8230b8bb4bf7775f977433dd.tar.bz2 |
cris.c (TARGET_SETUP_INCOMING_VARARGS): New.
* config/cris/cris.c (TARGET_SETUP_INCOMING_VARARGS): New.
(cris_setup_incoming_varargs): Likewise.
* config/cris/cris.h (SETUP_INCOMING_VARARGS): Remove.
From-SVN: r76640
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/cris/cris.c | 25 | ||||
-rw-r--r-- | gcc/config/cris/cris.h | 22 |
3 files changed, 31 insertions, 22 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 753aaee..7dbfb88 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 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. + +2004-01-26 Kazu Hirata <kazu@cs.umass.edu> + * config/ns32k/ns32k.c (TARGET_STRUCT_VALUE_RTX): New. (ns32k_struct_value_rtx): Likewise. * config/ns32k/ns32k.h (STRUCT_VALUE_REGNUM): Rename to diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 77d421d..1d5f168 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -94,6 +94,9 @@ static struct machine_function * cris_init_machine_status (void); static rtx cris_struct_value_rtx (tree, int); +static void cris_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, + tree type, int *, int); + static int cris_initial_frame_pointer_offset (void); static int saved_regs_mentioned (rtx); @@ -184,6 +187,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION; #undef TARGET_STRUCT_VALUE_RTX #define TARGET_STRUCT_VALUE_RTX cris_struct_value_rtx +#undef TARGET_SETUP_INCOMING_VARARGS +#define TARGET_SETUP_INCOMING_VARARGS cris_setup_incoming_varargs + struct gcc_target targetm = TARGET_INITIALIZER; /* Predicate functions. */ @@ -3194,6 +3200,25 @@ cris_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED, return gen_rtx_REG (Pmode, CRIS_STRUCT_VALUE_REGNUM); } +/* Worker function for TARGET_SETUP_INCOMING_VARARGS. */ + +static void +cris_setup_incoming_varargs (CUMULATIVE_ARGS *ca, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED, + int *pretend_arg_size, + int second_time) +{ + if (ca->regs < CRIS_MAX_ARGS_IN_REGS) + *pretend_arg_size = (CRIS_MAX_ARGS_IN_REGS - ca->regs) * 4; + if (TARGET_PDEBUG) + { + fprintf (asm_out_file, + "\n; VA:: ANSI: %d args before, anon @ #%d, %dtime\n", + ca->regs, *pretend_arg_size, second_time); + } +} + #if 0 /* Various small functions to replace macros. Only called from a debugger. They might collide with gcc functions or system functions, diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index be529a9..34fb6f9 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -1022,28 +1022,6 @@ struct cum_args {int regs;}; /* Node: Varargs */ -/* We save the register number of the first anonymous argument in - first_vararg_reg, and take care of this in the function prologue. - This behavior is used by at least one more port (the ARM?), but - may be unsafe when compiling nested functions. (With varargs? Hairy.) - Note that nested-functions is a GNU C extension. - - FIXME: We can actually put the size in PRETEND and deduce the number - of registers from it in the prologue and epilogue. */ -#define SETUP_INCOMING_VARARGS(ARGSSF, MODE, TYPE, PRETEND, SECOND) \ - do \ - { \ - if ((ARGSSF).regs < (CRIS_MAX_ARGS_IN_REGS)) \ - (PRETEND) = ((CRIS_MAX_ARGS_IN_REGS) - (ARGSSF).regs) * 4; \ - if (TARGET_PDEBUG) \ - { \ - fprintf (asm_out_file, \ - "\n; VA:: ANSI: %d args before, anon @ #%d, %dtime\n", \ - (ARGSSF).regs, PRETEND, SECOND); \ - } \ - } \ - while (0) - /* FIXME: This and other EXPAND_BUILTIN_VA_... target macros are not documented, although used by several targets. */ #define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \ |