[Bug tree-optimization/121631] Signed overflow introduced by vectorizer
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Oct 20 09:23:10 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121631
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:ef8b3b979b6117eba9b39a7174f89b7297e8a1cd
commit r16-4500-gef8b3b979b6117eba9b39a7174f89b7297e8a1cd
Author: Richard Biener <rguenther@suse.de>
Date: Fri Oct 17 14:03:21 2025 +0200
tree-optimization/121631 - UB in vector epilogue
The vectorizer fails to take UB due to signed overflow into account
when generating code for the epilogue of a signed reduction. The
following tries to make sure to perform the actual reduction
computations in an unsigned type. I did not bother to adjust
inputs to internal functions like .REDUC_PLUS.
PR tree-optimization/121631
* tree-vect-loop.cc (vect_create_epilog_for_reduction):
When the reduction operation invokes UB on signed overflow
make sure to perform operations with it on an unsigned type.
More information about the Gcc-bugs
mailing list