https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123097
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Robin Dapp <[email protected]>: https://gcc.gnu.org/g:e8937196b2bdb0c7c7f967a4ddca3520e2db9b6b commit r16-6288-ge8937196b2bdb0c7c7f967a4ddca3520e2db9b6b Author: Robin Dapp <[email protected]> Date: Fri Dec 12 09:52:16 2025 +0100 vect: Use type precision in reduction epilogue [PR123097]. In the PR we extract non-existent bits/elements from a vector. This is because we use TYPE_SIZE (vectype) for a boolean vector which returns 8 instead of 4 for RVV's vector (4) <signed-boolean:1>. The patch uses TYPE_VECTOR_SUBPARTS instead and multiplies its result with vector_element_bits to get the proper number of elements and size. PR tree-optimization/123097 gcc/ChangeLog: * tree-vect-loop.cc (vect_create_epilog_for_reduction): Calculate vector size by number of elements * bit size per element. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr123097-run.c: New test. * gcc.target/riscv/rvv/autovec/pr123097.c: New test.
