diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2018-12-04 15:56:09 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2018-12-12 14:21:31 +0000 |
commit | 4de3d8d06673d130e256a6ad81e5df2e412934c1 (patch) | |
tree | 042cceb76e5a824b6b97adfea68570a0c85a6a2c /gdb/riscv-tdep.c | |
parent | 13dc50ee16e1ff4180da61bdbd86e4a3c304b283 (diff) | |
download | gdb-4de3d8d06673d130e256a6ad81e5df2e412934c1.zip gdb-4de3d8d06673d130e256a6ad81e5df2e412934c1.tar.gz gdb-4de3d8d06673d130e256a6ad81e5df2e412934c1.tar.bz2 |
gdb/riscv: Handle passing variadic floating point arguments
This commit fixes some test failures in gdb.base/varargs.exp when
running on targets with floating point hardware. Floating point
unnamed (variadic) arguments should be passed in integer registers
according to the abi.
After this commit I see no failures in gdb.base/varargs.exp on 32 or
64 bit targets with floating point hardware.
gdb/ChangeLog:
* riscv-tdep.c (riscv_call_arg_scalar_float): Unnamed (variadic)
arguments are passed in integer registers.
(riscv_call_arg_complex_float): Likewise.
Diffstat (limited to 'gdb/riscv-tdep.c')
-rw-r--r-- | gdb/riscv-tdep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 5ddec70..fc424fb 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1935,7 +1935,7 @@ static void riscv_call_arg_scalar_float (struct riscv_arg_info *ainfo, struct riscv_call_info *cinfo) { - if (ainfo->length > cinfo->flen) + if (ainfo->length > cinfo->flen || ainfo->is_unnamed) return riscv_call_arg_scalar_int (ainfo, cinfo); else { @@ -1955,7 +1955,8 @@ riscv_call_arg_complex_float (struct riscv_arg_info *ainfo, struct riscv_call_info *cinfo) { if (ainfo->length <= (2 * cinfo->flen) - && riscv_arg_regs_available (&cinfo->float_regs) >= 2) + && riscv_arg_regs_available (&cinfo->float_regs) >= 2 + && !ainfo->is_unnamed) { bool result; int len = ainfo->length / 2; |