aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/iq2000
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-08-20 08:52:40 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-08-20 08:52:40 +0000
commit52090e4dbd064f486af606e3f8a283dbddc7c18a (patch)
treec854f18544d6d5f48e8e0d584200ea54f9da1bba /gcc/config/iq2000
parenta7c81bc1fb43366ca1b4332d8a6042b648a84cdc (diff)
downloadgcc-52090e4dbd064f486af606e3f8a283dbddc7c18a.zip
gcc-52090e4dbd064f486af606e3f8a283dbddc7c18a.tar.gz
gcc-52090e4dbd064f486af606e3f8a283dbddc7c18a.tar.bz2
Use function_arg_info for TARGET_PASS_BY_REFERENCE
The hook is passed the unpromoted type mode instead of the promoted mode. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * doc/tm.texi: Regenerate. * targhooks.h (hook_pass_by_reference_must_pass_in_stack): Update accordingly. (hook_bool_CUMULATIVE_ARGS_arg_info_false): Declare. * targhooks.c (hook_pass_by_reference_must_pass_in_stack): Take a function_arg_info instead of a mode, type and named flag. (hook_bool_CUMULATIVE_ARGS_arg_info_false): New function. * calls.h (pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * calls.c (pass_by_reference): Likewise. (pass_va_arg_by_reference): Update call accordingly. (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.c (assign_parm_find_data_types): Likewise. * var-tracking.c (prepare_call_arguments): Likewise. * stor-layout.c: Include calls.h. (compute_record_mode): Update call to targetm.calls.pass_by_reference. * config/aarch64/aarch64.c (aarch64_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/alpha/alpha.c (alpha_pass_by_reference): Likewise. * config/arc/arc.c (arc_pass_by_reference): Likewise. * config/arm/arm.c (arm_pass_by_reference): Likewise. * config/bfin/bfin.c (bfin_pass_by_reference): Likewise. * config/c6x/c6x.c (c6x_pass_by_reference): Likewise. (c6x_call_saved_register_used): Update call to pass_by_reference. * config/cris/cris.c (cris_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/epiphany/epiphany.c (epiphany_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. (epiphany_arg_partial_bytes): Update call accordingly. * config/ft32/ft32.c (ft32_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. (ft32_arg_partial_bytes): Update call accordingly. * config/i386/i386.c (ix86_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/iq2000/iq2000.c (iq2000_pass_by_reference): Likewise. * config/m32c/m32c.c (m32c_pass_by_reference): Likewise. * config/m32r/m32r.c (m32r_pass_by_reference): Likewise. (m32r_return_in_memory): Update call accordingly. * config/mips/mips.c (mips_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/mmix/mmix.c (mmix_pass_by_reference): Likewise. * config/mn10300/mn10300.c (mn10300_pass_by_reference): Likewise. * config/moxie/moxie.c (moxie_pass_by_reference): Likewise. (moxie_arg_partial_bytes): Update call accordingly. * config/msp430/msp430.c (msp430_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/nvptx/nvptx.c (nvptx_pass_by_reference): Likewise. * config/or1k/or1k.c (or1k_pass_by_reference): Likewise. * config/pa/pa.c (pa_pass_by_reference): Likewise. * config/riscv/riscv.c (riscv_pass_by_reference): Likewise. (riscv_return_in_memory): Update call accordingly. * config/rs6000/rs6000-internal.h (rs6000_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/rs6000/rs6000-call.c (rs6000_pass_by_reference): Likewise. (rs6000_parm_needs_stack): Update call to pass_by_reference. * config/s390/s390.c (s390_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. (s390_call_saved_register_used): Update call accordingly. * config/sh/sh.c (sh_pass_by_reference): Take a function_arg_info instead of a mode, type and named flag. * config/sparc/sparc.c (sparc_pass_by_reference): Likewise. * config/spu/spu.c (spu_pass_by_reference): Likewise. * config/tilegx/tilegx.c (tilegx_pass_by_reference): Likewise. * config/tilepro/tilepro.c (tilepro_pass_by_reference): Likewise. * config/v850/v850.c (v850_pass_by_reference): Likewise. * config/visium/visium.c (visium_pass_by_reference): Likewise. gcc/ada/ * gcc-interface/misc.c (default_pass_by_ref): Update call to pass_by_reference. From-SVN: r274698
Diffstat (limited to 'gcc/config/iq2000')
-rw-r--r--gcc/config/iq2000/iq2000.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 9652fa5..db54423 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -159,8 +159,8 @@ static int iq2000_address_cost (rtx, machine_mode, addr_space_t,
bool);
static section *iq2000_select_section (tree, int, unsigned HOST_WIDE_INT);
static rtx iq2000_legitimize_address (rtx, rtx, machine_mode);
-static bool iq2000_pass_by_reference (cumulative_args_t, machine_mode,
- const_tree, bool);
+static bool iq2000_pass_by_reference (cumulative_args_t,
+ const function_arg_info &);
static int iq2000_arg_partial_bytes (cumulative_args_t,
const function_arg_info &arg);
static rtx iq2000_function_arg (cumulative_args_t,
@@ -2292,8 +2292,8 @@ iq2000_function_value_regno_p (const unsigned int regno)
/* Return true when an argument must be passed by reference. */
static bool
-iq2000_pass_by_reference (cumulative_args_t cum_v, machine_mode mode,
- const_tree type, bool named ATTRIBUTE_UNUSED)
+iq2000_pass_by_reference (cumulative_args_t cum_v,
+ const function_arg_info &arg)
{
CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v);
int size;
@@ -2301,7 +2301,7 @@ iq2000_pass_by_reference (cumulative_args_t cum_v, machine_mode mode,
/* We must pass by reference if we would be both passing in registers
and the stack. This is because any subsequent partial arg would be
handled incorrectly in this case. */
- if (cum && targetm.calls.must_pass_in_stack (mode, type))
+ if (cum && targetm.calls.must_pass_in_stack (arg.mode, arg.type))
{
/* Don't pass the actual CUM to FUNCTION_ARG, because we would
get double copies of any offsets generated for small structs
@@ -2309,15 +2309,15 @@ iq2000_pass_by_reference (cumulative_args_t cum_v, machine_mode mode,
CUMULATIVE_ARGS temp;
temp = *cum;
- if (iq2000_function_arg (pack_cumulative_args (&temp), mode, type, named)
- != 0)
+ if (iq2000_function_arg (pack_cumulative_args (&temp), arg.mode,
+ arg.type, arg.named) != 0)
return 1;
}
- if (type == NULL_TREE || mode == DImode || mode == DFmode)
+ if (arg.type == NULL_TREE || arg.mode == DImode || arg.mode == DFmode)
return 0;
- size = int_size_in_bytes (type);
+ size = int_size_in_bytes (arg.type);
return size == -1 || size > UNITS_PER_WORD;
}