Commit f674b4a7 by Andrew MacLeod Committed by Andrew Macleod

Change fold_range to return a boolean result.

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

	* range-op.h (range_operator::fold_range): Return a bool.
	* range-op.cc (range_operator::wi_fold): Assert supported type.
	(range_operator::fold_range): Assert supported type and return true.
	(operator_equal::fold_range): Return true.
	(operator_not_equal::fold_range): Same.
	(operator_lt::fold_range): Same.
	(operator_le::fold_range): Same.
	(operator_gt::fold_range): Same.
	(operator_ge::fold_range): Same.
	(operator_plus::op1_range): Adjust call to fold_range.
	(operator_plus::op2_range): Same.
	(operator_minus::op1_range): Same.
	(operator_minus::op2_range): Same.
	(operator_exact_divide::op1_range): Same.
	(operator_lshift::fold_range): Return true and adjust fold_range call.
	(operator_rshift::fold_range): Same.
	(operator_cast::fold_range): Return true.
	(operator_logical_and::fold_range): Same.
	(operator_logical_or::fold_range): Same.
	(operator_logical_not::fold_range): Same.
	(operator_bitwise_not::fold_range): Adjust call to fold_range.
	(operator_bitwise_not::op1_range): Same.
	(operator_cst::fold_range): Return true.
	(operator_identity::fold_range): Return true.
	(operator_negate::fold_range): Return true and adjust fold_range call.
	(operator_addr_expr::fold_range): Return true.
	(operator_addr_expr::op1_range): Adjust call to fold_range.
	(range_cast): Same.
	* tree-vrp.c (range_fold_binary_symbolics_p): Adjust call to fold_range.
	(range_fold_unary_symbolics_p): Same.

From-SVN: r278266
parent 7c5890cc
2019-11-14 Andrew MacLeod <amacleod@redhat.com>
* range-op.h (range_operator::fold_range): Return a bool.
* range-op.cc (range_operator::wi_fold): Assert supported type.
(range_operator::fold_range): Assert supported type and return true.
(operator_equal::fold_range): Return true.
(operator_not_equal::fold_range): Same.
(operator_lt::fold_range): Same.
(operator_le::fold_range): Same.
(operator_gt::fold_range): Same.
(operator_ge::fold_range): Same.
(operator_plus::op1_range): Adjust call to fold_range.
(operator_plus::op2_range): Same.
(operator_minus::op1_range): Same.
(operator_minus::op2_range): Same.
(operator_exact_divide::op1_range): Same.
(operator_lshift::fold_range): Return true and adjust fold_range call.
(operator_rshift::fold_range): Same.
(operator_cast::fold_range): Return true.
(operator_logical_and::fold_range): Same.
(operator_logical_or::fold_range): Same.
(operator_logical_not::fold_range): Same.
(operator_bitwise_not::fold_range): Adjust call to fold_range.
(operator_bitwise_not::op1_range): Same.
(operator_cst::fold_range): Return true.
(operator_identity::fold_range): Return true.
(operator_negate::fold_range): Return true and adjust fold_range call.
(operator_addr_expr::fold_range): Return true.
(operator_addr_expr::op1_range): Adjust call to fold_range.
(range_cast): Same.
* tree-vrp.c (range_fold_binary_symbolics_p): Adjust call to fold_range.
(range_fold_unary_symbolics_p): Same.
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
......@@ -50,7 +50,7 @@ class range_operator
{
public:
// Perform an operation between 2 ranges and return it.
virtual void fold_range (value_range &r, tree type,
virtual bool fold_range (value_range &r, tree type,
const value_range &lh,
const value_range &rh) const;
......@@ -73,7 +73,7 @@ public:
const value_range &op1) const;
protected:
// Perform an operation between 2 sub-ranges and return it.
// Perform an integral operation between 2 sub-ranges and return it.
virtual void wi_fold (value_range &r, tree type,
const wide_int &lh_lb,
const wide_int &lh_ub,
......
......@@ -1185,8 +1185,7 @@ range_fold_binary_symbolics_p (value_range *vr,
value_range vr0_cst (*vr0), vr1_cst (*vr1);
vr0_cst.normalize_symbolics ();
vr1_cst.normalize_symbolics ();
op->fold_range (*vr, expr_type, vr0_cst, vr1_cst);
return true;
return op->fold_range (*vr, expr_type, vr0_cst, vr1_cst);
}
return false;
}
......@@ -1221,8 +1220,7 @@ range_fold_unary_symbolics_p (value_range *vr,
const range_operator *op = get_range_op_handler (vr, code, expr_type);
value_range vr0_cst (*vr0);
vr0_cst.normalize_symbolics ();
op->fold_range (*vr, expr_type, vr0_cst, value_range (expr_type));
return true;
return op->fold_range (*vr, expr_type, vr0_cst, value_range (expr_type));
}
return false;
}
......
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