]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Bugfix ICE non-vector in TARGET_FUNCTION_VALUE_REGNO_P
authorPan Li <pan2.li@intel.com>
Fri, 12 Apr 2024 03:12:24 +0000 (11:12 +0800)
committerPan Li <pan2.li@intel.com>
Fri, 12 Apr 2024 06:17:05 +0000 (14:17 +0800)
commitdc51a6428f6d8e5a57b8b1bf559145288e87660b
tree1f618cb9e2bb0da5302df3835fbc1e93e1a1bbf2
parentd1a21a6f9474e519926d20a7c6d664be03aff3ee
RISC-V: Bugfix ICE non-vector in TARGET_FUNCTION_VALUE_REGNO_P

This patch would like to fix one ICE when vector is not enabled
in hook TARGET_FUNCTION_VALUE_REGNO_P implementation.  The vector
regno is available if and only if the TARGET_VECTOR is true.  The
previous implement missed this condition and then result in ICE
when rv64gc build option without vector.

The below test suite is passed for this patch.

* The rv64gcv fully regression tests.
* The rv64gc fully regression tests.

PR target/114639

gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_function_value_regno_p): Add
TARGET_VECTOR predicate for V_RETURN regno.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/pr114639-1.c: New test.
* gcc.target/riscv/pr114639-2.c: New test.
* gcc.target/riscv/pr114639-3.c: New test.
* gcc.target/riscv/pr114639-4.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/pr114639-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/pr114639-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/pr114639-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/pr114639-4.c [new file with mode: 0644]