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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2025-08-29
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Estimating # of iterations of loop 1
Analyzing # of iterations of loop 1
  exit condition [a_9(D) + 4, + , 4](no_overflow) != b_8(D)
  bounds on difference of bases: -18446744073709551615 ... 18446744073709551611
  result:
    # of iterations (((unsigned long) b_8(D) - (unsigned long) a_9(D)) - 4)
/[ex] 4, bounded by 4611686018427387902
Statement (exit)if (b_8(D) != a_12)
 is executed at most (((unsigned long) b_8(D) - (unsigned long) a_9(D)) - 4)
/[ex] 4 (bounded by 4611686018427387902) + 1 times in loop 1.
Analyzing # of iterations of loop 1
  exit condition [a_9(D) + 4, + , 4](no_overflow) != b_8(D)
  bounds on difference of bases: -18446744073709551615 ... 18446744073709551611
  result:
    # of iterations (((unsigned long) b_8(D) - (unsigned long) a_9(D)) - 4)
/[ex] 4, bounded by 4611686018427387902
Loop 1 iterates at most -2 times.
Loop 1 likely iterates at most -2 times.

wut?  (probably a dump issue)

niter analysis uses it's simplify_using_initial_conditions but that hasn't
seen any TLC "recently".  The initial conditions include

  <bb 2> [local count: 347387056]:
  _1 = b_8(D) - a_9(D);
  if (_1 == 4)
    goto <bb 5>; [34.00%]

We could possibly do a walk_tree on the niter expression, trying to compute
a singleton range for sub-expressions, or even just try on the whole
expression.

Reply via email to