https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117088
--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> ---
> void digits_2.isra (integer(kind=4) ISRA.6607)
> {
> integer(kind=4) ISRA.6607_927(D) = ISRA.6607;
> ...
> # RANGE [irange] integer(kind=4) [-2147483647, 8][10, +INF]
> _494 = ISRA.6607_927(D) + 1;
>
> by the time VRP sees it, i think ISRA.6607_927(D) is the actual parameter?
> if
> you set SSA_NAME_RANGE_INFO (ISRA.6607_927(D)) to [1, +INF] or [1, 10] or
> whatever, VRP will likely do some useful things.
>
> VRP can't figure out the non-negative part on its own as the fact that it is
> always [1, INF] is not apparent from within the function. Someone has to
> provide that info via the ssa-name passed as the parameter.
I think [1,INF] should be determinable from ipa-prop, since we know that
argument starts at 0 and increases by one for each recursive call. I
suppose we are giving up propagating value ranges to avoid problems with
"infinite depth" of the value range lattice?