https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116655
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Robin Dapp <rd...@gcc.gnu.org>: https://gcc.gnu.org/g:cc217a1ecb04c9234b2cce7ba3c27701a050e402 commit r15-4378-gcc217a1ecb04c9234b2cce7ba3c27701a050e402 Author: Robin Dapp <rd...@ventanamicro.com> Date: Tue Oct 15 12:10:48 2024 +0200 RISC-V: Use biggest_mode as mode for constants. In compute_nregs_for_mode we expect that the current variable's mode is at most as large as the biggest mode to be used for vectorization. This might not be true for constants as they don't actually have a mode. In that case, just use the biggest mode so max_number_of_live_regs returns 1. This fixes several test cases in the test suite. gcc/ChangeLog: PR target/116655 * config/riscv/riscv-vector-costs.cc (max_number_of_live_regs): Use biggest mode instead of constant's saved mode. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr116655.c: New test.