aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sh
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-08-20 08:52:48 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-08-20 08:52:48 +0000
commite7056ca417326a70eca05defb6a8b20b737d3417 (patch)
treee330e61756c734f2502bd7e7aeb2ed3fd2e9baeb /gcc/config/sh
parent52090e4dbd064f486af606e3f8a283dbddc7c18a (diff)
downloadgcc-e7056ca417326a70eca05defb6a8b20b737d3417.zip
gcc-e7056ca417326a70eca05defb6a8b20b737d3417.tar.gz
gcc-e7056ca417326a70eca05defb6a8b20b737d3417.tar.bz2
Use function_arg_info for TARGET_SETUP_INCOMING_ARGS
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
Diffstat (limited to 'gcc/config/sh')
-rw-r--r--gcc/config/sh/sh.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index e84a3dd..bcd82cb 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -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;