Commit aec373f1 by J"orn Rennecke Committed by Joern Rennecke

Fix for execute/980205.c failure on SH[123].

	* 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.

From-SVN: r19391
parent f1f53f0b
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
......
......@@ -3488,9 +3488,9 @@ sh_expand_prologue ()
for (i = 0; i < NPARM_REGS(SImode); i++)
{
int rn = NPARM_REGS(SImode) + FIRST_PARM_REG - i - 1;
if (i > (NPARM_REGS(SImode)
if (i >= (NPARM_REGS(SImode)
- current_function_args_info.arg_count[(int) SH_ARG_INT]
- current_function_varargs))
))
break;
push (rn);
extra_push += 4;
......
......@@ -875,9 +875,11 @@ struct sh_args {
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)
......@@ -890,7 +892,6 @@ struct sh_args {
#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)) \
......
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