From: Andrew MacLeod Date: Thu, 14 Nov 2019 19:02:48 +0000 (+0000) Subject: re PR tree-optimization/92506 (Wrong code with -fwrapv since r277979) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bbc85eb9cfdfbbd6e81b2a98e3bddc90e0863497;p=gcc.git re PR tree-optimization/92506 (Wrong code with -fwrapv since r277979) 2019-11-14 Andrew MacLeod PR tree-optimization/92506 * range-op.cc (range_operator::fold_range): Start with range undefined. (operator_abs::wi_fold): Fix wrong line copy... With wrapv, abs with overflow is varying. From-SVN: r278259 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4266f6b1655..9f76c923ad8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-11-14 Andrew MacLeod + + PR tree-optimization/92506 + * range-op.cc (range_operator::fold_range): Start with range undefined. + (operator_abs::wi_fold): Fix wrong line copy... With wrapv, abs with + overflow is varying. + 2019-11-14 Aldy Hernandez * range-op.cc (*operator*::*range): Remove calls to diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 4a23cca3dbb..39c35919dec 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -146,6 +146,7 @@ range_operator::fold_range (value_range &r, tree type, return; value_range tmp; + r.set_undefined (); for (unsigned x = 0; x < lh.num_pairs (); ++x) for (unsigned y = 0; y < rh.num_pairs (); ++y) { @@ -2370,7 +2371,7 @@ operator_abs::wi_fold (value_range &r, tree type, wide_int max_value = wi::max_value (prec, sign); if (!TYPE_OVERFLOW_UNDEFINED (type) && wi::eq_p (lh_lb, min_value)) { - r = value_range (type, lh_lb, lh_ub); + r = value_range (type); return; }