On Thu, Nov 8, 2018 at 1:09 PM Aldy Hernandez <al...@redhat.com> wrote:
>
> All this nonsense:
>
> -      rtype = get_range_info (t, &min, &max);
> -      if (rtype == VR_RANGE)
> -       {
> -         if (wi::lt_p (max, w, TYPE_SIGN (TREE_TYPE (t))))
> -           return true;
> -         if (wi::lt_p (w, min, TYPE_SIGN (TREE_TYPE (t))))
> -           return true;
> -       }
> -      else if (rtype == VR_ANTI_RANGE
> -              && wi::le_p (min, w, TYPE_SIGN (TREE_TYPE (t)))
> -              && wi::le_p (w, max, TYPE_SIGN (TREE_TYPE (t))))
>
> Replaced by an API like Kutulu intended.
>
> +      get_range_info (t, vr);
> +      if (!vr.may_contain_p (wide_int_to_tree (TREE_TYPE (t), w)))
>
> Ain't it grand?

Well.  The not-so-grand thing is that you possibly ggc-allocate
three INTEGER_CST nodes here.

So, no ...?

Shouldn't this instead use wide-int-range.h?  (yeah, there's
the class-ification still missing there)

Richard.

> OK for trunk, depending on get_range_info changes of course?
>
> Aldy

Reply via email to