https://sourceware.org/bugzilla/show_bug.cgi?id=31142

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from Mark Wielaard <mark at klomp dot org> ---
commit 669b648111d3bc27cd4756879f5fe5a18515de77
Author: Mark Wielaard <m...@klomp.org>
Date:   Tue Mar 19 22:43:10 2024 +0000

    riscv: Partial implementation of flatten_aggregate

    dwfl_module_return_value_location would fail on riscv for functions
    which return a (small) struct. This patch implements the simplest
    cases of flatten_aggregate in backends/riscv_retval.c. It just handles
    structs containing one or two members of the same base type which fit
    completely or in pieces in one or two general or floating point
    registers.

    It also adds a specific test case run-funcretval-struct.sh containing
    small structs of ints, longs, floats and doubles. All these testscases
    now work for riscv. There is already a slightly more extensive
    testcase for this in tests/run-funcretval.sh but that only has a
    testcase for aarch64.

             * backends/riscv_retval.c (flatten_aggregate_arg): Implement
             for the simple cases where we have a struct with one or two
             members of the same base type.
             (pass_by_flattened_arg): Likewise. Call either
             pass_in_gpr_lp64 or pass_in_fpr_lp64d.
             (riscv_return_value_location_lp64ifd): Call
             flatten_aggregate_arg including size.
             * tests/Makefile.am (TESTS): Add run-funcretval-struct.sh
             and run-funcretval-struct-native.sh.
             (check_PROGRAMS): Add funcretval_test_struct.
             (funcretval_test_struct_SOURCES): New.
             (EXTRA_DIST): Add run-funcretval-struct.sh,
             funcretval_test_struct_riscv.bz2 and
             run-funcretval-struct-native.sh.
             * tests/funcretval_test_struct_riscv.bz2: New test binary.
             * tests/run-funcretval-struct-native.sh: New test.
             * tests/run-funcretval-struct.sh: Likewise.

    https://sourceware.org/bugzilla/show_bug.cgi?id=31142

    Signed-off-by: Mark Wielaard <m...@klomp.org>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to