OSDN Git Service

* calls.c (expand_call): Update call of INIT_CUMULATIVE_ARGS
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Feb 2003 18:03:11 +0000 (18:03 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 19 Feb 2003 18:03:11 +0000 (18:03 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63126 138bc75d-0d04-0410-961f-82ee72b054a4

22 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/calls.c
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/avr/avr-protos.h
gcc/config/avr/avr.c
gcc/config/avr/avr.h
gcc/config/d30v/d30v-protos.h
gcc/config/d30v/d30v.c
gcc/config/d30v/d30v.h
gcc/config/frv/frv-protos.h
gcc/config/frv/frv.c
gcc/config/frv/frv.h
gcc/config/mips/mips.c
gcc/config/pa/pa.h
gcc/config/sparc/sparc-protos.h
gcc/config/sparc/sparc.c
gcc/config/sparc/sparc.h
gcc/doc/tm.texi
gcc/function.c

index 9316667..9585c69 100644 (file)
@@ -1,3 +1,26 @@
+Wed Feb 19 19:00:24 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * 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  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.md (*iorsi3_two_qi_sext): New.
index 66580f1..b0920e0 100644 (file)
@@ -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
index 6bec3df..4102c01 100644 (file)
@@ -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));
index 5ffa051..ad4ebff 100644 (file)
@@ -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,
index 0847c97..5650ffb 100644 (file)
@@ -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);
index 3ae323e..3856446 100644 (file)
@@ -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.
index 35ac232..e813c52 100644 (file)
@@ -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));
index 017308b..2380059 100644 (file)
@@ -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;
index 6b3d677..77bcd38 100644 (file)
@@ -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
index dbc908a..4089687 100644 (file)
@@ -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
index 1e79baa..17b5068 100644 (file)
@@ -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)
index ba93113..3138429 100644 (file)
@@ -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
index 4f5a422..c291fea 100644 (file)
@@ -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 *,
index 1c8f566..430d9b2 100644 (file)
@@ -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)
index 64aa29e..b52a454 100644 (file)
@@ -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
index bcfc0f6..d31caeb 100644 (file)
@@ -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)
index 595253c..e03c1b8 100644 (file)
@@ -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 \
index 31e0a2c..d12e9ef 100644 (file)
@@ -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));
index 50e81f0..bb84f45 100644 (file)
@@ -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);
index c6d8aac..a41f6b5 100644 (file)
@@ -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.
index 6277057..ed00f07 100644 (file)
@@ -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
index b20d41f..e6df55d 100644 (file)
@@ -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