From 563a317a855153a044b32549429218e121d51ff6 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 19 Feb 2003 19:03:11 +0100 Subject: [PATCH] calls.c (expand_call): Update call of INIT_CUMULATIVE_ARGS * calls.c (expand_call): Update call of INIT_CUMULATIVE_ARGS * function.c (assign_params): Likewise. * arm-protos.h (arm_init_cumulative_args): Update prototype. * arm.c (arm_init_cumulative_args): Update function. * arm.h (INIT_CUMULATIVE_ARGS): Update. * avr-protos.h (init_cumulative_args): Update prototype. * avr.c (init_cumulative_args): Update function. * avr.h (INIT_CUMULATIVE_ARGS): Update. * d30v-protos.h (d30v_init_cumulative_args): Update prototype. * d30v.c (d30v_init_cumulative_args): Update function. * d30v.h (INIT_CUMULATIVE_ARGS): Update. * frv-protos.h (frv_init_cumulative_args): Update prototype. * frv.c (frv_init_cumulative_args): Update function. * frv.h (INIT_CUMULATIVE_ARGS): Update. * mips.c (mips_expand_prolgue): Update call of INIT_CUMULATIVE_ARGS. * pa.h (INIT_CUMULATIVE_ARGS): Update. * sparc-protos.h (init_cumulative_args): Update prototype. * sparc.c (init_cumulative_args): Update function. * sparc.h (INIT_CUMULATIVE_ARGS): Update. * tm.texi (INIT_CUMULATIVE_ARGS): Update documentation. From-SVN: r63126 --- gcc/ChangeLog | 23 +++++++++++++++++++++++ gcc/Makefile.in | 2 +- gcc/calls.c | 2 +- gcc/config/arm/arm-protos.h | 2 +- gcc/config/arm/arm.c | 4 ++-- gcc/config/arm/arm.h | 4 ++-- gcc/config/avr/avr-protos.h | 2 +- gcc/config/avr/avr.c | 4 ++-- gcc/config/avr/avr.h | 2 +- gcc/config/d30v/d30v-protos.h | 2 +- gcc/config/d30v/d30v.c | 4 ++-- gcc/config/d30v/d30v.h | 6 +++--- gcc/config/frv/frv-protos.h | 2 +- gcc/config/frv/frv.c | 6 +++--- gcc/config/frv/frv.h | 6 +++--- gcc/config/mips/mips.c | 2 +- gcc/config/pa/pa.h | 4 ++-- gcc/config/sparc/sparc-protos.h | 2 +- gcc/config/sparc/sparc.c | 4 ++-- gcc/config/sparc/sparc.h | 4 ++-- gcc/doc/tm.texi | 20 +++++++++----------- gcc/function.c | 2 +- 22 files changed, 65 insertions(+), 44 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 93166675faa..9585c69c212 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,26 @@ +Wed Feb 19 19:00:24 CET 2003 Jan Hubicka + + * calls.c (expand_call): Update call of INIT_CUMULATIVE_ARGS + * function.c (assign_params): Likewise. + * arm-protos.h (arm_init_cumulative_args): Update prototype. + * arm.c (arm_init_cumulative_args): Update function. + * arm.h (INIT_CUMULATIVE_ARGS): Update. + * avr-protos.h (init_cumulative_args): Update prototype. + * avr.c (init_cumulative_args): Update function. + * avr.h (INIT_CUMULATIVE_ARGS): Update. + * d30v-protos.h (d30v_init_cumulative_args): Update prototype. + * d30v.c (d30v_init_cumulative_args): Update function. + * d30v.h (INIT_CUMULATIVE_ARGS): Update. + * frv-protos.h (frv_init_cumulative_args): Update prototype. + * frv.c (frv_init_cumulative_args): Update function. + * frv.h (INIT_CUMULATIVE_ARGS): Update. + * mips.c (mips_expand_prolgue): Update call of INIT_CUMULATIVE_ARGS. + * pa.h (INIT_CUMULATIVE_ARGS): Update. + * sparc-protos.h (init_cumulative_args): Update prototype. + * sparc.c (init_cumulative_args): Update function. + * sparc.h (INIT_CUMULATIVE_ARGS): Update. + * tm.texi (INIT_CUMULATIVE_ARGS): Update documentation. + 2003-02-19 Kazu Hirata * config/h8300/h8300.md (*iorsi3_two_qi_sext): New. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 66580f12219..b0920e07e1a 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1674,7 +1674,7 @@ sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ sched-int.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h flags.h insn-config.h function.h \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) + $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(PARAMS_H) profile.h sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ sched-int.h hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \ $(TARGET_H) real.h diff --git a/gcc/calls.c b/gcc/calls.c index 6bec3df19a0..4102c01b878 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2418,7 +2418,7 @@ expand_call (exp, target, ignore) calling convention than normal calls. The last argument in INIT_CUMULATIVE_ARGS tells the backend if this is an indirect call or not. */ - INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, (fndecl == 0)); + INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl); /* Make a vector to hold all the information about each arg. */ args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data)); diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 5ffa0512035..ad4ebffe343 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -149,7 +149,7 @@ extern int arm_is_longcall_p PARAMS ((rtx, int, int)); extern rtx arm_function_arg PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int)); extern void arm_init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, - int)); + tree)); extern rtx arm_va_arg PARAMS ((tree, tree)); extern int arm_function_arg_pass_by_reference PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 0847c97ae9d..5650ffbd086 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -1957,11 +1957,11 @@ arm_float_words_big_endian () for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is NULL. */ void -arm_init_cumulative_args (pcum, fntype, libname, indirect) +arm_init_cumulative_args (pcum, fntype, libname, fndecl) CUMULATIVE_ARGS * pcum; tree fntype; rtx libname ATTRIBUTE_UNUSED; - int indirect ATTRIBUTE_UNUSED; + tree fndecl ATTRIBUTE_UNUSED; { /* On the ARM, the offset starts at 0. */ pcum->nregs = ((fntype && aggregate_value_p (TREE_TYPE (fntype))) ? 1 : 0); diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 3ae323e9e35..3856446bc56 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1572,8 +1572,8 @@ typedef struct for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. On the ARM, the offset starts at 0. */ -#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \ - arm_init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (INDIRECT)) +#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) \ + arm_init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL)) /* Update the data in CUM to advance over an argument of mode MODE and data type TYPE. diff --git a/gcc/config/avr/avr-protos.h b/gcc/config/avr/avr-protos.h index 35ac2329514..e813c522378 100644 --- a/gcc/config/avr/avr-protos.h +++ b/gcc/config/avr/avr-protos.h @@ -52,7 +52,7 @@ extern int avr_progmem_p PARAMS ((tree decl)); extern rtx avr_function_value PARAMS ((tree type, tree func)); extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *cum, tree fntype, rtx libname, - int indirect)); + tree fndecl)); extern rtx function_arg PARAMS ((CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, int named)); diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 017308bfb8d..238005959e9 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -1488,11 +1488,11 @@ function_arg_regno_p(r) of the argument list. */ void -init_cumulative_args (cum, fntype, libname, indirect) +init_cumulative_args (cum, fntype, libname, fndecl) CUMULATIVE_ARGS *cum; tree fntype; rtx libname; - int indirect ATTRIBUTE_UNUSED; + tree fndecl; { cum->nregs = 18; cum->regno = FIRST_CUM_REG; diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 6b3d6774ab9..77bcd3807ac 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -1136,7 +1136,7 @@ typedef struct avr_args { store anything in `CUMULATIVE_ARGS'; however, the data structure must exist and should not be empty, so use `int'. */ -#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, INDIRECT) +#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, FNDECL) /* A C statement (sans semicolon) for initializing the variable CUM for the state at the beginning of the argument list. The variable diff --git a/gcc/config/d30v/d30v-protos.h b/gcc/config/d30v/d30v-protos.h index dbc908ae003..4089687a5ec 100644 --- a/gcc/config/d30v/d30v-protos.h +++ b/gcc/config/d30v/d30v-protos.h @@ -75,7 +75,7 @@ extern int direct_return PARAMS ((void)); #ifdef TREE_CODE #ifdef RTX_CODE extern void d30v_init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, - rtx, int, int)); + rtx, tree, int)); #endif extern int d30v_function_arg_boundary PARAMS ((enum machine_mode, tree)); #ifdef RTX_CODE diff --git a/gcc/config/d30v/d30v.c b/gcc/config/d30v/d30v.c index 1e79baa5309..17b506862a8 100644 --- a/gcc/config/d30v/d30v.c +++ b/gcc/config/d30v/d30v.c @@ -1922,7 +1922,7 @@ d30v_init_cumulative_args (cum, fntype, libname, indirect, incoming) CUMULATIVE_ARGS *cum; tree fntype; rtx libname; - int indirect; + tree fndecl; int incoming; { *cum = GPR_ARG_FIRST; @@ -1930,7 +1930,7 @@ d30v_init_cumulative_args (cum, fntype, libname, indirect, incoming) if (TARGET_DEBUG_ARG) { fprintf (stderr, "\ninit_cumulative_args:"); - if (indirect) + if (!fndecl && fntype) fputs (" indirect", stderr); if (incoming) diff --git a/gcc/config/d30v/d30v.h b/gcc/config/d30v/d30v.h index ba931130229..31384297643 100644 --- a/gcc/config/d30v/d30v.h +++ b/gcc/config/d30v/d30v.h @@ -1622,8 +1622,8 @@ typedef struct d30v_stack { being processed. Thus, each time this macro is called, either LIBNAME or FNTYPE is nonzero, but never both of them at once. */ -#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \ - d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, INDIRECT, FALSE) +#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) \ + d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FNDECL, FALSE) /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the arguments for the function being compiled. If this macro is undefined, @@ -1634,7 +1634,7 @@ typedef struct d30v_stack { LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'. */ #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \ - d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, TRUE) + d30v_init_cumulative_args (&CUM, FNTYPE, LIBNAME, NULL, TRUE) /* A C statement (sans semicolon) to update the summarizer variable CUM to advance past an argument in the argument list. The values MODE, TYPE and diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 4f5a422cbae..c291feabcb3 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -70,7 +70,7 @@ extern rtx frv_legitimize_address PARAMS ((rtx, rtx, #ifdef TREE_CODE extern void frv_init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, - rtx, int, int)); + rtx, tree, int)); extern int frv_function_arg_boundary PARAMS ((enum machine_mode, tree)); extern rtx frv_function_arg PARAMS ((CUMULATIVE_ARGS *, diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 1c8f5668671..430d9b2682e 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -3081,11 +3081,11 @@ frv_print_operand (file, x, code) FNTYPE is nonzero, but never both of them at once. */ void -frv_init_cumulative_args (cum, fntype, libname, indirect, incoming) +frv_init_cumulative_args (cum, fntype, libname, fndecl, incoming) CUMULATIVE_ARGS *cum; tree fntype; rtx libname; - int indirect; + tree fndecl; int incoming; { *cum = FIRST_ARG_REGNUM; @@ -3093,7 +3093,7 @@ frv_init_cumulative_args (cum, fntype, libname, indirect, incoming) if (TARGET_DEBUG_ARG) { fprintf (stderr, "\ninit_cumulative_args:"); - if (indirect) + if (!fndecl && fntype) fputs (" indirect", stderr); if (incoming) diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 64aa29e72c2..b52a4547258 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -1955,8 +1955,8 @@ struct machine_function GTY(()) being processed. Thus, each time this macro is called, either LIBNAME or FNTYPE is nonzero, but never both of them at once. */ -#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \ - frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, INDIRECT, FALSE) +#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) \ + frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FNDECL, FALSE) /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the arguments for the function being compiled. If this macro is undefined, @@ -1967,7 +1967,7 @@ struct machine_function GTY(()) LIBNAME exists for symmetry with `INIT_CUMULATIVE_ARGS'. */ #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \ - frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, TRUE) + frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, NULL, TRUE) /* A C statement (sans semicolon) to update the summarizer variable CUM to advance past an argument in the argument list. The values MODE, TYPE and diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index bcfc0f65f1b..d31caebdf5e 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -7748,7 +7748,7 @@ mips_expand_prologue () This is only needed if store_args_on_stack is true. */ - INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0); + INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, current_function_decl); regno = GP_ARG_FIRST; for (cur_arg = fnargs; cur_arg != 0; cur_arg = next_arg) diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 595253c8926..e03c1b80251 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -769,9 +769,9 @@ struct hppa_args {int words, nargs_prototype, indirect; }; for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */ -#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \ +#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,FNDECL) \ (CUM).words = 0, \ - (CUM).indirect = INDIRECT, \ + (CUM).indirect = (FNTYPE) && !(FNDECL), \ (CUM).nargs_prototype = (FNTYPE && TYPE_ARG_TYPES (FNTYPE) \ ? (list_length (TYPE_ARG_TYPES (FNTYPE)) - 1 \ + (TYPE_MODE (TREE_TYPE (FNTYPE)) == BLKmode \ diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h index 31e0a2ccc6c..d12e9ef09ef 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -41,7 +41,7 @@ extern int function_arg_pass_by_reference PARAMS ((const CUMULATIVE_ARGS *, tree, int)); extern struct rtx_def *sparc_builtin_saveregs PARAMS ((void)); #ifdef RTX_CODE -extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, int)); +extern void init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree, rtx, tree)); extern void sparc_va_start PARAMS ((tree, rtx)); #endif extern struct rtx_def *sparc_va_arg PARAMS ((tree, tree)); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 50e81f0b8d8..bb84f45cb09 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -4367,11 +4367,11 @@ output_sibcall (insn, call_operand) For a library call, FNTYPE is 0. */ void -init_cumulative_args (cum, fntype, libname, indirect) +init_cumulative_args (cum, fntype, libname, fndecl) CUMULATIVE_ARGS *cum; tree fntype; rtx libname ATTRIBUTE_UNUSED; - int indirect ATTRIBUTE_UNUSED; + tree fndecl ATTRIBUTE_UNUSED; { cum->words = 0; cum->prototype_p = fntype && TYPE_ARG_TYPES (fntype); diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index c6d8aac5982..a41f6b59428 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1734,8 +1734,8 @@ struct sparc_args { for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. */ -#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \ -init_cumulative_args (& (CUM), (FNTYPE), (LIBNAME), (INDIRECT)); +#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) \ +init_cumulative_args (& (CUM), (FNTYPE), (LIBNAME), (FNDECL)); /* Update the data in CUM to advance over an argument of mode MODE and data type TYPE. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 6277057c1c1..ed00f0733ff 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3664,17 +3664,15 @@ arguments are passed on the stack, there is no need to store anything in should not be empty, so use @code{int}. @findex INIT_CUMULATIVE_ARGS -@item INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{indirect}) -A C statement (sans semicolon) for initializing the variable @var{cum} -for the state at the beginning of the argument list. The variable has -type @code{CUMULATIVE_ARGS}. The value of @var{fntype} is the tree node -for the data type of the function which will receive the args, or 0 -if the args are to a compiler support library function. The value of -@var{indirect} is nonzero when processing an indirect call, for example -a call through a function pointer. The value of @var{indirect} is zero -for a call to an explicitly named function, a library function call, or when -@code{INIT_CUMULATIVE_ARGS} is used to find arguments for the function -being compiled. +@item INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, +@var{fndecl}) A C statement (sans semicolon) for initializing the variable +@var{cum} for the state at the beginning of the argument list. The variable +has type @code{CUMULATIVE_ARGS}. The value of @var{fntype} is the tree node +for the data type of the function which will receive the args, or 0 if the args +are to a compiler support library function. For direct calls that are not +libcalls, @var{fndecl} contain the declaration node of the function. +@var{fndecl} is also set when code{INIT_CUMULATIVE_ARGS} is used to find +arguments for the function being compiled. When processing a call to a compiler support library function, @var{libname} identifies which one. It is a @code{symbol_ref} rtx which diff --git a/gcc/function.c b/gcc/function.c index b20d41f784b..e6df55d3829 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4273,7 +4273,7 @@ assign_parms (fndecl) #ifdef INIT_CUMULATIVE_INCOMING_ARGS INIT_CUMULATIVE_INCOMING_ARGS (args_so_far, fntype, NULL_RTX); #else - INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0); + INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, fndecl); #endif /* We haven't yet found an argument that we must push and pretend the