Mon Jun 30 15:30:38 1997 Michael Snyder (msnyder@cleaver.cygnus.com)

* mips-tdep.c (mips_push_arguments): tweak alignment of small
        structs passed in registers for little-endian non-EABI mode.
This commit is contained in:
Michael Snyder 1997-06-30 22:32:20 +00:00
parent 71e099952d
commit 158bda58c5
2 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,8 @@
Mon Jun 30 15:30:38 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
* mips-tdep.c (mips_push_arguments): tweak alignment of small
structs passed in registers for little-endian non-EABI mode.
Mon Jun 30 13:05:39 1997 Michael Snyder (msnyder@cleaver.cygnus.com)
* breakpoint.c (frame_in_dummy): use generic dummy if available.

View File

@ -1349,15 +1349,23 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
{
CORE_ADDR regval = extract_address (val, partial_len);
/* It's a simple argument being passed in a general
register.
If the argument length is smaller than the register size,
we have to adjust the argument on big endian targets.
/* A simple argument being passed in a general register.
If the length is smaller than the register size, we
have to adjust the alignment on big endian targets.
For structs, it appears that we have to
do the same even in little endian mode.
But don't do this adjustment on EABI targets. */
if (TARGET_BYTE_ORDER == BIG_ENDIAN
&& partial_len < MIPS_REGSIZE
&& !MIPS_EABI)
regval <<= ((MIPS_REGSIZE - partial_len) * TARGET_CHAR_BIT);
if (!MIPS_EABI &&
TYPE_LENGTH (arg_type) < MIPS_REGSIZE &&
(TARGET_BYTE_ORDER == BIG_ENDIAN ||
typecode == TYPE_CODE_STRUCT ||
typecode == TYPE_CODE_UNION))
regval <<= ((MIPS_REGSIZE - partial_len) *
TARGET_CHAR_BIT);
write_register (argreg, regval);
argreg++;
@ -1384,7 +1392,6 @@ mips_push_arguments(nargs, args, sp, struct_return, struct_addr)
typecode == TYPE_CODE_UNION) &&
len < MIPS_REGSIZE)
longword_offset = MIPS_REGSIZE - len;
write_memory (sp + stack_offset + longword_offset,
val, partial_len);
stack_offset += ROUND_UP (partial_len, MIPS_REGSIZE);