On 6/6/19 4:11 PM, Aldy Hernandez wrote:
>> Meanwhile I have bootstrapped / tested the following which does the VARYING
>>
>> thing.
>>
>> Applied to trunk. I think we need to backport this since this is a latent
>>
>> wrong-code issue. We can see to improve things on the trunk incrementally.
>>
>
> Folks, thanks so much for taking care of this.
>
> After Richard's patch, my value_range_base::intersect patch no longer
> fails on vrp47, and no longer requires a special-case for undefined.
>
> The attached patch splits out the intersect code into a value_range_base
> version, as we have for union_.
>
> OK?
>
> Aldy
>
> curr.patch
>
> gcc/
>
> * tree-vrp.h (value_range_base::intersect): New.
> (value_range::intersect_helper): Move from here...
> (value_range_base::intersect_helper): ...to here.
> * tree-vrp.c (value_range::intersect_helper): Rename to...
> (value_range_base::intersect_helper): ...this, and rewrite to
> return a value instead of modifying THIS in place.
> Also, move equivalence handling...
> (value_range::intersect): ...here, while calling intersect_helper.
> * gimple-fold.c (size_must_be_zero_p): Use value_range_base when
> calling intersect.
> * gimple-ssa-evrp-analyze.c (ecord_ranges_from_incoming_edge):
> Same.
> * vr-values.c (vrp_evaluate_conditional_warnv_with_ops): Same.
OK
jeff