Use function_arg_info for TARGET_SETUP_INCOMING_ARGS
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 20 Aug 2019 08:52:48 +0000 (08:52 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 20 Aug 2019 08:52:48 +0000 (08:52 +0000)
The hook is passed the promoted mode instead of the original type mode.

2019-08-20  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* target.def (setup_incoming_varargs): Take a function_arg_info
instead of a mode and tree.
* doc/tm.texi: Regenerate.
* targhooks.h (default_setup_incoming_varargs): Take a
function_arg_info instead of a mode and tree.
* targhooks.c (default_setup_incoming_varargs): Likewise.
* config/aarch64/aarch64.c (aarch64_setup_incoming_varargs): Likewise.
* config/alpha/alpha.c (alpha_setup_incoming_varargs): Likewise.
* config/arc/arc.c (arc_setup_incoming_varargs): Likewise.
* config/arm/arm.c (arm_setup_incoming_varargs): Likewise.
* config/bfin/bfin.c (setup_incoming_varargs): Likewise.
* config/cris/cris.c (cris_setup_incoming_varargs): Likewise.
* config/csky/csky.c (csky_setup_incoming_varargs): Likewise.
* config/epiphany/epiphany.c (epiphany_setup_incoming_varargs):
Likewise.
* config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise.
* config/frv/frv.c (frv_setup_incoming_varargs): Likewise.
* config/ft32/ft32.c (ft32_setup_incoming_varargs): Likewise.
* config/i386/i386.c (ix86_setup_incoming_varargs): Likewise.
* config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise.
* config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise.
* config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise.
* config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise.
* config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise.
* config/mips/mips.c (mips_setup_incoming_varargs): Likewise.
* config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise.
* config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise.
* config/nds32/nds32.c (nds32_setup_incoming_varargs): Likewise.
* config/nios2/nios2.c (nios2_setup_incoming_varargs): Likewise.
* config/riscv/riscv.c (riscv_setup_incoming_varargs): Likewise.
* config/rs6000/rs6000-internal.h (setup_incoming_varargs): Likewise.
* config/rs6000/rs6000-call.c (setup_incoming_varargs): Likewise.
* config/sh/sh.c (sh_setup_incoming_varargs): Likewise.
* config/spu/spu.c (spu_setup_incoming_varargs): Likewise.
* config/tilegx/tilegx.c (tilegx_setup_incoming_varargs): Likewise.
* config/tilepro/tilepro.c (tilepro_setup_incoming_varargs): Likewise.
* config/visium/visium.c (visium_setup_incoming_varargs): Likewise.
* function.c (assign_parms_setup_varargs): Update call to
targetm.calls.setup_incoming_varargs.

From-SVN: r274699

36 files changed:
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/alpha/alpha.c
gcc/config/arc/arc.c
gcc/config/arm/arm.c
gcc/config/bfin/bfin.c
gcc/config/cris/cris.c
gcc/config/csky/csky.c
gcc/config/epiphany/epiphany.c
gcc/config/fr30/fr30.c
gcc/config/frv/frv.c
gcc/config/ft32/ft32.c
gcc/config/i386/i386.c
gcc/config/ia64/ia64.c
gcc/config/iq2000/iq2000.c
gcc/config/lm32/lm32.c
gcc/config/m32r/m32r.c
gcc/config/mcore/mcore.c
gcc/config/mips/mips.c
gcc/config/mmix/mmix.c
gcc/config/moxie/moxie.c
gcc/config/nds32/nds32.c
gcc/config/nios2/nios2.c
gcc/config/riscv/riscv.c
gcc/config/rs6000/rs6000-call.c
gcc/config/rs6000/rs6000-internal.h
gcc/config/sh/sh.c
gcc/config/spu/spu.c
gcc/config/tilegx/tilegx.c
gcc/config/tilepro/tilepro.c
gcc/config/visium/visium.c
gcc/doc/tm.texi
gcc/function.c
gcc/target.def
gcc/targhooks.c
gcc/targhooks.h

index 026a7c8f7e8aeeac1bb2536de7935ea44c8a5b70..f9cfcc0a990502cb4828865588a2af5adb4de390 100644 (file)
@@ -1,3 +1,45 @@
+2019-08-20  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * target.def (setup_incoming_varargs): Take a function_arg_info
+       instead of a mode and tree.
+       * doc/tm.texi: Regenerate.
+       * targhooks.h (default_setup_incoming_varargs): Take a
+       function_arg_info instead of a mode and tree.
+       * targhooks.c (default_setup_incoming_varargs): Likewise.
+       * config/aarch64/aarch64.c (aarch64_setup_incoming_varargs): Likewise.
+       * config/alpha/alpha.c (alpha_setup_incoming_varargs): Likewise.
+       * config/arc/arc.c (arc_setup_incoming_varargs): Likewise.
+       * config/arm/arm.c (arm_setup_incoming_varargs): Likewise.
+       * config/bfin/bfin.c (setup_incoming_varargs): Likewise.
+       * config/cris/cris.c (cris_setup_incoming_varargs): Likewise.
+       * config/csky/csky.c (csky_setup_incoming_varargs): Likewise.
+       * config/epiphany/epiphany.c (epiphany_setup_incoming_varargs):
+       Likewise.
+       * config/fr30/fr30.c (fr30_setup_incoming_varargs): Likewise.
+       * config/frv/frv.c (frv_setup_incoming_varargs): Likewise.
+       * config/ft32/ft32.c (ft32_setup_incoming_varargs): Likewise.
+       * config/i386/i386.c (ix86_setup_incoming_varargs): Likewise.
+       * config/ia64/ia64.c (ia64_setup_incoming_varargs): Likewise.
+       * config/iq2000/iq2000.c (iq2000_setup_incoming_varargs): Likewise.
+       * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise.
+       * config/m32r/m32r.c (m32r_setup_incoming_varargs): Likewise.
+       * config/mcore/mcore.c (mcore_setup_incoming_varargs): Likewise.
+       * config/mips/mips.c (mips_setup_incoming_varargs): Likewise.
+       * config/mmix/mmix.c (mmix_setup_incoming_varargs): Likewise.
+       * config/moxie/moxie.c (moxie_setup_incoming_varargs): Likewise.
+       * config/nds32/nds32.c (nds32_setup_incoming_varargs): Likewise.
+       * config/nios2/nios2.c (nios2_setup_incoming_varargs): Likewise.
+       * config/riscv/riscv.c (riscv_setup_incoming_varargs): Likewise.
+       * config/rs6000/rs6000-internal.h (setup_incoming_varargs): Likewise.
+       * config/rs6000/rs6000-call.c (setup_incoming_varargs): Likewise.
+       * config/sh/sh.c (sh_setup_incoming_varargs): Likewise.
+       * config/spu/spu.c (spu_setup_incoming_varargs): Likewise.
+       * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs): Likewise.
+       * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs): Likewise.
+       * config/visium/visium.c (visium_setup_incoming_varargs): Likewise.
+       * function.c (assign_parms_setup_varargs): Update call to
+       targetm.calls.setup_incoming_varargs.
+
 2019-08-20  Richard Sandiford  <richard.sandiford@arm.com>
 
        * target.def (pass_by_reference): Take a function_arg_info instead
index 5694dd796f7411ff7256b6d22a4f3085caf53402..4c5871c15d62ad4288f558d07751af0b9fc665d6 100644 (file)
@@ -14511,9 +14511,9 @@ aarch64_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
 /* Implement TARGET_SETUP_INCOMING_VARARGS.  */
 
 static void
-aarch64_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode,
-                               tree type, int *pretend_size ATTRIBUTE_UNUSED,
-                               int no_rtl)
+aarch64_setup_incoming_varargs (cumulative_args_t cum_v,
+                               const function_arg_info &arg,
+                               int *pretend_size ATTRIBUTE_UNUSED, int no_rtl)
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
   CUMULATIVE_ARGS local_cum;
@@ -14524,7 +14524,8 @@ aarch64_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode,
      argument.  Advance a local copy of CUM past the last "real" named
      argument, to find out how many registers are left over.  */
   local_cum = *cum;
-  aarch64_function_arg_advance (pack_cumulative_args(&local_cum), mode, type, true);
+  aarch64_function_arg_advance (pack_cumulative_args(&local_cum),
+                               arg.mode, arg.type, arg.named);
 
   /* Found out how many registers we need to save.
      Honor tree-stdvar analysis results.  */
index e4313673b4c99607810187a4a04f075c5f642104..2aace8896071c0912ec41f8f44cdff0608350b39 100644 (file)
@@ -6090,14 +6090,15 @@ escapes:
    variable number of arguments.  */
 
 static void
-alpha_setup_incoming_varargs (cumulative_args_t pcum, machine_mode mode,
-                             tree type, int *pretend_size, int no_rtl)
+alpha_setup_incoming_varargs (cumulative_args_t pcum,
+                             const function_arg_info &arg,
+                             int *pretend_size, int no_rtl)
 {
   CUMULATIVE_ARGS cum = *get_cumulative_args (pcum);
 
   /* Skip the current argument.  */
-  targetm.calls.function_arg_advance (pack_cumulative_args (&cum), mode, type,
-                                     true);
+  targetm.calls.function_arg_advance (pack_cumulative_args (&cum),
+                                     arg.mode, arg.type, arg.named);
 
 #if TARGET_ABI_OPEN_VMS
   /* For VMS, we allocate space for all 6 arg registers plus a count.
index 5b0d8b9b134c3379ff77879c1a56cf9d5be40548..bfa38abcd4b4ff21613a8471dfc66706c5019802 100644 (file)
@@ -2415,12 +2415,12 @@ arc_double_limm_p (rtx value)
    create a register parameter block, and then copy any anonymous arguments
    in registers to memory.
 
-   CUM has not been updated for the last named argument which has type TYPE
-   and mode MODE, and we rely on this fact.  */
+   CUM has not been updated for the last named argument (which is given
+   by ARG), and we rely on this fact.  */
 
 static void
 arc_setup_incoming_varargs (cumulative_args_t args_so_far,
-                           machine_mode mode, tree type,
+                           const function_arg_info &arg,
                            int *pretend_size, int no_rtl)
 {
   int first_anon_arg;
@@ -2430,7 +2430,7 @@ arc_setup_incoming_varargs (cumulative_args_t args_so_far,
 
   next_cum = *get_cumulative_args (args_so_far);
   arc_function_arg_advance (pack_cumulative_args (&next_cum),
-                           mode, type, true);
+                           arg.mode, arg.type, arg.named);
   first_anon_arg = next_cum;
 
   if (FUNCTION_ARG_REGNO_P (first_anon_arg))
index cceb3c7ff33f43dddc368c00860c53dda54832e3..f713945a299650370711802b9fb6931d703a2dac 100644 (file)
@@ -212,8 +212,8 @@ static void arm_file_end (void);
 static void arm_file_start (void);
 static void arm_insert_attributes (tree, tree *);
 
-static void arm_setup_incoming_varargs (cumulative_args_t, machine_mode,
-                                       tree, int *, int);
+static void arm_setup_incoming_varargs (cumulative_args_t,
+                                       const function_arg_info &, int *, int);
 static bool arm_pass_by_reference (cumulative_args_t,
                                   const function_arg_info &);
 static bool arm_promote_prototypes (const_tree);
@@ -27054,8 +27054,7 @@ arm_output_load_gr (rtx *operands)
 
 static void
 arm_setup_incoming_varargs (cumulative_args_t pcum_v,
-                           machine_mode mode,
-                           tree type,
+                           const function_arg_info &arg,
                            int *pretend_size,
                            int second_time ATTRIBUTE_UNUSED)
 {
@@ -27068,17 +27067,17 @@ arm_setup_incoming_varargs (cumulative_args_t pcum_v,
       nregs = pcum->aapcs_ncrn;
       if (nregs & 1)
        {
-         int res = arm_needs_doubleword_align (mode, type);
+         int res = arm_needs_doubleword_align (arg.mode, arg.type);
          if (res < 0 && warn_psabi)
            inform (input_location, "parameter passing for argument of "
-                   "type %qT changed in GCC 7.1", type);
+                   "type %qT changed in GCC 7.1", arg.type);
          else if (res > 0)
            {
              nregs++;
              if (res > 1 && warn_psabi)
                inform (input_location,
                        "parameter passing for argument of type "
-                       "%qT changed in GCC 9.1", type);
+                       "%qT changed in GCC 9.1", arg.type);
            }
        }
     }
index 783befff93872949d990073feb866b214b536624..7dd0a24fb21a188a1ffb7b8172eccc1905377d7a 100644 (file)
@@ -540,7 +540,7 @@ expand_epilogue_reg_restore (rtx spreg, bool saveall, bool is_inthandler)
 
    CUM is as above.
 
-   MODE and TYPE are the mode and type of the current parameter.
+   ARG is the last named argument.
 
    PRETEND_SIZE is a variable that should be set to the amount of stack
    that must be pushed by the prolog to pretend that our caller pushed
@@ -559,8 +559,7 @@ expand_epilogue_reg_restore (rtx spreg, bool saveall, bool is_inthandler)
 
 static void
 setup_incoming_varargs (cumulative_args_t cum,
-                       machine_mode mode ATTRIBUTE_UNUSED,
-                       tree type ATTRIBUTE_UNUSED, int *pretend_size,
+                       const function_arg_info &, int *pretend_size,
                        int no_rtl)
 {
   rtx mem;
index e2a78de5302f234c88a78436ccfbda57ee67ec1d..0b2947e2319377463ef19d605238058fa27dd2fc 100644 (file)
@@ -108,8 +108,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_t, machine_mode,
-                                        tree type, int *, int);
+static void cris_setup_incoming_varargs (cumulative_args_t,
+                                        const function_arg_info &,
+                                        int *, int);
 
 static int cris_initial_frame_pointer_offset (void);
 
@@ -4021,8 +4022,7 @@ cris_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
 
 static void
 cris_setup_incoming_varargs (cumulative_args_t ca_v,
-                            machine_mode mode ATTRIBUTE_UNUSED,
-                            tree type ATTRIBUTE_UNUSED,
+                            const function_arg_info &,
                             int *pretend_arg_size,
                             int second_time)
 {
index 98789bcfcffab6135df37e53ef89444dfdd8d142..c85135406330b07e7885360e77e889d39683f3c1 100644 (file)
@@ -1937,8 +1937,7 @@ csky_arg_partial_bytes (cumulative_args_t pcum_v, const function_arg_info &arg)
 
 static void
 csky_setup_incoming_varargs (cumulative_args_t pcum_v,
-                            machine_mode mode,
-                            tree type,
+                            const function_arg_info &arg,
                             int *pretend_size,
                             int second_time ATTRIBUTE_UNUSED)
 {
@@ -1949,7 +1948,7 @@ csky_setup_incoming_varargs (cumulative_args_t pcum_v,
 
   cfun->machine->uses_anonymous_args = 1;
   local_cum = *pcum;
-  csky_function_arg_advance (local_cum_v, mode, type, true);
+  csky_function_arg_advance (local_cum_v, arg.mode, arg.type, arg.named);
   regs_to_push = CSKY_NPARM_REGS - local_cum;
   if (regs_to_push)
     *pretend_size  = regs_to_push * UNITS_PER_WORD;
index c98fc5269195b20f0af8da16c84f3647ec13485c..9dd1643ddf5fa4afd7457478cc6408c81692cdb2 100644 (file)
@@ -711,24 +711,25 @@ epiphany_function_arg_boundary (machine_mode mode, const_tree type)
 /* Do any needed setup for a variadic function.  For the EPIPHANY, we
    actually emit the code in epiphany_expand_prologue.
 
-   CUM has not been updated for the last named argument which has type TYPE
-   and mode MODE, and we rely on this fact.  */
+   CUM has not been updated for the last named argument (which is given
+   by ARG), and we rely on this fact.  */
 
 
 static void
-epiphany_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
-                                tree type, int *pretend_size, int no_rtl)
+epiphany_setup_incoming_varargs (cumulative_args_t cum,
+                                const function_arg_info &arg,
+                                int *pretend_size, int no_rtl)
 {
   int first_anon_arg;
   CUMULATIVE_ARGS next_cum;
   machine_function_t *mf = MACHINE_FUNCTION (cfun);
 
   /* All BLKmode values are passed by reference.  */
-  gcc_assert (mode != BLKmode);
+  gcc_assert (arg.mode != BLKmode);
 
   next_cum = *get_cumulative_args (cum);
-  next_cum
-    = ROUND_ADVANCE_CUM (next_cum, mode, type) + ROUND_ADVANCE_ARG (mode, type);
+  next_cum = (ROUND_ADVANCE_CUM (next_cum, arg.mode, arg.type)
+             + ROUND_ADVANCE_ARG (arg.mode, arg.type));
   first_anon_arg = next_cum;
 
   if (first_anon_arg < MAX_EPIPHANY_PARM_REGS && !no_rtl)
index 59728015f1426df735378edc0a03a2e1655a2200..d6c835130bbf48b65d2c17f3baa87c73eed8bf63 100644 (file)
@@ -113,8 +113,9 @@ static struct fr30_frame_info       current_frame_info;
 /* Zero structure to initialize current_frame_info.  */
 static struct fr30_frame_info  zero_frame_info;
 
-static void fr30_setup_incoming_varargs (cumulative_args_t, machine_mode,
-                                        tree, int *, int);
+static void fr30_setup_incoming_varargs (cumulative_args_t,
+                                        const function_arg_info &,
+                                        int *, int);
 static bool fr30_must_pass_in_stack (machine_mode, const_tree);
 static int fr30_arg_partial_bytes (cumulative_args_t,
                                   const function_arg_info &);
@@ -459,12 +460,11 @@ fr30_expand_epilogue (void)
    named argument, from registers into memory.  * copying actually done in
    fr30_expand_prologue().
 
-   ARG_REGS_USED_SO_FAR has *not* been updated for the last named argument
-   which has type TYPE and mode MODE, and we rely on this fact.  */
+   CUM has not been updated for the last named argument which has type TYPE
+   and mode MODE, and we rely on this fact.  */
 void
 fr30_setup_incoming_varargs (cumulative_args_t arg_regs_used_so_far_v,
-                            machine_mode mode,
-                            tree type ATTRIBUTE_UNUSED,
+                            const function_arg_info &arg,
                             int *pretend_size,
                             int second_time ATTRIBUTE_UNUSED)
 {
@@ -473,7 +473,7 @@ fr30_setup_incoming_varargs (cumulative_args_t arg_regs_used_so_far_v,
   int size;
 
   /* All BLKmode values are passed by reference.  */
-  gcc_assert (mode != BLKmode);
+  gcc_assert (arg.mode != BLKmode);
 
   /* ??? This run-time test as well as the code inside the if
      statement is probably unnecessary.  */
@@ -481,7 +481,7 @@ fr30_setup_incoming_varargs (cumulative_args_t arg_regs_used_so_far_v,
     /* If TARGET_STRICT_ARGUMENT_NAMING returns true, then the last named
        arg must not be treated as an anonymous arg.  */
     /* ??? This is a pointer increment, which makes no sense.  */
-    arg_regs_used_so_far += fr30_num_arg_regs (mode, type);
+    arg_regs_used_so_far += fr30_num_arg_regs (arg.mode, arg.type);
 
   size = FR30_NUM_ARG_REGS - (* arg_regs_used_so_far);
 
index 4560fc6f9ca2e8882338c27da86dff858dbe7e75..5e06cf691f33ad83e395e7feaeee071c58482d4c 100644 (file)
@@ -359,8 +359,8 @@ static bool frv_in_small_data_p                     (const_tree);
 static void frv_asm_output_mi_thunk
   (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
 static void frv_setup_incoming_varargs         (cumulative_args_t,
-                                                machine_mode,
-                                                tree, int *, int);
+                                                const function_arg_info &,
+                                                int *, int);
 static rtx frv_expand_builtin_saveregs         (void);
 static void frv_expand_builtin_va_start                (tree, rtx);
 static bool frv_rtx_costs                      (rtx, machine_mode, int, int,
@@ -2109,17 +2109,16 @@ frv_initial_elimination_offset (int from, int to)
 
 static void
 frv_setup_incoming_varargs (cumulative_args_t cum_v,
-                            machine_mode mode,
-                            tree type ATTRIBUTE_UNUSED,
-                            int *pretend_size,
-                            int second_time)
+                           const function_arg_info &arg,
+                           int *pretend_size,
+                           int second_time)
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
 
   if (TARGET_DEBUG_ARG)
     fprintf (stderr,
             "setup_vararg: words = %2d, mode = %4s, pretend_size = %d, second_time = %d\n",
-            *cum, GET_MODE_NAME (mode), *pretend_size, second_time);
+            *cum, GET_MODE_NAME (arg.mode), *pretend_size, second_time);
 }
 
 \f
index d5b66df4a5698c8fbdfae7fc29c87229dca03d65..ee073c8c9fdde29e068514016694780b895856bf 100644 (file)
@@ -630,13 +630,12 @@ ft32_initial_elimination_offset (int from, int to)
 
 static void
 ft32_setup_incoming_varargs (cumulative_args_t cum_v,
-                            machine_mode mode,
-                            tree type ATTRIBUTE_UNUSED,
+                            const function_arg_info &arg,
                             int *pretend_size, int no_rtl ATTRIBUTE_UNUSED)
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
   int named_size =
-    GET_MODE_SIZE (SImode) * (*cum - FT32_R0) + GET_MODE_SIZE (mode);
+    GET_MODE_SIZE (SImode) * (*cum - FT32_R0) + GET_MODE_SIZE (arg.mode);
 
   if (named_size < 24)
     *pretend_size = 24 - named_size;
index 02a551cbc383cb420f8486e98a494ec60cd89240..67959c1e34e400cb34927c44be8aa0842fbddc0e 100644 (file)
@@ -4096,8 +4096,9 @@ setup_incoming_varargs_ms_64 (CUMULATIVE_ARGS *cum)
 }
 
 static void
-ix86_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode,
-                            tree type, int *, int no_rtl)
+ix86_setup_incoming_varargs (cumulative_args_t cum_v,
+                            const function_arg_info &arg,
+                            int *, int no_rtl)
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
   CUMULATIVE_ARGS next_cum;
@@ -4116,8 +4117,8 @@ ix86_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode,
      For stdargs, we do want to skip the last named argument.  */
   next_cum = *cum;
   if (stdarg_p (fntype))
-    ix86_function_arg_advance (pack_cumulative_args (&next_cum), mode, type,
-                              true);
+    ix86_function_arg_advance (pack_cumulative_args (&next_cum),
+                              arg.mode, arg.type, arg.named);
 
   if (cum->call_abi == MS_ABI)
     setup_incoming_varargs_ms_64 (&next_cum);
index 13dd71575e42c7da9b13b595fa285dc50634e45c..3bd20687e525893f265e6562151196be68da2db6 100644 (file)
@@ -199,8 +199,9 @@ static rtx gen_fr_restore_x (rtx, rtx, rtx);
 static void ia64_option_override (void);
 static bool ia64_can_eliminate (const int, const int);
 static machine_mode hfa_element_mode (const_tree, bool);
-static void ia64_setup_incoming_varargs (cumulative_args_t, machine_mode,
-                                        tree, int *, int);
+static void ia64_setup_incoming_varargs (cumulative_args_t,
+                                        const function_arg_info &,
+                                        int *, int);
 static int ia64_arg_partial_bytes (cumulative_args_t,
                                   const function_arg_info &);
 static rtx ia64_function_arg_1 (cumulative_args_t, machine_mode,
@@ -4585,19 +4586,21 @@ ia64_trampoline_init (rtx m_tramp, tree fndecl, rtx static_chain)
 }
 \f
 /* Do any needed setup for a variadic function.  CUM has not been updated
-   for the last named argument which has type TYPE and mode MODE.
+   for the last named argument, which is given by ARG.
 
    We generate the actual spill instructions during prologue generation.  */
 
 static void
-ia64_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
-                            tree type, int * pretend_size,
+ia64_setup_incoming_varargs (cumulative_args_t cum,
+                            const function_arg_info &arg,
+                            int *pretend_size,
                             int second_time ATTRIBUTE_UNUSED)
 {
   CUMULATIVE_ARGS next_cum = *get_cumulative_args (cum);
 
   /* Skip the current argument.  */
-  ia64_function_arg_advance (pack_cumulative_args (&next_cum), mode, type, 1);
+  ia64_function_arg_advance (pack_cumulative_args (&next_cum),
+                            arg.mode, arg.type, arg.named);
 
   if (next_cum.words < MAX_ARGUMENT_SLOTS)
     {
index db54423322333fafe071daba6e2caed7c3924b5f..ec615df27347e531798fecc50f1dfcd0d7dba48e 100644 (file)
@@ -152,8 +152,8 @@ static void iq2000_init_builtins      (void);
 static rtx  iq2000_expand_builtin     (tree, rtx, rtx, machine_mode, int);
 static bool iq2000_return_in_memory   (const_tree, const_tree);
 static void iq2000_setup_incoming_varargs (cumulative_args_t,
-                                          machine_mode, tree, int *,
-                                          int);
+                                          const function_arg_info &,
+                                          int *, int);
 static bool iq2000_rtx_costs          (rtx, machine_mode, int, int, int *, bool);
 static int  iq2000_address_cost       (rtx, machine_mode, addr_space_t,
                                       bool);
@@ -2894,9 +2894,8 @@ iq2000_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
 
 static void
 iq2000_setup_incoming_varargs (cumulative_args_t cum_v,
-                              machine_mode mode ATTRIBUTE_UNUSED,
-                              tree type ATTRIBUTE_UNUSED, int * pretend_size,
-                              int no_rtl)
+                              const function_arg_info &,
+                              int *pretend_size, int no_rtl)
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
   unsigned int iq2000_off = ! cum->last_arg_fp; 
index 7ed9ac00f08fe4d00a0bdf1b864f5ec38ca90f6f..c9d863d62f19e4dbe941e6eb52869f5b8a491748 100644 (file)
@@ -64,7 +64,7 @@ static void expand_save_restore (struct lm32_frame_info *info, int op);
 static void stack_adjust (HOST_WIDE_INT amount);
 static bool lm32_in_small_data_p (const_tree);
 static void lm32_setup_incoming_varargs (cumulative_args_t cum,
-                                        machine_mode mode, tree type,
+                                        const function_arg_info &,
                                         int *pretend_size, int no_rtl);
 static bool lm32_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno,
                            int *total, bool speed);
@@ -684,8 +684,9 @@ lm32_compute_initial_elimination_offset (int from, int to)
 }
 
 static void
-lm32_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode,
-                            tree type, int *pretend_size, int no_rtl)
+lm32_setup_incoming_varargs (cumulative_args_t cum_v,
+                            const function_arg_info &arg,
+                            int *pretend_size, int no_rtl)
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
   int first_anon_arg;
@@ -702,12 +703,7 @@ lm32_setup_incoming_varargs (cumulative_args_t cum_v, machine_mode mode,
          registers, if any used in passing this named paramter in
          order to determine which is the first registers used to pass
          anonymous arguments.  */
-      int size;
-
-      if (mode == BLKmode)
-       size = int_size_in_bytes (type);
-      else
-       size = GET_MODE_SIZE (mode);
+      int size = arg.promoted_size_in_bytes ();
 
       first_anon_arg =
        *cum + LM32_FIRST_ARG_REG +
index 7ee4fed84ef45d0e67d72e3036a64bc40c47d15f..01bbec9ca0c565337ffdddbe254408d5b9f19a77 100644 (file)
@@ -86,8 +86,9 @@ static bool m32r_return_in_memory (const_tree, const_tree);
 static rtx m32r_function_value (const_tree, const_tree, bool);
 static rtx m32r_libcall_value (machine_mode, const_rtx);
 static bool m32r_function_value_regno_p (const unsigned int);
-static void m32r_setup_incoming_varargs (cumulative_args_t, machine_mode,
-                                        tree, int *, int);
+static void m32r_setup_incoming_varargs (cumulative_args_t,
+                                        const function_arg_info &,
+                                        int *, int);
 static void init_idents (void);
 static bool m32r_rtx_costs (rtx, machine_mode, int, int, int *, bool speed);
 static int m32r_memory_move_cost (machine_mode, reg_class_t, bool);
@@ -1280,12 +1281,13 @@ m32r_function_value_regno_p (const unsigned int regno)
    create a register parameter block, and then copy any anonymous arguments
    in registers to memory.
 
-   CUM has not been updated for the last named argument which has type TYPE
-   and mode MODE, and we rely on this fact.  */
+   CUM has not been updated for the last named argument (which is given
+   by ARG), and we rely on this fact.  */
 
 static void
-m32r_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
-                            tree type, int *pretend_size, int no_rtl)
+m32r_setup_incoming_varargs (cumulative_args_t cum,
+                            const function_arg_info &arg,
+                            int *pretend_size, int no_rtl)
 {
   int first_anon_arg;
 
@@ -1293,10 +1295,11 @@ m32r_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
     return;
 
   /* All BLKmode values are passed by reference.  */
-  gcc_assert (mode != BLKmode);
+  gcc_assert (arg.mode != BLKmode);
 
-  first_anon_arg = (ROUND_ADVANCE_CUM (*get_cumulative_args (cum), mode, type)
-                   + ROUND_ADVANCE_ARG (mode, type));
+  first_anon_arg = (ROUND_ADVANCE_CUM (*get_cumulative_args (cum),
+                                      arg.mode, arg.type)
+                   + ROUND_ADVANCE_ARG (arg.mode, arg.type));
 
   if (first_anon_arg < M32R_MAX_PARM_REGS)
     {
index d93c818f3819795b81eb20538b155b8a90fc23f3..98f01117d501f27e6db314a624ed4ab7307c8b67 100644 (file)
@@ -99,7 +99,9 @@ static int        calc_live_regs                (int *);
 static int        try_constant_tricks           (HOST_WIDE_INT, HOST_WIDE_INT *, HOST_WIDE_INT *);
 static const char *     output_inline_const     (machine_mode, rtx *);
 static void       layout_mcore_frame            (struct mcore_frame *);
-static void       mcore_setup_incoming_varargs (cumulative_args_t, machine_mode, tree, int *, int);
+static void       mcore_setup_incoming_varargs (cumulative_args_t,
+                                                const function_arg_info &,
+                                                int *, int);
 static cond_type  is_cond_candidate             (rtx);
 static rtx_insn  *emit_new_cond_insn            (rtx_insn *, int);
 static rtx_insn  *conditionalize_block          (rtx_insn *);
@@ -1942,7 +1944,7 @@ mcore_initial_elimination_offset (int from, int to)
 
 static void
 mcore_setup_incoming_varargs (cumulative_args_t args_so_far_v,
-                             machine_mode mode, tree type,
+                             const function_arg_info &arg,
                              int * ptr_pretend_size ATTRIBUTE_UNUSED,
                              int second_time ATTRIBUTE_UNUSED)
 {
@@ -1953,7 +1955,8 @@ mcore_setup_incoming_varargs (cumulative_args_t args_so_far_v,
   /* We need to know how many argument registers are used before
      the varargs start, so that we can push the remaining argument
      registers during the prologue.  */
-  number_of_regs_before_varargs = *args_so_far + mcore_num_arg_regs (mode, type);
+  number_of_regs_before_varargs
+    = *args_so_far + mcore_num_arg_regs (arg.mode, arg.type);
   
   /* There is a bug somewhere in the arg handling code.
      Until I can find it this workaround always pushes the
index 8a8adb9a3540c0f0ccef2d2de43ebd42b2395717..1427e99c7aacf5a07dbdaaa6f5cdb56e93af51eb 100644 (file)
@@ -6544,9 +6544,9 @@ mips_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED)
 /* Implement TARGET_SETUP_INCOMING_VARARGS.  */
 
 static void
-mips_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
-                            tree type, int *pretend_size ATTRIBUTE_UNUSED,
-                            int no_rtl)
+mips_setup_incoming_varargs (cumulative_args_t cum,
+                            const function_arg_info &arg,
+                            int *pretend_size ATTRIBUTE_UNUSED, int no_rtl)
 {
   CUMULATIVE_ARGS local_cum;
   int gp_saved, fp_saved;
@@ -6555,8 +6555,8 @@ mips_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
      argument.  Advance a local copy of CUM past the last "real" named
      argument, to find out how many registers are left over.  */
   local_cum = *get_cumulative_args (cum);
-  mips_function_arg_advance (pack_cumulative_args (&local_cum), mode, type,
-                            true);
+  mips_function_arg_advance (pack_cumulative_args (&local_cum),
+                            arg.mode, arg.type, arg.named);
 
   /* Found out how many registers we need to save.  */
   gp_saved = MAX_ARGS_IN_REGISTERS - local_cum.num_gprs;
index 1b3a60916165f253b9ea2e9c58ffbd8f6b1b7fd7..cb70a2dbd40e5f1f57d6622cee037113ff7d286a 100644 (file)
@@ -138,7 +138,7 @@ static void mmix_reorg (void);
 static void mmix_asm_output_mi_thunk
   (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
 static void mmix_setup_incoming_varargs
-  (cumulative_args_t, machine_mode, tree, int *, int);
+  (cumulative_args_t, const function_arg_info &, int *, int);
 static void mmix_file_start (void);
 static void mmix_file_end (void);
 static void mmix_init_libfuncs (void);
@@ -960,8 +960,7 @@ mmix_function_profiler (FILE *stream ATTRIBUTE_UNUSED,
 
 static void
 mmix_setup_incoming_varargs (cumulative_args_t args_so_farp_v,
-                            machine_mode mode,
-                            tree vartype,
+                            const function_arg_info &arg,
                             int *pretend_sizep,
                             int second_time ATTRIBUTE_UNUSED)
 {
@@ -974,7 +973,7 @@ mmix_setup_incoming_varargs (cumulative_args_t args_so_farp_v,
 
   /* We assume that one argument takes up one register here.  That should
      be true until we start messing with multi-reg parameters.  */
-  if ((7 + (MMIX_FUNCTION_ARG_SIZE (mode, vartype))) / 8 != 1)
+  if ((7 + (MMIX_FUNCTION_ARG_SIZE (arg.mode, arg.type))) / 8 != 1)
     internal_error ("MMIX Internal: Last named vararg would not fit in a register");
 }
 
index e8eaedf2b98eccf0d2f670c1979430f67dc2fdba..a8e1bf23c4499c86084b3a8048140333c9aba7e4 100644 (file)
@@ -385,8 +385,7 @@ moxie_initial_elimination_offset (int from, int to)
 
 static void
 moxie_setup_incoming_varargs (cumulative_args_t cum_v,
-                             machine_mode mode ATTRIBUTE_UNUSED,
-                             tree type ATTRIBUTE_UNUSED,
+                             const function_arg_info &,
                              int *pretend_size, int no_rtl)
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
index c92a598dc5e456d7a225cda512dc875ba4e19da0..b076aa4a667a1a0c56c094adf1f01dc4b9d33884 100644 (file)
@@ -2345,8 +2345,7 @@ nds32_warn_func_return (tree decl)
 
 static void
 nds32_setup_incoming_varargs (cumulative_args_t ca,
-                             machine_mode mode,
-                             tree type,
+                             const function_arg_info &arg,
                              int *pretend_args_size,
                              int second_time ATTRIBUTE_UNUSED)
 {
@@ -2370,14 +2369,14 @@ nds32_setup_incoming_varargs (cumulative_args_t ca,
 
   cum = get_cumulative_args (ca);
 
-  /* The MODE and TYPE describe the last argument.
+  /* ARG describes the last argument.
      We need those information to determine the remaining registers
      for varargs.  */
   total_args_regs
     = NDS32_MAX_GPR_REGS_FOR_ARGS + NDS32_GPR_ARG_FIRST_REGNUM;
   num_of_used_regs
-    = NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, mode, type)
-      + NDS32_NEED_N_REGS_FOR_ARG (mode, type);
+    = NDS32_AVAILABLE_REGNUM_FOR_GPR_ARG (cum->gpr_offset, arg.mode, arg.type)
+      + NDS32_NEED_N_REGS_FOR_ARG (arg.mode, arg.type);
 
   remaining_reg_count = total_args_regs - num_of_used_regs;
   *pretend_args_size = remaining_reg_count * UNITS_PER_WORD;
index 1e04cf96f2769301e231b4df1562e4917df289da..b93274a12a7bea297fb350ffb720f4a5e59486cb 100644 (file)
@@ -3516,8 +3516,8 @@ nios2_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
    own va_arg type.  */
 static void
 nios2_setup_incoming_varargs (cumulative_args_t cum_v,
-                              machine_mode mode, tree type,
-                              int *pretend_size, int second_time)
+                             const function_arg_info &arg,
+                             int *pretend_size, int second_time)
 {
   CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); 
   CUMULATIVE_ARGS local_cum;
@@ -3527,7 +3527,7 @@ nios2_setup_incoming_varargs (cumulative_args_t cum_v,
 
   cfun->machine->uses_anonymous_args = 1;
   local_cum = *cum;
-  nios2_function_arg_advance (local_cum_v, mode, type, true);
+  nios2_function_arg_advance (local_cum_v, arg.mode, arg.type, arg.named);
 
   regs_to_push = NUM_ARG_REGS - local_cum.regs_used;
 
index 659e3ed8587a2a6f957ec6bcf0e6e0ea73be058b..47d9001187c2674b930f560781b0448879a9de21 100644 (file)
@@ -2854,9 +2854,9 @@ riscv_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED)
 /* Implement TARGET_SETUP_INCOMING_VARARGS.  */
 
 static void
-riscv_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
-                            tree type, int *pretend_size ATTRIBUTE_UNUSED,
-                            int no_rtl)
+riscv_setup_incoming_varargs (cumulative_args_t cum,
+                             const function_arg_info &arg,
+                             int *pretend_size ATTRIBUTE_UNUSED, int no_rtl)
 {
   CUMULATIVE_ARGS local_cum;
   int gp_saved;
@@ -2865,7 +2865,8 @@ riscv_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
      argument.  Advance a local copy of CUM past the last "real" named
      argument, to find out how many registers are left over.  */
   local_cum = *get_cumulative_args (cum);
-  riscv_function_arg_advance (pack_cumulative_args (&local_cum), mode, type, 1);
+  riscv_function_arg_advance (pack_cumulative_args (&local_cum),
+                             arg.mode, arg.type, arg.named);
 
   /* Found out how many registers we need to save.  */
   gp_saved = MAX_ARGS_IN_REGISTERS - local_cum.num_gprs;
index 4f006aa511d0deed4da174b853ecbd676fe3341d..874d525c73d2623dc446297f7c74e0dc836d7c07 100644 (file)
@@ -2365,7 +2365,7 @@ rs6000_move_block_from_reg (int regno, rtx x, int nregs)
 
    CUM is as above.
 
-   MODE and TYPE are the mode and type of the current parameter.
+   ARG is the last named argument.
 
    PRETEND_SIZE is a variable that should be set to the amount of stack
    that must be pushed by the prolog to pretend that our caller pushed
@@ -2375,9 +2375,9 @@ rs6000_move_block_from_reg (int regno, rtx x, int nregs)
    stack and set PRETEND_SIZE to the length of the registers pushed.  */
 
 void
-setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
-                       tree type, int *pretend_size ATTRIBUTE_UNUSED,
-                       int no_rtl)
+setup_incoming_varargs (cumulative_args_t cum,
+                       const function_arg_info &arg,
+                       int *pretend_size ATTRIBUTE_UNUSED, int no_rtl)
 {
   CUMULATIVE_ARGS next_cum;
   int reg_size = TARGET_32BIT ? 4 : 8;
@@ -2387,7 +2387,7 @@ setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
 
   /* Skip the last named argument.  */
   next_cum = *get_cumulative_args (cum);
-  rs6000_function_arg_advance_1 (&next_cum, mode, type, true, 0);
+  rs6000_function_arg_advance_1 (&next_cum, arg.mode, arg.type, arg.named, 0);
 
   if (DEFAULT_ABI == ABI_V4)
     {
@@ -2461,8 +2461,8 @@ setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
       first_reg_offset = next_cum.words;
       save_area = crtl->args.internal_arg_pointer;
 
-      if (targetm.calls.must_pass_in_stack (mode, type))
-       first_reg_offset += rs6000_arg_size (TYPE_MODE (type), type);
+      if (targetm.calls.must_pass_in_stack (arg.mode, arg.type))
+       first_reg_offset += rs6000_arg_size (TYPE_MODE (arg.type), arg.type);
     }
 
   set = get_varargs_alias_set ();
index 96017825f6a64385d925e1c311260d26a5d76430..45a6a7a5e3da52988e79fb946da380ebf89e9f6b 100644 (file)
@@ -152,9 +152,8 @@ extern bool rs6000_return_in_memory (const_tree type,
 extern bool rs6000_return_in_msb (const_tree valtype);
 extern bool rs6000_pass_by_reference (cumulative_args_t,
                                      const function_arg_info &);
-extern void setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
-                                   tree type, int *pretend_size ATTRIBUTE_UNUSED,
-                                   int no_rtl);
+extern void setup_incoming_varargs (cumulative_args_t,
+                                   const function_arg_info &, int *, int);
 extern unsigned int rs6000_function_arg_boundary (machine_mode mode,
                                                  const_tree type);
 extern bool rs6000_must_pass_in_stack (machine_mode mode, const_tree type);
index e84a3ddc0fcf31da7cc2dbc4f2c015a17296dbc0..bcd82cb75989474356485f8b63a1871d1cb3b6fa 100644 (file)
@@ -280,8 +280,8 @@ static bool sh_function_value_regno_p (const unsigned int);
 static rtx sh_libcall_value (machine_mode, const_rtx);
 static bool sh_return_in_memory (const_tree, const_tree);
 static rtx sh_builtin_saveregs (void);
-static void sh_setup_incoming_varargs (cumulative_args_t, machine_mode,
-                                      tree, int *, int);
+static void sh_setup_incoming_varargs (cumulative_args_t,
+                                      const function_arg_info &, int *, int);
 static bool sh_strict_argument_naming (cumulative_args_t);
 static bool sh_pretend_outgoing_varargs_named (cumulative_args_t);
 static void sh_atomic_assign_expand_fenv (tree *, tree *, tree *);
@@ -8184,8 +8184,7 @@ sh_return_in_memory (const_tree type, const_tree fndecl)
    function that tell if a function uses varargs or stdarg.  */
 static void
 sh_setup_incoming_varargs (cumulative_args_t ca,
-                          machine_mode mode,
-                          tree type,
+                          const function_arg_info &arg,
                           int *pretend_arg_size,
                           int second_time ATTRIBUTE_UNUSED)
 {
@@ -8194,10 +8193,9 @@ sh_setup_incoming_varargs (cumulative_args_t ca,
     {
       int named_parm_regs, anon_parm_regs;
 
-      named_parm_regs = (sh_round_reg (*get_cumulative_args (ca), mode)
-                        + (mode == BLKmode
-                           ? CEIL (int_size_in_bytes (type), UNITS_PER_WORD)
-                           : CEIL (GET_MODE_SIZE (mode), UNITS_PER_WORD)));
+      named_parm_regs = (sh_round_reg (*get_cumulative_args (ca), arg.mode)
+                        + CEIL (arg.promoted_size_in_bytes (),
+                                UNITS_PER_WORD));
       anon_parm_regs = NPARM_REGS (SImode) - named_parm_regs;
       if (anon_parm_regs > 0)
        *pretend_arg_size = anon_parm_regs * 4;
index 43a25c4df122de671d72fd6765f2e9712351cc5c..92dd556b3468a0b04fd15447b70d9690280fd047 100644 (file)
@@ -4089,8 +4089,9 @@ spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p,
    in the stack then save no registers.  Set pretend_args_size to the
    amount of space needed to save the registers. */
 static void
-spu_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
-                           tree type, int *pretend_size, int no_rtl)
+spu_setup_incoming_varargs (cumulative_args_t cum,
+                           const function_arg_info &arg,
+                           int *pretend_size, int no_rtl)
 {
   if (!no_rtl)
     {
@@ -4101,7 +4102,8 @@ spu_setup_incoming_varargs (cumulative_args_t cum, machine_mode mode,
 
       /* cum currently points to the last named argument, we want to
          start at the next argument. */
-      spu_function_arg_advance (pack_cumulative_args (&ncum), mode, type, true);
+      spu_function_arg_advance (pack_cumulative_args (&ncum),
+                               arg.mode, arg.type, arg.named);
 
       offset = -STACK_POINTER_OFFSET;
       for (regno = ncum; regno < MAX_REGISTER_ARGS; regno++)
index f800e9e4642620c6d4a3ffd6edaf991beec45142..6f33482548c23ea2f71dbf7c44e9dd0afced2db1 100644 (file)
@@ -390,8 +390,8 @@ tilegx_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
 /* Implement TARGET_SETUP_INCOMING_VARARGS.  */
 static void
 tilegx_setup_incoming_varargs (cumulative_args_t cum,
-                              machine_mode mode,
-                              tree type, int *pretend_args, int no_rtl)
+                              const function_arg_info &arg,
+                              int *pretend_args, int no_rtl)
 {
   CUMULATIVE_ARGS local_cum = *get_cumulative_args (cum);
   int first_reg;
@@ -400,7 +400,7 @@ tilegx_setup_incoming_varargs (cumulative_args_t cum,
      argument.  Advance a local copy of CUM past the last "real" named
      argument, to find out how many registers are left over.  */
   targetm.calls.function_arg_advance (pack_cumulative_args (&local_cum),
-                                     mode, type, true);
+                                     arg.mode, arg.type, arg.named);
   first_reg = local_cum;
 
   if (local_cum < TILEGX_NUM_ARG_REGS)
index 483a897a6d896f019f6f9bd0d9733e1a7b97db49..dd537712a5051027a5040b4f12c22c0cca4d83cb 100644 (file)
@@ -342,8 +342,8 @@ tilepro_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
 /* Implement TARGET_SETUP_INCOMING_VARARGS.  */
 static void
 tilepro_setup_incoming_varargs (cumulative_args_t cum,
-                               machine_mode mode,
-                               tree type, int *pretend_args, int no_rtl)
+                               const function_arg_info &arg,
+                               int *pretend_args, int no_rtl)
 {
   CUMULATIVE_ARGS local_cum = *get_cumulative_args (cum);
   int first_reg;
@@ -352,7 +352,7 @@ tilepro_setup_incoming_varargs (cumulative_args_t cum,
      argument.  Advance a local copy of CUM past the last "real" named
      argument, to find out how many registers are left over.  */
   targetm.calls.function_arg_advance (pack_cumulative_args (&local_cum),
-                                     mode, type, true);
+                                     arg.mode, arg.type, arg.named);
   first_reg = local_cum;
 
   if (local_cum < TILEPRO_NUM_ARG_REGS)
index 456bba200010420ef0456e2a2f3a1a4b850c9f6a..2dd261a5d73d6bd867351a86cc0a29a9401695ee 100644 (file)
@@ -175,8 +175,8 @@ static rtx visium_function_value (const_tree, const_tree fn_decl_or_type,
 static rtx visium_libcall_value (machine_mode, const_rtx);
 
 static void visium_setup_incoming_varargs (cumulative_args_t,
-                                          machine_mode,
-                                          tree, int *, int);
+                                          const function_arg_info &,
+                                          int *, int);
 
 static void visium_va_start (tree valist, rtx nextarg);
 
@@ -1460,8 +1460,7 @@ visium_libcall_value (machine_mode mode, const_rtx fun ATTRIBUTE_UNUSED)
 
 static void
 visium_setup_incoming_varargs (cumulative_args_t pcum_v,
-                              machine_mode mode,
-                              tree type,
+                              const function_arg_info &arg,
                               int *pretend_size ATTRIBUTE_UNUSED,
                               int no_rtl)
 {
@@ -1487,7 +1486,8 @@ visium_setup_incoming_varargs (cumulative_args_t pcum_v,
   /* The caller has advanced ARGS_SO_FAR up to, but not beyond, the last named
      argument.  Advance a local copy of ARGS_SO_FAR past the last "real" named
      argument, to find out how many registers are left over.  */
-  TARGET_FUNCTION_ARG_ADVANCE (local_args_so_far, mode, type, 1);
+  TARGET_FUNCTION_ARG_ADVANCE (local_args_so_far, arg.mode,
+                              arg.type, arg.named);
 
   /* Find how many registers we need to save.  */
   locargs = get_cumulative_args (local_args_so_far);
index 1a82bcc99b954d49455f92269ace29349075ac89..6beb578d3c991e8fe5846a5275a023599eb4dea8 100644 (file)
@@ -5202,7 +5202,7 @@ return value of this function should be an RTX that contains the value
 to use as the return of @code{__builtin_saveregs}.
 @end deftypefn
 
-@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARGS (cumulative_args_t @var{args_so_far}, machine_mode @var{mode}, tree @var{type}, int *@var{pretend_args_size}, int @var{second_time})
+@deftypefn {Target Hook} void TARGET_SETUP_INCOMING_VARARGS (cumulative_args_t @var{args_so_far}, const function_arg_info @var{&arg}, int *@var{pretend_args_size}, int @var{second_time})
 This target hook offers an alternative to using
 @code{__builtin_saveregs} and defining the hook
 @code{TARGET_EXPAND_BUILTIN_SAVEREGS}.  Use it to store the anonymous
@@ -5213,8 +5213,8 @@ pass all their arguments on the stack.
 
 The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data
 structure, containing the values that are obtained after processing the
-named arguments.  The arguments @var{mode} and @var{type} describe the
-last named argument---its machine mode and its data type as a tree node.
+named arguments.  The argument @var{arg} describes the last of these named
+arguments.
 
 The target hook should do two things: first, push onto the stack all the
 argument registers @emph{not} used for the named arguments, and second,
index 37223caee7659a8184e6bf8b189a99ad08df08af..ad61662943e43818e7b44e5c77fb7bea51247e4b 100644 (file)
@@ -2485,9 +2485,9 @@ assign_parms_setup_varargs (struct assign_parm_data_all *all,
 {
   int varargs_pretend_bytes = 0;
 
-  targetm.calls.setup_incoming_varargs (all->args_so_far,
-                                       data->promoted_mode,
-                                       data->passed_type,
+  function_arg_info last_named_arg (data->passed_type, data->promoted_mode,
+                                   /*named=*/true);
+  targetm.calls.setup_incoming_varargs (all->args_so_far, last_named_arg,
                                        &varargs_pretend_bytes, no_rtl);
 
   /* If the back-end has requested extra stack space, record how much is
index 9e798bc6e00c16ab2b738add32ab0269ec30145a..1756314981fe3273c3508cdc3759573007f2456a 100644 (file)
@@ -4486,8 +4486,8 @@ pass all their arguments on the stack.\n\
 \n\
 The argument @var{args_so_far} points to the @code{CUMULATIVE_ARGS} data\n\
 structure, containing the values that are obtained after processing the\n\
-named arguments.  The arguments @var{mode} and @var{type} describe the\n\
-last named argument---its machine mode and its data type as a tree node.\n\
+named arguments.  The argument @var{arg} describes the last of these named\n\
+arguments.\n\
 \n\
 The target hook should do two things: first, push onto the stack all the\n\
 argument registers @emph{not} used for the named arguments, and second,\n\
@@ -4507,7 +4507,7 @@ arguments of the function are being analyzed for the second time.  This\n\
 happens for an inline function, which is not actually compiled until the\n\
 end of the source file.  The hook @code{TARGET_SETUP_INCOMING_VARARGS} should\n\
 not generate any instructions in this case.",
- void, (cumulative_args_t args_so_far, machine_mode mode, tree type,
+ void, (cumulative_args_t args_so_far, const function_arg_info &arg,
        int *pretend_args_size, int second_time),
  default_setup_incoming_varargs)
 
index de144bf2f5bad1e7ae9f1bbc87e95861a8a0e3e3..854f2404faea23a715aabdc3e821b059da53b204 100644 (file)
@@ -193,11 +193,8 @@ default_expand_builtin_saveregs (void)
 }
 
 void
-default_setup_incoming_varargs (cumulative_args_t ca ATTRIBUTE_UNUSED,
-                               machine_mode mode ATTRIBUTE_UNUSED,
-                               tree type ATTRIBUTE_UNUSED,
-                               int *pretend_arg_size ATTRIBUTE_UNUSED,
-                               int second_time ATTRIBUTE_UNUSED)
+default_setup_incoming_varargs (cumulative_args_t,
+                               const function_arg_info &, int *, int)
 {
 }
 
index 2009f183c5fadaaa5d07b712c5f3f0403141f228..34bb3c0430de61422a57fd575109055a2347e19d 100644 (file)
@@ -40,7 +40,9 @@ extern machine_mode default_cc_modes_compatible (machine_mode,
 extern bool default_return_in_memory (const_tree, const_tree);
 
 extern rtx default_expand_builtin_saveregs (void);
-extern void default_setup_incoming_varargs (cumulative_args_t, machine_mode, tree, int *, int);
+extern void default_setup_incoming_varargs (cumulative_args_t,
+                                           const function_arg_info &,
+                                           int *, int);
 extern rtx default_builtin_setjmp_frame_value (void);
 extern bool default_pretend_outgoing_varargs_named (cumulative_args_t);