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
This commit is contained in:
J"orn Rennecke 1998-04-23 20:57:06 +00:00 committed by Joern Rennecke
parent f1f53f0b75
commit aec373f1a1
3 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -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)
- 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;

View File

@ -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)) \