VRP: make range_includes_zero_p handle value_ranges

Aldy Hernandez aldyh@redhat.com
Wed Aug 22 09:32:00 GMT 2018



On 08/21/2018 05:46 AM, Richard Biener wrote:
> On Wed, Aug 15, 2018 at 3:33 AM Aldy Hernandez <aldyh@redhat.com> wrote:

>> Finally, my apologies for including a tiny change to the
>> POINTER_PLUS_EXPR handling code as well.  It came about the same set of
>> auditing tests.
> 
> Bah, please split up things here ;)  I've done a related change there
> yesterday...
> 
>>
>> It turns out we can handle POINTER_PLUS_EXPR(~[0,0], [X,Y]) without
>> bailing as VR_VARYING in extract_range_from_binary_expr_1.  In doing so,
>> I also noticed that ~[0,0] is not the only non-null.  We could also have
>> ~[0,2] and still know that the pointer is not zero.  I have adjusted
>> range_is_nonnull accordingly.
> 
> But there are other consumers and it would have been better to
> change range_includes_zero_p to do the natural thing (get a VR) and
> then remove range_is_nonnull as redundant if possible.

Indeed.  Cleaning up range_includes_zero_p makes VRP and friends a lot 
cleaner.  Thanks for the suggestion.

I lazily avoided cleaning up the division code affected in this patch 
too much, since it's going to be superseded by my division changes in 
the other patch.

OK pending tests?

Aldy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: curr.patch
Type: text/x-patch
Size: 9946 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180822/f903d4eb/attachment.bin>


More information about the Gcc-patches mailing list