+Fri Apr 24 04:42:35 1998 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * sh.c (sh_expand_prologue, in !SH3E code): Don't push an extra
+ register for stdarg functions.
+ * sh.h (current_function_varargs): Declare.
+ (FUNCTION_ARG): Ignore NAMED for stdarg functions.
+
1998-04-23 Jim Wilson <wilson@cygnus.com>
* frame.c, libgcc2.c (stdlib.h, unistd.h): Don't include when
for (i = 0; i < NPARM_REGS(SImode); i++)
{
int rn = NPARM_REGS(SImode) + FIRST_PARM_REG - i - 1;
- if (i > (NPARM_REGS(SImode)
- - current_function_args_info.arg_count[(int) SH_ARG_INT]
- - current_function_varargs))
+ if (i >= (NPARM_REGS(SImode)
+ - current_function_args_info.arg_count[(int) SH_ARG_INT]
+ ))
break;
push (rn);
extra_push += 4;
NPARM_REGS words is at least partially passed in a register unless
its data type forbids. */
+extern int current_function_varargs;
+
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
((PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \
- && ((NAMED) || TARGET_SH3E)) \
+ && ((NAMED) || TARGET_SH3E || ! current_function_varargs)) \
? gen_rtx (REG, (MODE), \
(BASE_ARG_REG (MODE) + ROUND_REG ((CUM), (MODE)))) \
: 0)
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
((PASS_IN_REG_P ((CUM), (MODE), (TYPE)) \
- && ((NAMED) || TARGET_SH3E) \
&& (ROUND_REG ((CUM), (MODE)) \
+ (MODE != BLKmode \
? ROUND_ADVANCE (GET_MODE_SIZE (MODE)) \