From: Tom Tromey Date: Tue, 14 Dec 2021 15:46:59 +0000 (-0700) Subject: Change riscv_return_value to use RETURN_VALUE_ABI_PRESERVES_ADDRESS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d4be21dce768ba5cddc300544a4953748187982c;p=binutils-gdb.git Change riscv_return_value to use RETURN_VALUE_ABI_PRESERVES_ADDRESS Internally, AdaCore has a test that is equivalent to (really a direct translation of) gdb.base/gnu_vector.exp. On 32-bit RISC-V, the "return" part of this test fails. Joel tracked this down to riscv_return_value returning RETURN_VALUE_ABI_RETURNS_ADDRESS. Using RETURN_VALUE_ABI_PRESERVES_ADDRESS is more correct here, and fixes the bug. I tested this for both 32- and 64-bit RISC-V using the AdaCore internal test suite, and Andrew Burgess tested it using gnu_vector.exp. --- diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 5a6269887e7..886996ce5b7 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -3301,7 +3301,7 @@ riscv_return_value (struct gdbarch *gdbarch, case riscv_arg_info::location::in_reg: return RETURN_VALUE_REGISTER_CONVENTION; case riscv_arg_info::location::by_ref: - return RETURN_VALUE_ABI_RETURNS_ADDRESS; + return RETURN_VALUE_ABI_PRESERVES_ADDRESS; case riscv_arg_info::location::on_stack: default: error (_("invalid argument location"));