aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/ia64
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-08-20 08:53:14 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-08-20 08:53:14 +0000
commit6930c98c69ad695469ee7daa74b3b6d578afdd0d (patch)
tree1cca83289473f2f89ace7e832b1300419d87e88f /gcc/config/ia64
parent6783fdb7057d559aa1da8afa2c15a702c532a03e (diff)
downloadgcc-6930c98c69ad695469ee7daa74b3b6d578afdd0d.zip
gcc-6930c98c69ad695469ee7daa74b3b6d578afdd0d.tar.gz
gcc-6930c98c69ad695469ee7daa74b3b6d578afdd0d.tar.bz2
Use function_arg_info for TARGET_FUNCTION_ARG_ADVANCE
There seems to be a bit of confusion around this one. Almost all callers pass the same arguments as TARGET_FUNCTION_ARG, meaning that the mode is the promoted mode rather than the type mode. But the calls.c handling for normal typed arguments instead passes the unpromoted TYPE_MODE (despite passing the promoted mode to TARGET_FUNCTION_ARG). I've kept this behaviour with a ??? comment. (The calls.c handling of libgcc functions does pass the promoted mode though, as does the function.c handling of incoming arguments.) Also, a couple of the arm callers don't seem to be using the hook correctly. Again I kept the current choices and added a ??? comment. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * doc/tm.texi: Regenerate. * targhooks.h (default_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * targhooks.c (default_function_arg_advance): Likewise. * calls.c (initialize_argument_information): Update call to targetm.calls.function_arg_advance. (emit_library_call_value_1): Likewise. * dse.c (get_call_args): Likewise. * expr.c (block_move_libcall_safe_for_call_parm): Likewise. * function.c (assign_parms, gimplify_parameters): Likewise. * var-tracking.c (prepare_call_arguments): Likewise. * config/aarch64/aarch64.c (aarch64_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (aarch64_setup_incoming_varargs): Update call accordingly. * config/alpha/alpha.c (alpha_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (alpha_setup_incoming_varargs): Update call accordingly. * config/arc/arc.c (arc_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (arc_setup_incoming_varargs): Update call accordingly. * config/arm/arm.c (arm_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (cmse_func_args_or_return_in_stack): Update call accordingly. (arm_function_ok_for_sibcall): Likewise. (cmse_nonsecure_call_clear_caller_saved): Likewise. * config/avr/avr.c (avr_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/bfin/bfin.c (bfin_function_arg_advance): Likewise. * config/c6x/c6x.c (c6x_function_arg_advance): Likewise. (c6x_call_saved_register_used): Update call accordingly. * config/cr16/cr16.c (cr16_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/cris/cris.c (cris_function_arg_advance): Likewise. * config/csky/csky.c (csky_function_arg_advance): Likewise. (csky_setup_incoming_varargs): Update call accordingly. * config/epiphany/epiphany.c (epiphany_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/fr30/fr30.c (fr30_function_arg_advance): Likewise. * config/frv/frv.c (frv_function_arg_advance): Likewise. * config/ft32/ft32.c (ft32_function_arg_advance): Likewise. * config/gcn/gcn.c (gcn_function_arg_advance): Likewise. * config/h8300/h8300.c (h8300_function_arg_advance): Likewise. * config/i386/i386.c (ix86_function_arg_advance): Likewise. (ix86_setup_incoming_varargs): Update call accordingly. * config/ia64/ia64.c (ia64_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (ia64_setup_incoming_varargs): Update call accordingly. * config/iq2000/iq2000.c (iq2000_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (iq2000_expand_prologue): Update call accordingly. * config/lm32/lm32.c (lm32_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/m32c/m32c.c (m32c_function_arg_advance): Likewise. * config/m32r/m32r.c (m32r_function_arg_advance): Likewise. * config/m68k/m68k.c (m68k_function_arg_advance): Likewise. * config/mcore/mcore.c (mcore_function_arg_advance): Likewise. * config/microblaze/microblaze.c (microblaze_function_arg_advance): Likewise. (microblaze_expand_prologue): Update call accordingly. * config/mips/mips.c (mips_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (mips_setup_incoming_varargs): Update call accordingly. (mips_output_args_xfer): Likewise. * config/mmix/mmix.c (mmix_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/mn10300/mn10300.c (mn10300_function_arg_advance): Likewise. * config/moxie/moxie.c (moxie_function_arg_advance): Likewise. * config/msp430/msp430.c (msp430_function_arg_advance): Likewise. * config/nds32/nds32.c (nds32_function_arg_advance): Likewise. * config/nios2/nios2.c (nios2_function_arg_advance): Likewise. (nios2_setup_incoming_varargs): Update call accordingly. * config/nvptx/nvptx.c (nvptx_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/or1k/or1k.c (or1k_function_arg_advance): Likewise. * config/pa/pa.c (pa_function_arg_advance): Likewise. * config/pdp11/pdp11.c (pdp11_function_arg_advance): Likewise. * config/pru/pru.c (pru_function_arg_advance): Likewise. * config/riscv/riscv.c (riscv_function_arg_advance): Likewise. (riscv_setup_incoming_varargs): Update call accordingly. * config/rl78/rl78.c (rl78_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/rs6000/rs6000-internal.h (rs6000_function_arg_advance): Likewise. * config/rs6000/rs6000-call.c (rs6000_function_arg_advance): Likewise. (rs6000_parm_needs_stack): Update call accordingly. * config/rx/rx.c (rx_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/s390/s390.c (s390_function_arg_advance): Likewise. (s390_call_saved_register_used): Update call accordingly. * config/sh/sh.c (sh_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (sh_output_mi_thunk): Update call accordingly. * config/sparc/sparc.c (sparc_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/spu/spu.c (spu_function_arg_advance): Likewise. (spu_setup_incoming_varargs): Update call accordingly. * config/stormy16/stormy16.c (xstormy16_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/tilegx/tilegx.c (tilegx_function_arg_advance): Likewise. (tilegx_setup_incoming_varargs): Update call accordingly. * config/tilepro/tilepro.c (tilepro_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. (tilegx_setup_incoming_varargs): Update call accordingly. * config/v850/v850.c (v850_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. * config/vax/vax.c (vax_function_arg_advance): Likewise. * config/visium/visium.c (visium_function_arg_advance): Likewise. (visium_setup_incoming_varargs): Update call accordingly. * config/xtensa/xtensa.c (xtensa_function_arg_advance): Take a function_arg_info instead of a mode, type and named flag. From-SVN: r274701
Diffstat (limited to 'gcc/config/ia64')
-rw-r--r--gcc/config/ia64/ia64.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 0de27a3..bfec69b 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -207,8 +207,8 @@ static int ia64_arg_partial_bytes (cumulative_args_t,
static rtx ia64_function_arg (cumulative_args_t, const function_arg_info &);
static rtx ia64_function_incoming_arg (cumulative_args_t,
const function_arg_info &);
-static void ia64_function_arg_advance (cumulative_args_t, machine_mode,
- const_tree, bool);
+static void ia64_function_arg_advance (cumulative_args_t,
+ const function_arg_info &);
static pad_direction ia64_function_arg_padding (machine_mode, const_tree);
static unsigned int ia64_function_arg_boundary (machine_mode,
const_tree);
@@ -4596,8 +4596,7 @@ ia64_setup_incoming_varargs (cumulative_args_t cum,
CUMULATIVE_ARGS next_cum = *get_cumulative_args (cum);
/* Skip the current argument. */
- ia64_function_arg_advance (pack_cumulative_args (&next_cum),
- arg.mode, arg.type, arg.named);
+ ia64_function_arg_advance (pack_cumulative_args (&next_cum), arg);
if (next_cum.words < MAX_ARGUMENT_SLOTS)
{
@@ -4999,12 +4998,12 @@ ia64_arg_type (machine_mode mode)
ia64_function_arg. */
static void
-ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
- const_tree type, bool named)
+ia64_function_arg_advance (cumulative_args_t cum_v,
+ const function_arg_info &arg)
{
CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
- int words = ia64_function_arg_words (type, mode);
- int offset = ia64_function_arg_offset (cum, type, words);
+ int words = ia64_function_arg_words (arg.type, arg.mode);
+ int offset = ia64_function_arg_offset (cum, arg.type, words);
machine_mode hfa_mode = VOIDmode;
/* If all arg slots are already full, then there is nothing to do. */
@@ -5014,7 +5013,7 @@ ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
return;
}
- cum->atypes[cum->words] = ia64_arg_type (mode);
+ cum->atypes[cum->words] = ia64_arg_type (arg.mode);
cum->words += words + offset;
/* On OpenVMS argument is either in Rn or Fn. */
@@ -5026,12 +5025,12 @@ ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
}
/* Check for and handle homogeneous FP aggregates. */
- if (type)
- hfa_mode = hfa_element_mode (type, 0);
+ if (arg.type)
+ hfa_mode = hfa_element_mode (arg.type, 0);
/* Unnamed prototyped hfas are passed as usual. Named prototyped hfas
and unprototyped hfas are passed specially. */
- if (hfa_mode != VOIDmode && (! cum->prototype || named))
+ if (hfa_mode != VOIDmode && (! cum->prototype || arg.named))
{
int fp_regs = cum->fp_regs;
/* This is the original value of cum->words + offset. */
@@ -5050,8 +5049,7 @@ ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
/* Fill the FP regs. We do this always. We stop if we reach the end
of the argument, the last FP register, or the last argument slot. */
- byte_size = ((mode == BLKmode)
- ? int_size_in_bytes (type) : GET_MODE_SIZE (mode));
+ byte_size = arg.promoted_size_in_bytes ();
args_byte_size = int_regs * UNITS_PER_WORD;
offset = 0;
for (; (offset < byte_size && fp_regs < MAX_ARGUMENT_SLOTS
@@ -5068,26 +5066,29 @@ ia64_function_arg_advance (cumulative_args_t cum_v, machine_mode mode,
/* Integral and aggregates go in general registers. So do TFmode FP values.
If we have run out of FR registers, then other FP values must also go in
general registers. This can happen when we have a SFmode HFA. */
- else if (mode == TFmode || mode == TCmode
- || (! FLOAT_MODE_P (mode) || cum->fp_regs == MAX_ARGUMENT_SLOTS))
+ else if (arg.mode == TFmode || arg.mode == TCmode
+ || !FLOAT_MODE_P (arg.mode)
+ || cum->fp_regs == MAX_ARGUMENT_SLOTS)
cum->int_regs = cum->words;
/* If there is a prototype, then FP values go in a FR register when
named, and in a GR register when unnamed. */
else if (cum->prototype)
{
- if (! named)
+ if (! arg.named)
cum->int_regs = cum->words;
else
/* ??? Complex types should not reach here. */
- cum->fp_regs += (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT ? 2 : 1);
+ cum->fp_regs
+ += (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT ? 2 : 1);
}
/* If there is no prototype, then FP values go in both FR and GR
registers. */
else
{
/* ??? Complex types should not reach here. */
- cum->fp_regs += (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT ? 2 : 1);
+ cum->fp_regs
+ += (GET_MODE_CLASS (arg.mode) == MODE_COMPLEX_FLOAT ? 2 : 1);
cum->int_regs = cum->words;
}
}