On Fri, Oct 03, 2025 at 05:00:47PM +0200, Jakub Jelinek wrote:
> E.g. below is a loop on which it fails.
> The recorded value range (alread in dse1 and still after cddce1) is
>   # RANGE [irange] long int [-1, 0]
>   _41 = (long int) _1;
> In any case, the form of the loop with header containing
>     # _18 = PHI <_41(19), -1(22)>
>     if (_18 == 0)
>       exit
>     else
>       latch
> doesn't really care what _41 is, even if it would be VARYING, the
> loop still has 0 or 1 latch executions, never more.
> Perhaps this is too weird case on which nbiter just punts?

More reduced:
void bar (int);

void
foo (int x)
{
  for (int i = x; i == 0; i = -1)
    bar (i);
}
with -O2 -fdisable-tree-ethread -fdump-tree-cddce-details
Sure, the loop isn't empty in that case, but still niter
analysis could figure out it is [0, 1] latch executions loop,
[1, 2] header executions.

        Jakub

Reply via email to