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

--- Comment #3 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Drea Pinski from comment #1)
>   # RANGE [irange] unsigned int [4294967269, 4294967269][4294967272,
> 4294967272][4294967275, 4294967275][4294967278, 4294967278][4294967280,
> 4294967280][4294967282, 4294967282][4294967284, 4294967284]
>   _12 = _5 * _11;
> 
> 
>   # RANGE [irange] unsigned int [0, 1][+INF, +INF]
>   _15 = (unsigned int) _14;
>   _16 = _12 + _15;
> 
> Looks like we don't handle the above ranges in a decent way for PLUS_EXPR.
> 
> 
> Back before ranger we could handle them.


THis is because we limit the nukmber of precise subpairs we do calculations on.
if you had 20 subpairs multiplies by 20 subpairs, wed be doing an awful lot of
math, and its probably a waste.

The current limit is if the number of pairs exceed 12, we simply use the upper
and lower bounds.    SO in this case, we have 2 pairs * 7 pairs, and 14 exceeds
it.  when we drop to [min, max]   sadly [0,1] [+INF, +INF] becomes VARYING.

One alternative, which I will measure, is instead of dropping both to [min,
max]  we could convert both to int_range<3>,  and then the result is going to
be at most 9 pairs.  This seems like a simpler approach than analyzing the
pairs and deciding to adjust one or the other.  It slikely to retain anything
useful, but not spend too much time if it isn't.

Reply via email to