Commit 3a4d587b by Alan Modra Committed by Alan Modra

calls.c (expand_call): Call INIT_CUMULATIVE_ARGS earlier, and pass raw n_named_args to it.

	* calls.c (expand_call): Call INIT_CUMULATIVE_ARGS earlier, and
	pass raw n_named_args to it.
	* targhooks.c: Formatting.
	(hook_bool_CUMULATIVE_ARGS_false): Correct comment.

From-SVN: r83583
parent 8c56bb83
2004-06-24 Alan Modra <amodra@bigpond.net.au>
* calls.c (expand_call): Call INIT_CUMULATIVE_ARGS earlier, and
pass raw n_named_args to it.
* targhooks.c: Formatting.
(hook_bool_CUMULATIVE_ARGS_false): Correct comment.
2004-06-23 Richard Henderson <rth@redhat.com> 2004-06-23 Richard Henderson <rth@redhat.com>
* c-gimplify.c (gimplify_decl_stmt): Push gimplify_one_sizepos inside * c-gimplify.c (gimplify_decl_stmt): Push gimplify_one_sizepos inside
......
...@@ -2275,6 +2275,26 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2275,6 +2275,26 @@ expand_call (tree exp, rtx target, int ignore)
num_actuals++; num_actuals++;
/* Compute number of named args. /* Compute number of named args.
First, do a raw count of the args for INIT_CUMULATIVE_ARGS. */
if (type_arg_types != 0)
n_named_args
= (list_length (type_arg_types)
/* Count the struct value address, if it is passed as a parm. */
+ structure_value_addr_parm);
else
/* If we know nothing, treat all args as named. */
n_named_args = num_actuals;
/* Start updating where the next arg would go.
On some machines (such as the PA) indirect calls have a different
calling convention than normal calls. The fourth argument in
INIT_CUMULATIVE_ARGS tells the backend if this is an indirect call
or not. */
INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl, n_named_args);
/* Now possibly adjust the number of named args.
Normally, don't include the last named arg if anonymous args follow. Normally, don't include the last named arg if anonymous args follow.
We do include the last named arg if We do include the last named arg if
targetm.calls.strict_argument_naming() returns nonzero. targetm.calls.strict_argument_naming() returns nonzero.
...@@ -2292,27 +2312,17 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2292,27 +2312,17 @@ expand_call (tree exp, rtx target, int ignore)
we do not have any reliable way to pass unnamed args in we do not have any reliable way to pass unnamed args in
registers, so we must force them into memory. */ registers, so we must force them into memory. */
if ((targetm.calls.strict_argument_naming (&args_so_far) if (type_arg_types != 0
|| ! targetm.calls.pretend_outgoing_varargs_named (&args_so_far)) && targetm.calls.strict_argument_naming (&args_so_far))
&& type_arg_types != 0) ;
n_named_args else if (type_arg_types != 0
= (list_length (type_arg_types) && ! targetm.calls.pretend_outgoing_varargs_named (&args_so_far))
/* Don't include the last named arg. */ /* Don't include the last named arg. */
- (targetm.calls.strict_argument_naming (&args_so_far) ? 0 : 1) --n_named_args;
/* Count the struct value address, if it is passed as a parm. */
+ structure_value_addr_parm);
else else
/* If we know nothing, treat all args as named. */ /* Treat all args as named. */
n_named_args = num_actuals; n_named_args = num_actuals;
/* Start updating where the next arg would go.
On some machines (such as the PA) indirect calls have a different
calling convention than normal calls. The fourth argument in
INIT_CUMULATIVE_ARGS tells the backend if this is an indirect call
or not. */
INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl, n_named_args);
/* Make a vector to hold all the information about each arg. */ /* Make a vector to hold all the information about each arg. */
args = alloca (num_actuals * sizeof (struct arg_data)); args = alloca (num_actuals * sizeof (struct arg_data));
memset (args, 0, num_actuals * sizeof (struct arg_data)); memset (args, 0, num_actuals * sizeof (struct arg_data));
......
...@@ -113,7 +113,7 @@ default_builtin_setjmp_frame_value (void) ...@@ -113,7 +113,7 @@ default_builtin_setjmp_frame_value (void)
return virtual_stack_vars_rtx; return virtual_stack_vars_rtx;
} }
/* Generic hook that takes a CUMULATIVE_ARGS pointer and returns true. */ /* Generic hook that takes a CUMULATIVE_ARGS pointer and returns false. */
bool bool
hook_bool_CUMULATIVE_ARGS_false (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) hook_bool_CUMULATIVE_ARGS_false (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
...@@ -122,9 +122,10 @@ hook_bool_CUMULATIVE_ARGS_false (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) ...@@ -122,9 +122,10 @@ hook_bool_CUMULATIVE_ARGS_false (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
} }
bool bool
default_pretend_outgoing_varargs_named(CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED) default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
{ {
return (targetm.calls.setup_incoming_varargs != default_setup_incoming_varargs); return (targetm.calls.setup_incoming_varargs
!= default_setup_incoming_varargs);
} }
/* Generic hook that takes a CUMULATIVE_ARGS pointer and returns true. */ /* Generic hook that takes a CUMULATIVE_ARGS pointer and returns true. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment