]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: vsetvl: Add null check for fault-first loop [PR122652].
authorRobin Dapp <rdapp@ventanamicro.com>
Wed, 12 Nov 2025 09:17:47 +0000 (10:17 +0100)
committerRobin Dapp <rdapp@ventanamicro.com>
Mon, 1 Dec 2025 15:27:53 +0000 (16:27 +0100)
commitb2d0abfcd5a3a58e7967eb76bb3508e5ef20d9fa
tree034951575064c38d44f20fa428ce618887c34746
parent6e64cd9b762078a37b5ca27de0413ea951f99fb4
RISC-V: vsetvl: Add null check for fault-first loop [PR122652].

For a fault-first load we store the first instruction that read its VL
result.  The loop to do so uses next_nondebug_insn () which returns
nullptr when we are at the end.  Check for that before accessing the
next insn.

PR target/122652

gcc/ChangeLog:

* config/riscv/riscv-vsetvl.cc: Add nullptr check.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/pr122652.c: New test.
gcc/config/riscv/riscv-vsetvl.cc
gcc/testsuite/gcc.target/riscv/rvv/base/pr122652.c [new file with mode: 0644]