[Bug target/123097] [16 Regression] [RISCV] [Miscompile] GCC - riscv64 target, miscompiles at -O3 since r16-5979
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Dec 19 18:43:05 GMT 2025
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 <rdapp@gcc.gnu.org>:
https://gcc.gnu.org/g:e8937196b2bdb0c7c7f967a4ddca3520e2db9b6b
commit r16-6288-ge8937196b2bdb0c7c7f967a4ddca3520e2db9b6b
Author: Robin Dapp <rdapp@ventanamicro.com>
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.
More information about the Gcc-bugs
mailing list