https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83463
--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> Ugh:
> value_range_type rng = get_range_info (offset, &min, &max);
> if (rng == VR_RANGE)
> {
> offrange[0] = min.to_shwi ();
> offrange[1] = max.to_shwi ();
> }
> else if (rng == VR_ANTI_RANGE)
> {
> offrange[0] = (max + 1).to_shwi ();
> offrange[1] = (min - 1).to_shwi ();
> }
> What guarantees that min or max fit into shwi?
> Why the hops through shwi at all? Just do:
> offrange[0] = offset_int (min, UNSIGNED);
How's this better? It doesn't even compile.
I wrestled with how to convert wide_int to offset_int and couldn't come up with
a way to do it, I don't see why the API won't accept straight conversion from
wide_int to offset_int. Ugh indeed.