aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1992-12-12 17:50:59 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1992-12-12 17:50:59 -0500
commit937868a2323ff9a28875811f30ada691bca25830 (patch)
treed4f76e25175d7a0ca0fd631d1d1de76b66980588 /gcc
parentaca49971b61151ad6c0057c2e2087e99d19a1121 (diff)
downloadgcc-937868a2323ff9a28875811f30ada691bca25830.zip
gcc-937868a2323ff9a28875811f30ada691bca25830.tar.gz
gcc-937868a2323ff9a28875811f30ada691bca25830.tar.bz2
(alpha_builtin_savregs): Correctly compute ARGSIZE and NREGS.
From-SVN: r2867
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/alpha/alpha.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 8c39b16..ca027ec 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1013,7 +1013,7 @@ print_operand (file, x, code)
}
/* Do what is necessary for `va_start'. The argument is ignored;
- We look at the current function to determine if stdargs or varargs
+ We look at the current function to determine if stdarg or varargs
is used and fill in an initial va_list. A pointer to this constructor
is returned. */
@@ -1023,9 +1023,9 @@ alpha_builtin_saveregs (arglist)
{
rtx block, addr, argsize;
tree fntype = TREE_TYPE (current_function_decl);
- int stdargs = (TYPE_ARG_TYPES (fntype) != 0
- && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
- != void_type_node));
+ int stdarg = (TYPE_ARG_TYPES (fntype) != 0
+ && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
+ != void_type_node));
int nregs = current_function_args_info;
/* If we have a variable-sized argument already, we will have used all
@@ -1034,27 +1034,22 @@ alpha_builtin_saveregs (arglist)
if (GET_CODE (current_function_arg_offset_rtx) != CONST_INT)
{
argsize = plus_constant (current_function_arg_offset_rtx,
- ((6 - stdargs) * UNITS_PER_WORD
- + UNITS_PER_WORD - 1));
+ (6 * UNITS_PER_WORD + UNITS_PER_WORD - 1));
argsize = expand_shift (RSHIFT_EXPR, Pmode, argsize,
build_int_2 (3, 0), argsize, 0);
}
else
{
- /* If we are using memory, deduct the stdarg adjustment from it,
- otherwise from the number of registers. Then compute the current
- argument number. */
-
+ /* Compute the number of args in memory and number of arguments already
+ processed. Then adjust the number of registers if this is stdarg. */
int memargs = ((INTVAL (current_function_arg_offset_rtx)
+ UNITS_PER_WORD - 1)
/ UNITS_PER_WORD);
- if (memargs)
- memargs -= stdargs;
- else
- nregs -= stdargs;
-
argsize = GEN_INT (MIN (nregs, 6) + memargs);
+
+ if (nregs <= 6)
+ nregs -= stdarg;
}
/* Allocate the va_list constructor */