[Bug tree-optimization/125652] [14/15/16/17 Regression] wrong code at -O3 on x86_64-linux-gnu
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jun 8 11:10:31 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125652
--- Comment #5 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:de3a13dd7f6c2856e96fc2b7924f9b34b638940f
commit r17-1421-gde3a13dd7f6c2856e96fc2b7924f9b34b638940f
Author: Richard Biener <rguenther@suse.de>
Date: Mon Jun 8 10:50:35 2026 +0200
tree-optimization/125652 - wrong code with SCEV
The following fixes a latent issue in chrec_fold_plus_poly_poly
which suffers from being prone to signed overflow UB in the way
it associates additions when accumulating two polynomical CHRECs.
Similar to r16-2781-gafafae097232e7 the following catches the
obvious cases when constants are involved without trying to address
the actual underlying issue.
PR tree-optimization/125652
* tree-chrec.cc (chrec_fold_plus_poly_poly): Avoid UB
integer overflow in accumulating CHREC_RIGHT.
* gcc.dg/torture/pr125652.c: New testcase.
More information about the Gcc-bugs
mailing list