https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92506

--- Comment #2 from Andrew Macleod <amacleod at redhat dot com> ---
Created attachment 47265
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47265&action=edit
patch to resolve the issue

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.

I will check this in once it passes bootstrap

Reply via email to