tm.texi (INIT_CUMULATIVE_ARGS): Update doco.
authorAlan Modra <amodra@bigpond.net.au>
Fri, 6 Feb 2004 06:18:36 +0000 (06:18 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Fri, 6 Feb 2004 06:18:36 +0000 (16:48 +1030)
* doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco.
* calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS.
(emit_library_call_value_1): Likewise pass nargs.
* expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here.
* function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS.
* config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args
parameter instead of scanning TYPE_ARGS_TYPES to count args.
* config/rs6000/rs6000-protos.h (init_cumulative_args): Update
prototype.
* config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg.
(INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000.
(INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0.
* config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to
INIT_CUMULATIVE_ARGS.
* config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update.
* config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h,
config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h,
config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.h,
config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h,
config/ia64/ia64.h, config/ip2k/ip2k.h, config/iq2000/iq2000.h,
config/iq2000/iq2000.c, config/m32r/m32r.h, config/m68hc11/m68hc11.h,
config/m68k/m68k.h, config/mcore/mcore.h, config/mips/mips.h,
config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h,
config/pa/pa.h, config/pdp11/pdp11.h config/s390/s390.h,
config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h,
config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Likewise.

From-SVN: r77380

42 files changed:
gcc/ChangeLog
gcc/calls.c
gcc/config/alpha/alpha.h
gcc/config/alpha/unicosmk.h
gcc/config/alpha/vms.h
gcc/config/arc/arc.h
gcc/config/arm/arm.h
gcc/config/avr/avr.h
gcc/config/c4x/c4x.h
gcc/config/cris/cris.h
gcc/config/fr30/fr30.h
gcc/config/frv/frv.h
gcc/config/h8300/h8300.h
gcc/config/i386/i386.h
gcc/config/i860/i860.h
gcc/config/ia64/ia64.h
gcc/config/ip2k/ip2k.h
gcc/config/iq2000/iq2000.c
gcc/config/iq2000/iq2000.h
gcc/config/m32r/m32r.h
gcc/config/m68hc11/m68hc11.h
gcc/config/m68k/m68k.h
gcc/config/mcore/mcore.h
gcc/config/mips/mips.h
gcc/config/mmix/mmix.h
gcc/config/mn10300/mn10300.h
gcc/config/ns32k/ns32k.h
gcc/config/pa/pa.h
gcc/config/pdp11/pdp11.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/sh/sh.c
gcc/config/sh/sh.h
gcc/config/sparc/sparc.h
gcc/config/stormy16/stormy16.h
gcc/config/v850/v850.h
gcc/config/vax/vax.h
gcc/config/xtensa/xtensa.h
gcc/doc/tm.texi
gcc/expr.c
gcc/function.c

index a1edf053b25123a7aae9796a08f3092124f3a459..30be17ec2b49cf97d6f6ce3ce0c8223b21acb8a2 100644 (file)
@@ -1,3 +1,32 @@
+2004-02-06  Alan Modra  <amodra@bigpond.net.au>
+
+       * doc/tm.texi (INIT_CUMULATIVE_ARGS): Update doco.
+       * calls.c (expand_call): Pass n_named_args to INIT_CUMULATIVE_ARGS.
+       (emit_library_call_value_1): Likewise pass nargs.
+       * expr.c (block_move_libcall_safe_for_call_parm): Pass 3 here.
+       * function.c (assign_parms): Pass -1 to INIT_CUMULATIVE_ARGS.
+       * config/rs6000/rs6000.c (init_cumulative_args): Use n_named_args
+       parameter instead of scanning TYPE_ARGS_TYPES to count args.
+       * config/rs6000/rs6000-protos.h (init_cumulative_args): Update
+       prototype.
+       * config/rs6000/rs6000.h (INIT_CUMULATIVE_ARGS): Pass extra arg.
+       (INIT_CUMULATIVE_INCOMING_ARGS): Set extra arg to 1000.
+       (INIT_CUMULATIVE_LIBCALL_ARGS): Set extra arg to 0.
+       * config/sh/sh.c (sh_output_mi_thunk): Pass 1 as n_named_args to
+       INIT_CUMULATIVE_ARGS.
+       * config/alpha/alpha.h (INIT_CUMULATIVE_ARGS): Update.
+       * config/alpha/unicosmk.h, config/alpha/vms.h, config/arc/arc.h,
+       config/arm/arm.h, config/avr/avr.h, config/c4x/c4x.h,
+       config/cris/cris.h, config/fr30/fr30.h, config/frv/frv.h,
+       config/h8300/h8300.h, config/i386/i386.h, config/i860/i860.h,
+       config/ia64/ia64.h, config/ip2k/ip2k.h, config/iq2000/iq2000.h,
+       config/iq2000/iq2000.c, config/m32r/m32r.h, config/m68hc11/m68hc11.h,
+       config/m68k/m68k.h, config/mcore/mcore.h, config/mips/mips.h,
+       config/mmix/mmix.h, config/mn10300/mn10300.h, config/ns32k/ns32k.h,
+       config/pa/pa.h, config/pdp11/pdp11.h config/s390/s390.h,
+       config/sh/sh.h, config/sparc/sparc.h, config/stormy16/stormy16.h,
+       config/v850/v850.h, config/vax/vax.h, config/xtensa/xtensa.h: Likewise.
+
 2004-02-06  Kazu Hirata  <kazu@cs.umass.edu>
 
        * genemit.c (gen_exp) [CONST_INT]: Use const_int_rtx whenever
index 607911c4e2c61bbee343338715e74d13ad62201f..d702ed0d3a61eb3cedac4c80c718d8d46f3604fb 100644 (file)
@@ -2400,14 +2400,6 @@ expand_call (tree exp, rtx target, int ignore)
   for (p = actparms, num_actuals = 0; p; p = TREE_CHAIN (p))
     num_actuals++;
 
-  /* Start updating where the next arg would go.
-
-     On some machines (such as the PA) indirect calls have a different
-     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);
-
   /* Compute number of named args.
      Normally, don't include the last named arg if anonymous args follow.
      We do include the last named arg if
@@ -2439,6 +2431,14 @@ expand_call (tree exp, rtx target, int ignore)
     /* If we know nothing, treat all args as named.  */
     n_named_args = num_actuals;
 
+  /* Start updating where the next arg would go.
+
+     On some machines (such as the PA) indirect calls have a different
+     calling convention than normal calls.  The fourth 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, n_named_args);
+
   /* Make a vector to hold all the information about each arg.  */
   args = alloca (num_actuals * sizeof (struct arg_data));
   memset (args, 0, num_actuals * sizeof (struct arg_data));
@@ -3783,7 +3783,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
 #ifdef INIT_CUMULATIVE_LIBCALL_ARGS
   INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun);
 #else
-  INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0);
+  INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0, nargs);
 #endif
 
   args_size.constant = 0;
index b46197f1bbd92fc8791f62754e86792e157ae616..4c0053f43911c8556ca1c2d5fe464daa196c9302 100644 (file)
@@ -1002,7 +1002,8 @@ extern int alpha_memory_latency;
    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)  (CUM) = 0
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+  (CUM) = 0
 
 /* Define intermediate macro to compute the size (in registers) of an argument
    for the Alpha.  */
index a86f3c867d22bddc5c202c2da6f3bb5e83c6cf93..d1dfe91262275e0a77568800f63b3f9288b608f3 100644 (file)
@@ -176,7 +176,7 @@ typedef struct {
    function whose data type is FNTYPE.  For a library call, FNTYPE is 0.  */
 
 #undef INIT_CUMULATIVE_ARGS
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)      \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   do { (CUM).num_args = 0;                                     \
        (CUM).num_arg_words = 0;                                        \
        (CUM).num_reg_words = 0;                                        \
index 0a2e516127e15cf17a0434b7321f8a0bb5f1f31b..f7058f3ff399fa2a85827ee6e33364546eae33f5 100644 (file)
@@ -172,7 +172,7 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
    For a library call, FNTYPE is 0.  */
 
 #undef INIT_CUMULATIVE_ARGS
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   (CUM).num_args = 0;                                          \
   (CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64;   \
   (CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64;
index 42441d837dcfab60cb129578c54fffe8c3ceffc4..cdd9ba292073543ded4a4c9b0670bc634a314744 100644 (file)
@@ -623,7 +623,7 @@ extern enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER];
 /* 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.  */
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
 ((CUM) = 0)
 
 /* The number of registers used for parameter passing.  Local to this file.  */
index d2986ff4928ec11280ae50eb43fd7500cd8a1ead..26c452690968b6c5db7c8effa43b1c5543a5f98c 100644 (file)
@@ -1875,7 +1875,7 @@ 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, FNDECL) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
   arm_init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL))
 
 /* Update the data in CUM to advance over an argument
index 64884281928fe9b1859870fbafcfe652c6a6b6a2..01ca6047956642a707511e10a929d845b33faa39 100644 (file)
@@ -381,7 +381,8 @@ typedef struct avr_args {
   int regno;                   /* next available register number */
 } CUMULATIVE_ARGS;
 
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) init_cumulative_args (&(CUM), FNTYPE, LIBNAME, FNDECL)
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
+  init_cumulative_args (&(CUM), FNTYPE, LIBNAME, FNDECL)
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)   \
   (function_arg_advance (&CUM, MODE, TYPE, NAMED))
index 1725b796a6e71d830398774b3482fd1bee6fff93..35680b35d8c883718a4be05e52cca29cab34189c 100644 (file)
@@ -1114,7 +1114,7 @@ typedef struct c4x_args
 }
 CUMULATIVE_ARGS;
 
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)      \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   (c4x_init_cumulative_args (&CUM, FNTYPE, LIBNAME))
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)   \
index a999e04b6bd8f0bc15096d63e397bb67c181d9fe..5110f9adbfb92484e923f0a43c5988160da6912d 100644 (file)
@@ -956,7 +956,7 @@ struct cum_args {int regs;};
 
 /* The regs member is an integer, the number of arguments got into
    registers so far.  */
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL)       \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
  ((CUM).regs = 0)
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)           \
index 29753016cf94f0de794869a19201c7c886fa53f9..0ab0e72c3302f0b6e51cb7a412961fb906f6672b 100644 (file)
@@ -759,7 +759,8 @@ enum reg_class
    the function, as a string.  LIBNAME is 0 when an ordinary C function call is
    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) (CUM) = 0
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+  (CUM) = 0
 
 /* 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 df5ae079372fe45085649645f60dc8c8f6e8c4c2..828e8a326d1c30282bb7a0bff18a1652aef0ea76 100644 (file)
@@ -1940,7 +1940,7 @@ 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, FNDECL) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
   frv_init_cumulative_args (&CUM, FNTYPE, LIBNAME, FNDECL, FALSE)
 
 /* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
index c21eff1e5e981eedfc90b20caef480092baf8636..e2ba3078ee35116fe9964247fda7770e19a08ea6 100644 (file)
@@ -665,7 +665,7 @@ struct cum_arg
 
    On the H8/300, the offset starts at 0.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT)   \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  ((CUM).nbytes = 0, (CUM).libcall = LIBNAME)
 
 /* Update the data in CUM to advance over an argument
index 46bb52277ed8df4b7f86a7dbb1e9672cdee6467c..482a8407ef5872334f9bd8dd2295e064d9ec41eb 100644 (file)
@@ -1747,7 +1747,7 @@ typedef struct ix86_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, FNDECL) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
   init_cumulative_args (&(CUM), (FNTYPE), (LIBNAME), (FNDECL))
 
 /* Update the data in CUM to advance over an argument
index 61db1fc093cd5d3fe71174003dbb76c838343818..354df72901044c8af46c5ae82a34349826332cd2 100644 (file)
@@ -464,7 +464,7 @@ struct cumulative_args { int ints, floats; };
    when the function gets a structure-value-address as an
    invisible first argument.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)      \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  ((CUM).ints = ((FNTYPE) != 0 && aggregate_value_p (TREE_TYPE ((FNTYPE)), 0) \
                ? 4 : 0),                       \
   (CUM).floats = 0)
index cc218385756e44967e906d951607b79d806911d5..279500ee7505da187b725722f22a2d35c78b46c3 100644 (file)
@@ -1338,7 +1338,7 @@ typedef struct ia64_args
 /* A C statement (sans semicolon) for initializing the variable CUM for the
    state at the beginning of the argument list.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
 do {                                                                   \
   (CUM).words = 0;                                                     \
   (CUM).int_regs = 0;                                                  \
index 1ed494fa2d9b7dae8e0c5808f75f237f7a20223b..8c9a66c89d4453875f6fe86914214252b381d0dc 100644 (file)
@@ -441,7 +441,7 @@ enum reg_class {
 
 #define CUMULATIVE_ARGS        int
 
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   ((CUM) = 0)
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)
index 0490072dcbd4bee2a4e9001596638921522923d3..ca48c915d1d7895ff92a45afc600031c130aa756 100644 (file)
@@ -2333,7 +2333,7 @@ iq2000_expand_prologue (void)
      variable arguments.
 
      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, 0, 0);
   regno = GP_ARG_FIRST;
 
   for (cur_arg = fnargs; cur_arg != 0; cur_arg = next_arg)
index d4a31023e5c4c248cafa087d4df31d728649a7be..a69096b4464cf444b65e5e61c486e546ebb4e7fe 100644 (file)
@@ -466,7 +466,7 @@ typedef struct iq2000_args
 /* 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.  */
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)              \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   init_cumulative_args (& CUM, FNTYPE, LIBNAME)                                \
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                   \
index 3ecfc8f2dd23d39fcb4201a9ecbd49ce06342d3e..00bdad63e98d00aa80023d2cd8a54665c70ca55a 100644 (file)
@@ -1044,7 +1044,7 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
 /* 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.  */
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   ((CUM) = 0)
 
 /* The number of registers used for parameter passing.  Local to this file.  */
index 8c0dd19a44dccc30c641d6255e069eaa858d0868..4dee10644c783e5f0e7dc9bf8011e6f101ba589c 100644 (file)
@@ -1070,7 +1070,7 @@ typedef struct m68hc11_args
 
 /* 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.  */
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
     (m68hc11_init_cumulative_args (&CUM, FNTYPE, LIBNAME))
 
 /* Update the data in CUM to advance over an argument of mode MODE and data
index 5ae893ede9a37ed5fd1d0874bf63326dc99935e8..86742fc49c1d1a2187436943df03f7bbcfe9a4f0 100644 (file)
@@ -901,7 +901,7 @@ enum reg_class {
 
    On the m68k, the offset starts at 0.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)      \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  ((CUM) = 0)
 
 /* Update the data in CUM to advance over an argument
index 56d311c49b021100dc4731a4988571d3cee09078..69558291b3e05a372a4b5642a4be5289cccfafa3 100644 (file)
@@ -700,7 +700,7 @@ extern const enum reg_class reg_class_from_letter[];
 
    On MCore, the offset always starts at 0: the first parm reg is always
    the same reg.  */
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   ((CUM) = 0)
 
 /* Update the data in CUM to advance over an argument
index 6b137e422bb8981601adb5dc4740792a40ab643d..d899143967ab846ea03b5b9e30f82b7a42689743 100644 (file)
@@ -2287,7 +2287,7 @@ typedef struct mips_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)              \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   init_cumulative_args (&CUM, FNTYPE, LIBNAME)                         \
 
 /* Update the data in CUM to advance over an argument
index f628f278cf5a6a4d747bb46256eb1a94a93e53b0..4cb3075adbe065feea1d883ce4259d4b9e568da3 100644 (file)
@@ -737,7 +737,7 @@ enum reg_class
 
 typedef struct { int regs; int lib; } CUMULATIVE_ARGS;
 
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT)   \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  ((CUM).regs = 0, (CUM).lib = ((LIBNAME) != 0))
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)           \
index f3eb753f33ba39f42a1751561ea972471fd736b6..8508838124ef7bdec3e64681eb884ca0a4060d03 100644 (file)
@@ -560,7 +560,7 @@ struct cum_arg {int nbytes; };
 
    On the MN10300, the offset starts at 0.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)      \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  ((CUM).nbytes = 0)
 
 /* Update the data in CUM to advance over an argument
index 96a6a37a1675d2fc01504f8db0558c6373130f66..a31eba61cf23628bf4081cbb11852b8eb0ef1dff 100644 (file)
@@ -675,7 +675,7 @@ enum reg_class
 
    On the ns32k, the offset starts at 0.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)      \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  ((CUM) = 0)
 
 /* Update the data in CUM to advance over an argument
index 95fb2f2caa24116be74a3dc95721e3339529f899..944917fb6d2d1567fea4caf2329dde6b76732e65 100644 (file)
@@ -785,7 +785,7 @@ struct hppa_args {int words, nargs_prototype, incoming, 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,FNDECL) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
   (CUM).words = 0,                                                     \
   (CUM).incoming = 0,                                                  \
   (CUM).indirect = (FNTYPE) && !(FNDECL),                              \
index d54146fa005e806389f2e1d2bbca0f22cf2c0af7..725fe25e0a06e99617a81b2ec01b5ae61f6cec27 100644 (file)
@@ -591,7 +591,7 @@ maybe ac0 ? - as option someday! */
    when the function gets a structure-value-address as an
    invisible first argument.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)      \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  ((CUM) = 0)
 
 /* Update the data in CUM to advance over an argument
index 2dcdd0df34eb02b290ed6736140b49165923ffe5..1121e309db99cd8343001c7fc1ee1ce965417ea5 100644 (file)
@@ -28,7 +28,7 @@
 #ifdef RTX_CODE
 
 #ifdef TREE_CODE
-extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, int, int);
+extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, int, int, int);
 extern void rs6000_va_start (tree, rtx);
 #endif /* TREE_CODE */
 
index 27aef803b72a77921268053c36be6a9409c39a2c..1db36b17f2e2a370df24074aab215f49aa9d64f6 100644 (file)
@@ -3836,7 +3836,8 @@ rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
 
 void
 init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, 
-       rtx libname ATTRIBUTE_UNUSED, int incoming, int libcall)
+                     rtx libname ATTRIBUTE_UNUSED, int incoming,
+                     int libcall, int n_named_args)
 {
   static CUMULATIVE_ARGS zero_cumulative;
 
@@ -3853,17 +3854,9 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
        && (TREE_VALUE (tree_last  (TYPE_ARG_TYPES (fntype)))
            != void_type_node));
 
-  if (incoming)
-    cum->nargs_prototype = 1000;               /* don't return a PARALLEL */
-
-  else if (cum->prototype)
-    cum->nargs_prototype = (list_length (TYPE_ARG_TYPES (fntype)) - 1
-                           + (TYPE_MODE (TREE_TYPE (fntype)) == BLKmode
-                              || rs6000_return_in_memory (TREE_TYPE (fntype),
-                                                          fntype)));
-
-  else
-    cum->nargs_prototype = 0;
+  cum->nargs_prototype = 0;
+  if (incoming || cum->prototype)
+    cum->nargs_prototype = n_named_args;
 
   /* Check for a longcall attribute.  */
   if (fntype
@@ -8369,10 +8362,10 @@ addrs_ok_for_quad_peep (rtx addr1, rtx addr2)
     }
 
   /* Make sure the second address is a (mem (plus (reg) (const_int)))
-      or if it is (mem (reg)) then make sure that offset1 is -8 and the same 
-      register as addr1.  */
+     or if it is (mem (reg)) then make sure that offset1 is -8 and the same 
+     register as addr1.  */
   if (offset1 == -8 && GET_CODE (addr2) == REG && reg1 == REGNO (addr2))
-   return 1;
+    return 1;
   if (GET_CODE (addr2) != PLUS)
     return 0;
 
index 7b87f59bdbb07bc2e6ec7f84c23273e2d3f284e0..8ca547ada50b7892d401de9181380bf1c9b917d2 100644 (file)
@@ -1767,19 +1767,19 @@ typedef struct rs6000_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, FALSE, FALSE)
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+  init_cumulative_args (&CUM, FNTYPE, LIBNAME, FALSE, FALSE, N_NAMED_ARGS)
 
 /* Similar, but when scanning the definition of a procedure.  We always
    set NARGS_PROTOTYPE large so we never return an EXPR_LIST.  */
 
-#define INIT_CUMULATIVE_INCOMING_ARGS(CUM,FNTYPE,LIBNAME) \
-  init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE, FALSE)
+#define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
+  init_cumulative_args (&CUM, FNTYPE, LIBNAME, TRUE, FALSE, 1000)
 
 /* Like INIT_CUMULATIVE_ARGS' but only used for outgoing libcalls.  */
 
 #define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \
-  init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE)
+  init_cumulative_args (&CUM, NULL_TREE, LIBNAME, FALSE, TRUE, 0)
 
 /* Update the data in CUM to advance over an argument
    of mode MODE and data type TYPE.
index d3c903f5e8039489fe3d73540614a43e7ef3fe9e..1acdeadfd6a92da19fac2894c9afdac24294dfbe 100644 (file)
@@ -8958,7 +8958,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
      SH that it's best to do this completely machine independently.
      "this" is passed as first argument, unless a structure return pointer 
      comes first, in which case "this" comes second.  */
-  INIT_CUMULATIVE_ARGS (cum, funtype, NULL_RTX, 0);
+  INIT_CUMULATIVE_ARGS (cum, funtype, NULL_RTX, 0, 1);
 #ifndef PCC_STATIC_STRUCT_RETURN
   if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function))
     structure_value_byref = 1;
index b83a24eb568cd9956c5a13ab00c6d13f1d2771bb..c3677977bd4541b94bfe4653d9904b155f5f69b1 100644 (file)
@@ -1820,7 +1820,7 @@ struct sh_args {
 
    For TARGET_HITACHI, the structure value pointer is passed in memory.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
   do {                                                         \
     (CUM).arg_count[(int) SH_ARG_INT] = 0;                     \
     (CUM).arg_count[(int) SH_ARG_FLOAT] = 0;                   \
@@ -1851,7 +1851,7 @@ struct sh_args {
 
 #define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \
   do {                                                         \
-    INIT_CUMULATIVE_ARGS ((CUM), NULL_TREE, (LIBNAME), 0);     \
+    INIT_CUMULATIVE_ARGS ((CUM), NULL_TREE, (LIBNAME), 0, 0);  \
     (CUM).call_cookie                                          \
       = (CALL_COOKIE_RET_TRAMP                                 \
         (TARGET_SHCOMPACT && GET_MODE_SIZE (MODE) > 4          \
@@ -1860,7 +1860,7 @@ struct sh_args {
 
 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME) \
   do {                                                         \
-    INIT_CUMULATIVE_ARGS ((CUM), (FNTYPE), (LIBNAME), 0);      \
+    INIT_CUMULATIVE_ARGS ((CUM), (FNTYPE), (LIBNAME), 0, 0);   \
     (CUM).outgoing = 0;                                                \
   } while (0)
 
index bfe3e32f227dc1d7f7395700739e12fd1ff45e51..81a1be3b0ed8c9704d35cff656663b8dc196d54f 100644 (file)
@@ -1673,7 +1673,7 @@ 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, FNDECL) \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
 init_cumulative_args (& (CUM), (FNTYPE), (LIBNAME), (FNDECL));
 
 /* Update the data in CUM to advance over an argument
index 726ef4b313d59dd4f40585a1f0f408fd11d518fa..09584adca4cc6ccc0f1864b102b17258d9d67ece 100644 (file)
@@ -424,7 +424,8 @@ enum reg_class
    of arguments that have been passed in registers so far.  */
 #define CUMULATIVE_ARGS int
 
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) (CUM) = 0
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+  (CUM) = 0
 
 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)                   \
   ((CUM) = xstormy16_function_arg_advance (CUM, MODE, TYPE, NAMED))
index 4233d7258d05f75572b2bb772d0c844f3edebf4a..74a080c83cb1879ff83458f2f13732ace0afa66d 100644 (file)
@@ -753,7 +753,7 @@ struct cum_arg { int nbytes; int anonymous_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)      \
+#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
index 3902c4b749e88b109773927e5ea8cdac7ee3efb4..c2de0f64715ab476b5549b0747fdbcfedb1217d0 100644 (file)
@@ -441,7 +441,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
 
    On the VAX, the offset starts at 0.  */
 
-#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT)      \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
  ((CUM) = 0)
 
 /* Update the data in CUM to advance over an argument
index cc6d1b2d4d4b3c714a94b30458e33abd980a25ea..0e97229820e937720c3d4e863e2866371516ab60 100644 (file)
@@ -749,7 +749,7 @@ typedef struct xtensa_args {
 /* 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.  */
-#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT)           \
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
   init_cumulative_args (&CUM, FNTYPE, LIBNAME)
 
 #define INIT_CUMULATIVE_INCOMING_ARGS(CUM, FNTYPE, LIBNAME)            \
index 46c0b650be8f2aa07eb2a2bc6fc1c3e0ecba281f..dc6953a09357a742c6faca4a8e76ff72620907bd 100644 (file)
@@ -3725,7 +3725,7 @@ arguments are passed on the stack, there is no need to store anything in
 should not be empty, so use @code{int}.
 @end defmac
 
-@defmac INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{fndecl})
+@defmac INIT_CUMULATIVE_ARGS (@var{cum}, @var{fntype}, @var{libname}, @var{fndecl}, @var{n_named_args})
 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}
@@ -3734,7 +3734,10 @@ 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.
+being compiled.  @var{n_named_args} is set to the number of named
+arguments, including a structure return address if it is passed as a
+parameter, when making a call.  When processing incoming arguments,
+@var{n_named_args} is set to -1.
 
 When processing a call to a compiler support library function,
 @var{libname} identifies which one.  It is a @code{symbol_ref} rtx which
index 55e5f0690fe7d598adacab8b75daca3966bc089d..7d6dd16673131c7e7257c104ffea966a170b1ac0 100644 (file)
@@ -1390,7 +1390,7 @@ block_move_libcall_safe_for_call_parm (void)
     tree fn, arg;
 
     fn = emit_block_move_libcall_fn (false);
-    INIT_CUMULATIVE_ARGS (args_so_far, TREE_TYPE (fn), NULL_RTX, 0);
+    INIT_CUMULATIVE_ARGS (args_so_far, TREE_TYPE (fn), NULL_RTX, 0, 3);
 
     arg = TYPE_ARG_TYPES (TREE_TYPE (fn));
     for ( ; arg != void_list_node ; arg = TREE_CHAIN (arg))
index 675d919cb0ce8041272ffb384855c9859d63b723..890ebd34c5dd6100dfd467ab237cab38cc18f6ba 100644 (file)
@@ -4351,7 +4351,7 @@ assign_parms (tree 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, fndecl);
+  INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, fndecl, -1);
 #endif
 
   /* We haven't yet found an argument that we must push and pretend the