On Thu, Jan 14, 2016 at 12:38:52AM -0700, Jeff Law wrote:
> +  /* An integral type with more precision, but the object
> +     only takes on values [0..1] as determined by VRP
> +     analysis.  */
> +  wide_int min, max;
> +  if (INTEGRAL_TYPE_P (TREE_TYPE (op))
> +      && get_range_info (op, &min, &max) == VR_RANGE
> +      && wi::eq_p (min, 0)
> +      && wi::eq_p (max, 1))
> +    return true;

You could use and/or:
  if (INTEGRAL_TYPE_P (TREE_TYPE (op)) && wi::eq_p (get_nonzero_bits (op), 1))
set_range_info for VR_RANGE should usually update also the non-zero bits, but
set_nonzero_bits does not update the recorded range.

        Jakub

Reply via email to