* d10v-tdep.c (d10v_extract_return_value): Wierd. GCC wants to return

odd sized register quantities with only half of the first register used!
* config/d10v/tm-d10v.h (USE_STRUCT_CONVENTION): Use stack when size > 8.
This commit is contained in:
Andrew Cagney 1998-04-01 04:52:37 +00:00
parent e1fe7a7966
commit 19735aeaa1
3 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,12 @@
Mon Feb 16 14:05:54 1998 Andrew Cagney <cagney@b1.cygnus.com>
* d10v-tdep.c (d10v_extract_return_value): Wierd. GCC wants to
return odd sized register quantities with only half of the first
register used!
* config/d10v/tm-d10v.h (USE_STRUCT_CONVENTION): Use stack when
size > 8.
Mon Mar 30 16:42:12 1998 Jason Molenda (crash@bugshack.cygnus.com)
* rdi-share/Makefile.am, rdi-share/aclocal.m4,

View File

@ -187,7 +187,7 @@ extern CORE_ADDR d10v_skip_prologue ();
registers. */
#define USE_STRUCT_CONVENTION(gcc_p, type) \
(TYPE_LENGTH (type) > 1)
(TYPE_LENGTH (type) > 8)

View File

@ -654,8 +654,17 @@ d10v_extract_return_value (type, regbuf, valbuf)
unsigned short c = extract_unsigned_integer (regbuf + REGISTER_BYTE (RET1_REGNUM), REGISTER_RAW_SIZE (RET1_REGNUM));
store_unsigned_integer (valbuf, 1, c);
}
else
else if ((len & 1) == 0)
memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM), len);
else
{
/* For return values of odd size, the first byte is in the
least significant part of the first register. The
remaining bytes in remaining registers. Interestingly,
when such values are passed in, the last byte is in the
most significant byte of that same register - wierd. */
memcpy (valbuf, regbuf + REGISTER_BYTE (RET1_REGNUM) + 1, len);
}
}
}