summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 81c4d39de47..5be018afde7 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2128,7 +2128,8 @@ pass_by_reference (CUMULATIVE_ARGS *ca, enum machine_mode mode,
}
}
- return targetm.calls.pass_by_reference (ca, mode, type, named_arg);
+ return targetm.calls.pass_by_reference (pack_cumulative_args (ca), mode,
+ type, named_arg);
}
/* Return true if TYPE, which is passed by reference, should be callee
@@ -2140,7 +2141,8 @@ reference_callee_copied (CUMULATIVE_ARGS *ca, enum machine_mode mode,
{
if (type && TREE_ADDRESSABLE (type))
return false;
- return targetm.calls.callee_copies (ca, mode, type, named_arg);
+ return targetm.calls.callee_copies (pack_cumulative_args (ca), mode, type,
+ named_arg);
}
/* Structures to communicate between the subroutines of assign_parms.
@@ -2149,7 +2151,10 @@ reference_callee_copied (CUMULATIVE_ARGS *ca, enum machine_mode mode,
struct assign_parm_data_all
{
- CUMULATIVE_ARGS args_so_far;
+ /* When INIT_CUMULATIVE_ARGS gets revamped, allocating CUMULATIVE_ARGS
+ should become a job of the target or otherwise encapsulated. */
+ CUMULATIVE_ARGS args_so_far_v;
+ cumulative_args_t args_so_far;
struct args_size stack_args_size;
tree function_result_decl;
tree orig_fnargs;
@@ -2189,11 +2194,12 @@ assign_parms_initialize_all (struct assign_parm_data_all *all)
fntype = TREE_TYPE (current_function_decl);
#ifdef INIT_CUMULATIVE_INCOMING_ARGS
- INIT_CUMULATIVE_INCOMING_ARGS (all->args_so_far, fntype, NULL_RTX);
+ INIT_CUMULATIVE_INCOMING_ARGS (all->args_so_far_v, fntype, NULL_RTX);
#else
- INIT_CUMULATIVE_ARGS (all->args_so_far, fntype, NULL_RTX,
+ INIT_CUMULATIVE_ARGS (all->args_so_far_v, fntype, NULL_RTX,
current_function_decl, -1);
#endif
+ all->args_so_far = pack_cumulative_args (&all->args_so_far_v);
#ifdef REG_PARM_STACK_SPACE
all->reg_parm_stack_space = REG_PARM_STACK_SPACE (current_function_decl);
@@ -2314,7 +2320,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm,
data->named_arg = 1; /* No variadic parms. */
else if (DECL_CHAIN (parm))
data->named_arg = 1; /* Not the last non-variadic parm. */
- else if (targetm.calls.strict_argument_naming (&all->args_so_far))
+ else if (targetm.calls.strict_argument_naming (all->args_so_far))
data->named_arg = 1; /* Only variadic ones are unnamed. */
else
data->named_arg = 0; /* Treat as variadic. */
@@ -2350,7 +2356,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm,
passed_type = TREE_TYPE (first_field (passed_type));
/* See if this arg was passed by invisible reference. */
- if (pass_by_reference (&all->args_so_far, passed_mode,
+ if (pass_by_reference (&all->args_so_far_v, passed_mode,
passed_type, data->named_arg))
{
passed_type = nominal_type = build_pointer_type (passed_type);
@@ -2379,7 +2385,7 @@ assign_parms_setup_varargs (struct assign_parm_data_all *all,
{
int varargs_pretend_bytes = 0;
- targetm.calls.setup_incoming_varargs (&all->args_so_far,
+ targetm.calls.setup_incoming_varargs (all->args_so_far,
data->promoted_mode,
data->passed_type,
&varargs_pretend_bytes, no_rtl);
@@ -2408,7 +2414,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all,
return;
}
- entry_parm = targetm.calls.function_incoming_arg (&all->args_so_far,
+ entry_parm = targetm.calls.function_incoming_arg (all->args_so_far,
data->promoted_mode,
data->passed_type,
data->named_arg);
@@ -2432,10 +2438,10 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all,
#endif
if (!in_regs && !data->named_arg)
{
- if (targetm.calls.pretend_outgoing_varargs_named (&all->args_so_far))
+ if (targetm.calls.pretend_outgoing_varargs_named (all->args_so_far))
{
rtx tem;
- tem = targetm.calls.function_incoming_arg (&all->args_so_far,
+ tem = targetm.calls.function_incoming_arg (all->args_so_far,
data->promoted_mode,
data->passed_type, true);
in_regs = tem != NULL;
@@ -2452,7 +2458,7 @@ assign_parm_find_entry_rtl (struct assign_parm_data_all *all,
{
int partial;
- partial = targetm.calls.arg_partial_bytes (&all->args_so_far,
+ partial = targetm.calls.arg_partial_bytes (all->args_so_far,
data->promoted_mode,
data->passed_type,
data->named_arg);
@@ -3388,7 +3394,7 @@ assign_parms (tree fndecl)
set_decl_incoming_rtl (parm, data.entry_parm, false);
/* Update info on where next arg arrives in registers. */
- targetm.calls.function_arg_advance (&all.args_so_far, data.promoted_mode,
+ targetm.calls.function_arg_advance (all.args_so_far, data.promoted_mode,
data.passed_type, data.named_arg);
assign_parm_adjust_stack_rtl (&data);
@@ -3498,7 +3504,7 @@ assign_parms (tree fndecl)
/* For stdarg.h function, save info about
regs and stack space used by the named args. */
- crtl->args.info = all.args_so_far;
+ crtl->args.info = all.args_so_far_v;
/* Set the rtx used for the function return value. Put this in its
own variable so any optimizers that need this information don't have
@@ -3587,7 +3593,7 @@ gimplify_parameters (void)
continue;
/* Update info on where next arg arrives in registers. */
- targetm.calls.function_arg_advance (&all.args_so_far, data.promoted_mode,
+ targetm.calls.function_arg_advance (all.args_so_far, data.promoted_mode,
data.passed_type, data.named_arg);
/* ??? Once upon a time variable_size stuffed parameter list
@@ -3606,7 +3612,7 @@ gimplify_parameters (void)
if (data.passed_pointer)
{
tree type = TREE_TYPE (data.passed_type);
- if (reference_callee_copied (&all.args_so_far, TYPE_MODE (type),
+ if (reference_callee_copied (&all.args_so_far_v, TYPE_MODE (type),
type, data.named_arg))
{
tree local, t;