aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-08-20 08:53:23 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-08-20 08:53:23 +0000
commit7256c7194e186fce6ff866a124a77b08196c2a5f (patch)
tree24b47c0624b9395db68addd8cb07d4e5b581050b /gcc/calls.c
parent6930c98c69ad695469ee7daa74b3b6d578afdd0d (diff)
downloadgcc-7256c7194e186fce6ff866a124a77b08196c2a5f.zip
gcc-7256c7194e186fce6ff866a124a77b08196c2a5f.tar.gz
gcc-7256c7194e186fce6ff866a124a77b08196c2a5f.tar.bz2
Use function_arg_info for TARGET_CALLEE_COPIES
The hook is passed the unpromoted type mode instead of the promoted mode. The aarch64 definition is redundant, but worth keeping for emphasis. 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * target.def (callee_copies): Take a function_arg_info instead of a mode, type and named flag. * doc/tm.texi: Regenerate. * targhooks.h (hook_callee_copies_named): Take a function_arg_info instead of a mode, type and named flag. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Delete. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_bool_CUMULATIVE_ARGS_arg_info_true): New function. * targhooks.c (hook_callee_copies_named): Take a function_arg_info instead of a mode, type and named flag. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false): Delete. (hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true): Likewise. (hook_bool_CUMULATIVE_ARGS_arg_info_true): New function. * calls.h (reference_callee_copied): Take a function_arg_info instead of a mode, type and named flag. * calls.c (reference_callee_copied): Likewise. (initialize_argument_information): Update call accordingly. (emit_library_call_value_1): Likewise. * function.c (gimplify_parameters): Likewise. * config/aarch64/aarch64.c (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_false instead of hook_bool_CUMULATIVE_ARGS_mode_tree_bool_false. * config/c6x/c6x.c (c6x_callee_copies): Delete. (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead. * config/epiphany/epiphany.c (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead of hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. * config/mips/mips.c (mips_callee_copies): Take a function_arg_info instead of a mode, type and named flag. * config/mmix/mmix.c (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead of hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. * config/mn10300/mn10300.c (TARGET_CALLEE_COPIES): Likewise. * config/msp430/msp430.c (msp430_callee_copies): Delete. (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead. * config/pa/pa.c (pa_callee_copies): Take a function_arg_info instead of a mode, type and named flag. * config/sh/sh.c (sh_callee_copies): Likewise. * config/v850/v850.c (TARGET_CALLEE_COPIES): Define to hook_bool_CUMULATIVE_ARGS_arg_info_true instead of hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true. From-SVN: r274702
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 69a3184..6be8acd 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -935,17 +935,15 @@ pass_va_arg_by_reference (tree type)
return pass_by_reference (NULL, function_arg_info (type, /*named=*/false));
}
-/* Return true if TYPE, which is passed by reference, should be callee
+/* Return true if ARG, which is passed by reference, should be callee
copied instead of caller copied. */
bool
-reference_callee_copied (CUMULATIVE_ARGS *ca, machine_mode mode,
- tree type, bool named_arg)
+reference_callee_copied (CUMULATIVE_ARGS *ca, const function_arg_info &arg)
{
- if (type && TREE_ADDRESSABLE (type))
+ if (arg.type && TREE_ADDRESSABLE (arg.type))
return false;
- return targetm.calls.callee_copies (pack_cumulative_args (ca), mode, type,
- named_arg);
+ return targetm.calls.callee_copies (pack_cumulative_args (ca), arg);
}
@@ -2002,9 +2000,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
bool callee_copies;
tree base = NULL_TREE;
- callee_copies
- = reference_callee_copied (args_so_far_pnt, TYPE_MODE (type),
- type, argpos < n_named_args);
+ callee_copies = reference_callee_copied (args_so_far_pnt, orig_arg);
/* If we're compiling a thunk, pass through invisible references
instead of making a copy. */
@@ -4911,8 +4907,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
if (pass_by_reference (&args_so_far_v, orig_arg))
{
rtx slot;
- int must_copy
- = !reference_callee_copied (&args_so_far_v, mode, NULL_TREE, 1);
+ int must_copy = !reference_callee_copied (&args_so_far_v, orig_arg);
/* If this was a CONST function, it is now PURE since it now
reads memory. */