RISC-V: Fix C ABI for flattened struct with 0-length bitfield.
authorJim Wilson <jimw@sifive.com>
Thu, 8 Aug 2019 19:04:56 +0000 (19:04 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Thu, 8 Aug 2019 19:04:56 +0000 (12:04 -0700)
commite98c3ee9712a360b4f470f930ac0c68863db1d3f
tree074a5f773ee577199037d614dad492689e2bd083
parent355229f22a06073a288f6da189ea2757c5e09e30
RISC-V: Fix C ABI for flattened struct with 0-length bitfield.

gcc/
PR target/91229
* config/riscv/riscv.c (riscv_flatten_aggregate_field): New arg
ignore_zero_width_bit_field_p.  Skip zero size bitfields when true.
Pass into recursive call.
(riscv_flatten_aggregate_argument): New arg.  Pass to
riscv_flatten_aggregate_field.
(riscv_pass_aggregate_in_fpr_pair_p): New local warned.  Call
riscv_flatten_aggregate_argument twice, with false and true as last
arg.  Process result twice.  Compare results and warn if different.
(riscv_pass_aggregate_in_fpr_and_gpr_p): Likewise.

gcc/testsuite/
* gcc.target/riscv/flattened-struct-abi-1.c: New test.
* gcc.target/riscv/flattened-struct-abi-2.c: New test.

From-SVN: r274215
gcc/ChangeLog
gcc/config/riscv/riscv.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/riscv/flattened-struct-abi-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/flattened-struct-abi-2.c [new file with mode: 0644]