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
This commit is contained in:
Andrew MacLeod 2019-11-14 19:02:48 +00:00 committed by Andrew Macleod
parent fae08a0507
commit bbc85eb9cf
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,10 @@
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>
* range-op.cc (*operator*::*range): Remove calls to

View File

@ -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;
}