[committed] operator_abs::fold_range() returning incorrect result for overflows (pr92506)
Andrew MacLeod
amacleod@redhat.com
Thu Nov 14 19:13:00 GMT 2019
Traced it back to a typo in operator_abs::fold_range() when I did the
conversion where the wrong line got copied in..
Instead of returning value_range (type) when a overflow happens, it was
returning the same result of the previous check, which was the case for
all positives.
This had EVRP setting the range of an ABS to [-MIN, -1] instead of
varying, which later caused VRP to intersect that with 0 - [-MIN, -1]
and all heck broke loose. doh.
I also stumbled across a case where we should be starting with undefined
in the default fold_range() and building with union for each sub-range.
We previously declared a local value_range to work with, and that
defaulted to undefined. When I changed it to a reference parameter, I
need to explicitly initialize it.
Bootstraps, checked in as revision 278259.
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix.patch
Type: text/x-patch
Size: 1129 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20191114/16480593/attachment.bin>
More information about the Gcc-patches
mailing list