https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121910
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <l...@gcc.gnu.org>: https://gcc.gnu.org/g:642504b41cee46cf06aaa391386108563739a80c commit r16-3954-g642504b41cee46cf06aaa391386108563739a80c Author: Zhongyao Chen <chenzhongyao....@gmail.com> Date: Thu Sep 18 09:31:18 2025 -0600 RISC-V: Correct lmul estimation The vectorizer's compute_estimated_lmul function could previously return a bad value when the estimated lmul was larger than RVV_M8. This is corrected to return RVV_M8, preventing a register spill. The patch includes a new regression test for PR target/121910, based on the x264 mc_chroma function. The test uses scan-tree-dump to confirm that the compiler chooses the expected vector mode (RVVM1QI) at -O3, verifying the fix. PR target/121910 gcc/ChangeLog: * config/riscv/riscv-vector-costs.cc (compute_estimated_lmul): Return RVV_M8 when estimated lmul is too large. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr121910.c: New file.