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

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>:

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

commit r16-3562-gcba74d2cde528af210e37a06652493b2ca38079c
Author: Richard Biener <rguent...@suse.de>
Date:   Fri Aug 29 12:15:09 2025 +0200

    tree-optimization/61247 - handle peeled converted IV in SCEV

    The following handles SCEV analysis of a peeled converted IV if
    that IV is known to not overflow.  For

      # _15 = PHI <_4(6), 0(5)>
      # i_18 = PHI <i_11(6), 0(5)>
      i_11 = i_18 + 1;
      _4 = (long unsigned int) i_11;

    we cannot analyze _15 directly since the SCC has a widening
    conversion.  But we can analyze _4 to (long unsigned int) {1, +, 1}_1
    which is "peeled" (it's from after the first iteration of _15).
    If the un-peeled IV {0, +, 1}_1 has the same initial value as _15
    and it does not overflow then _15 can be analyzed as
    {0ul, +, 1ul}_1.

    The following implements this in simplify_peeled_chrec.

            PR tree-optimization/61247
            * tree-scalar-evolution.cc (simplify_peeled_chrec):
            Handle the case of a converted peeled chrec.

            * gcc.dg/vect/vect-pr61247.c: New testcase.

Reply via email to