[Bug tree-optimization/121370] [13/14 Regression] wrong code at -O{s,2,3} on x86_64-linux-gnu since r0-123105

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Oct 14 13:27:31 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121370

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:e1dd907e1dff10da8cc6013345c4037184891655

commit r14-12084-ge1dd907e1dff10da8cc6013345c4037184891655
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Aug 5 08:59:18 2025 +0200

    tree-optimization/121370 - avoid UB in building a CHREC

    When there is obvious UB involved in the process of re-associating
    a series of IV increments to build up a CHREC, fail.  This catches
    a few degenerate cases where SCEV introduces UB with its inherent
    re-associating of IV increments.

            PR tree-optimization/121370
            * tree-scalar-evolution.cc (scev_dfs::add_to_evolution_1):
            Avoid UB integer overflow in accumulating CHREC_RIGHT.

            * gcc.dg/torture/pr121370.c: New testcase.

    (cherry picked from commit afafae097232e700bb7a74a453a048b83ebefccd)


More information about the Gcc-bugs mailing list