Commit 469225d8 by Jim Wilson

(expand_call): When setting n_named_args, depend on new

macro STRICT_ARGUMENT_NAMING.

From-SVN: r8911
parent ecacce37
...@@ -932,23 +932,29 @@ expand_call (exp, target, ignore) ...@@ -932,23 +932,29 @@ expand_call (exp, target, ignore)
/* Compute number of named args. /* Compute 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.
(If no anonymous args follow, the result of list_length We do include the last named arg if STRICT_ARGUMENT_NAMING is defined.
is actually one too large.) (If no anonymous args follow, the result of list_length is actually
one too large. This is harmless.)
If SETUP_INCOMING_VARARGS is defined, this machine will be able to If SETUP_INCOMING_VARARGS is defined and STRICT_ARGUMENT_NAMING is not,
place unnamed args that were passed in registers into the stack. So this machine will be able to place unnamed args that were passed in
treat all args as named. This allows the insns emitting for a specific registers into the stack. So treat all args as named. This allows the
argument list to be independent of the function declaration. insns emitting for a specific argument list to be independent of the
function declaration.
If SETUP_INCOMING_VARARGS is not defined, we do not have any reliable If SETUP_INCOMING_VARARGS is not defined, we do not have any reliable
way to pass unnamed args in registers, so we must force them into way to pass unnamed args in registers, so we must force them into
memory. */ memory. */
#ifndef SETUP_INCOMING_VARARGS #if !defined(SETUP_INCOMING_VARARGS) || defined(STRICT_ARGUMENT_NAMING)
if (TYPE_ARG_TYPES (funtype) != 0) if (TYPE_ARG_TYPES (funtype) != 0)
n_named_args n_named_args
= list_length (TYPE_ARG_TYPES (funtype)) - 1 = list_length (TYPE_ARG_TYPES (funtype))
#ifndef STRICT_ARGUMENT_NAMING
/* Don't include the last named arg. */
- 1
#endif
/* Count the struct value address, if it is passed as a parm. */ /* Count the struct value address, if it is passed as a parm. */
+ structure_value_addr_parm; + structure_value_addr_parm);
else else
#endif #endif
/* If we know nothing, treat all args as named. */ /* If we know nothing, treat all args as named. */
......
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