Commit bbc85eb9 by Andrew MacLeod Committed by Andrew Macleod

re PR tree-optimization/92506 (Wrong code with -fwrapv since r277979)

2019-11-14  Andrew MacLeod  <amacleod@redhat.com>

	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
parent fae08a05
2019-11-14 Andrew MacLeod <amacleod@redhat.com>
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 <aldyh@redhat.com> 2019-11-14 Aldy Hernandez <aldyh@redhat.com>
* range-op.cc (*operator*::*range): Remove calls to * range-op.cc (*operator*::*range): Remove calls to
...@@ -146,6 +146,7 @@ range_operator::fold_range (value_range &r, tree type, ...@@ -146,6 +146,7 @@ range_operator::fold_range (value_range &r, tree type,
return; return;
value_range tmp; value_range tmp;
r.set_undefined ();
for (unsigned x = 0; x < lh.num_pairs (); ++x) for (unsigned x = 0; x < lh.num_pairs (); ++x)
for (unsigned y = 0; y < rh.num_pairs (); ++y) for (unsigned y = 0; y < rh.num_pairs (); ++y)
{ {
...@@ -2370,7 +2371,7 @@ operator_abs::wi_fold (value_range &r, tree type, ...@@ -2370,7 +2371,7 @@ operator_abs::wi_fold (value_range &r, tree type,
wide_int max_value = wi::max_value (prec, sign); wide_int max_value = wi::max_value (prec, sign);
if (!TYPE_OVERFLOW_UNDEFINED (type) && wi::eq_p (lh_lb, min_value)) 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; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment