Robin Dapp cb0d29db88 RISC-V: Fix ABI vector passing on stack and GPR [PR123824].
Krister reported that we violate the psABI when one vector argument
halfway fits into a register:

"Aggregates whose total size is no more than 2×XLEN bits are passed in a
pair of registers; if only one register is available, the first XLEN
bits are passed in a register and the remaining bits are passed on the
stack. If no registers are available, the aggregate is passed on the
stack."

This patch fixes this oversight and adds a few tests.

Regtested on rv64gcv_zvl512b.

	PR target/123824

gcc/ChangeLog:

	* config/riscv/riscv.cc (riscv_vls_mode_fits_in_gprs_p): New
	helper.
	(riscv_pass_vls_aggregate_in_gpr): Use helper and distribute
	half-fitting vector to GPR and stack.
	(riscv_pass_aggregate_in_vr): Reformat comment.
	(riscv_get_arg_info): Use helper.
	(riscv_pass_by_reference): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/abi/vls-gpr-1.c: New test.
	* gcc.target/riscv/abi/vls-gpr-10.c: New test.
	* gcc.target/riscv/abi/vls-gpr-11.c: New test.
	* gcc.target/riscv/abi/vls-gpr-12.c: New test.
	* gcc.target/riscv/abi/vls-gpr-13.c: New test.
	* gcc.target/riscv/abi/vls-gpr-14.c: New test.
	* gcc.target/riscv/abi/vls-gpr-2.c: New test.
	* gcc.target/riscv/abi/vls-gpr-3.c: New test.
	* gcc.target/riscv/abi/vls-gpr-4.c: New test.
	* gcc.target/riscv/abi/vls-gpr-5.c: New test.
	* gcc.target/riscv/abi/vls-gpr-6.c: New test.
	* gcc.target/riscv/abi/vls-gpr-7.c: New test.
	* gcc.target/riscv/abi/vls-gpr-8.c: New test.
	* gcc.target/riscv/abi/vls-gpr-9.c: New test.
2026-01-28 20:04:50 +01:00
2026-01-21 00:16:32 +00:00
2026-01-20 00:16:30 +00:00
2026-01-16 00:16:30 +00:00
2026-01-16 00:16:30 +00:00
2026-01-25 00:16:27 +00:00
2026-01-25 00:16:27 +00:00
2026-01-18 00:16:31 +00:00
2026-01-14 00:16:30 +00:00
2026-01-21 00:16:32 +00:00
2026-01-13 00:16:32 +00:00
2026-01-27 00:16:29 +00:00
2026-01-27 00:16:29 +00:00
2026-01-23 00:16:27 +00:00
2026-01-19 09:56:51 +01:00
2026-01-19 09:56:51 +01:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.7%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.4%