* mips-tdep.c (mips_push_arguments): Always align struct_addr on a

16 byte boundary. Align allocated argument space using
MIPS_STACK_ARGSIZE.  Reserve space on stack for the struct return
and floating-point registers.  Use fp_register_arg_p to determine
if float_argreg should be aligned.
This commit is contained in:
Andrew Cagney
2000-07-10 15:09:23 +00:00
parent 12c616f16e
commit cce41527ca
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,11 @@
Mon Jul 10 18:06:18 2000 Andrew Cagney <cagney@b1.cygnus.com>
* mips-tdep.c (mips_push_arguments): Always align struct_addr on a
16 byte boundary. Align allocated argument space using
MIPS_STACK_ARGSIZE. Reserve space on stack for the struct return
and floating-point registers. Use fp_register_arg_p to determine
if float_argreg should be aligned.
2000-07-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com> 2000-07-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* config/sh/tm-sh.h (STORE_RETURN_VALUE): Redefine as * config/sh/tm-sh.h (STORE_RETURN_VALUE): Redefine as

View File

@ -2104,13 +2104,13 @@ mips_push_arguments (nargs, args, sp, struct_return, struct_addr)
On at least one MIPS variant, stack frames need to be 128-bit On at least one MIPS variant, stack frames need to be 128-bit
aligned, so we round to this widest known alignment. */ aligned, so we round to this widest known alignment. */
sp = ROUND_DOWN (sp, 16); sp = ROUND_DOWN (sp, 16);
struct_addr = ROUND_DOWN (struct_addr, MIPS_SAVED_REGSIZE); struct_addr = ROUND_DOWN (struct_addr, 16);
/* Now make space on the stack for the args. We allocate more /* Now make space on the stack for the args. We allocate more
than necessary for EABI, because the first few arguments are than necessary for EABI, because the first few arguments are
passed in registers, but that's OK. */ passed in registers, but that's OK. */
for (argnum = 0; argnum < nargs; argnum++) for (argnum = 0; argnum < nargs; argnum++)
len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), MIPS_SAVED_REGSIZE); len += ROUND_UP (TYPE_LENGTH (VALUE_TYPE (args[argnum])), MIPS_STACK_ARGSIZE);
sp -= ROUND_UP (len, 16); sp -= ROUND_UP (len, 16);
if (mips_debug) if (mips_debug)
@ -2126,9 +2126,11 @@ mips_push_arguments (nargs, args, sp, struct_return, struct_addr)
{ {
if (mips_debug) if (mips_debug)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"mips_push_arguments: struct_return at r%d 0x%lx\n", "mips_push_arguments: struct_return reg=%d 0x%lx\n",
argreg, (long) struct_addr); argreg, (long) struct_addr);
write_register (argreg++, struct_addr); write_register (argreg++, struct_addr);
if (MIPS_REGS_HAVE_HOME_P)
stack_offset += MIPS_STACK_ARGSIZE;
} }
/* Now load as many as possible of the first arguments into /* Now load as many as possible of the first arguments into
@ -2243,6 +2245,9 @@ mips_push_arguments (nargs, args, sp, struct_return, struct_addr)
argreg += FP_REGISTER_DOUBLE ? 1 : 2; argreg += FP_REGISTER_DOUBLE ? 1 : 2;
} }
} }
/* Reserve space for the FP register. */
if (MIPS_REGS_HAVE_HOME_P)
stack_offset += ROUND_UP (len, MIPS_STACK_ARGSIZE);
} }
else else
{ {