diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2019-11-08 17:51:40 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 2019-11-08 17:51:40 +0000 |
commit | bb74ef9e8cd3ab77a3451951f87adde0a4a2871a (patch) | |
tree | 064031214b7fbd5402b06b1062119f4fb87cad46 /gcc/tree-vrp.c | |
parent | 77b29023e12eb3e906026380549d57dfcc44b433 (diff) |
Modify range_operator::fold_range() and wi_fold () to return via reference.
2019-11-08 Andrew MacLeod <amacleod@redhat.com>
* range-op.h (range_operator::fold_range): Return result in a
reference parameter instead of by value.
(range_operator::wi_fold): Same.
* range-op.cc (range_operator::wi_fold): Return result in a reference
parameter instead of by value.
(range_operator::fold_range): Same.
(value_range_from_overflowed_bounds): Same.
(value_range_with_overflow): Same
(create_possibly_reversed_range): Same.
(operator_equal::fold_range): Same.
(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::wi_fold): Same.
(operator_plus::op1_range): Change call to fold_range.
(operator_plus::op2_range): Change call to fold_range.
(operator_minus::wi_fold): Return result via reference parameter.
(operator_minus::op1_range): Change call to fold_range.
(operator_minus::op2_range): Change call to fold_range.
(operator_min::wi_fold): Return result via reference parameter.
(operator_max::wi_fold): Same.
(cross_product_operator::wi_cross_product): Same.
(operator_mult::wi_fold): Same.
(operator_div::wi_fold): Same.
(operator_div op_floor_div): Fix whitespace.
(operator_exact_divide::op1_range): Change call to fold_range.
(operator_lshift::fold_range): Return result via reference parameter.
(operator_lshift::wi_fold): Same.
(operator_rshift::fold_range): Same.
(operator_rshift::wi_fold): Same.
(operator_cast::fold_range): Same.
(operator_cast::op1_range): Change calls to fold_range.
(operator_logical_and::fold_range): Return result via reference.
(wi_optimize_and_or): Adjust call to value_range_with_overflow.
(operator_bitwise_and::wi_fold): Return result via reference.
(operator_logical_or::fold_range): Same.
(operator_bitwise_or::wi_fold): Same.
(operator_bitwise_xor::wi_fold): Same.
(operator_trunc_mod::wi_fold): Same.
(operator_logical_not::fold_range): Same.
(operator_bitwise_not::fold_range): Same.
(operator_bitwise_not::op1_range): Change call to fold_range.
(operator_cst::fold_range): Return result via reference.
(operator_identity::fold_range): Same.
(operator_abs::wi_fold): Same.
(operator_absu::wi_fold): Same.
(operator_negate::fold_range): Same.
(operator_negate::op1_range): Change call to fold_range.
(operator_addr_expr::fold_range): Return result via reference.
(operator_addr_expr::op1_range): Change call to fold_range.
(operator_pointer_plus::wi_fold): Return result via reference.
(operator_pointer_min_max::wi_fold): Same.
(operator_pointer_and::wi_fold): Same.
(operator_pointer_or::wi_fold): Same.
(range_op_handler): Change call to fold_range.
(range_cast): Same.
* tree-vrp.c (range_fold_binary_symbolics_p): Change call to
fold_range.
(range_fold_unary_symbolics_p): Same.
(range_fold_binary_expr): Same.
(range_fold_unary_expr): Same.
From-SVN: r277979
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 9889095fa13..b8b6967dae7 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1781,9 +1781,8 @@ range_fold_binary_symbolics_p (value_range *vr, return true; } const range_operator *op = get_range_op_handler (vr, code, expr_type); - *vr = op->fold_range (expr_type, - vr0->normalize_symbolics (), - vr1->normalize_symbolics ()); + op->fold_range (*vr, expr_type, vr0->normalize_symbolics (), + vr1->normalize_symbolics ()); return true; } return false; @@ -1817,9 +1816,8 @@ range_fold_unary_symbolics_p (value_range *vr, return true; } const range_operator *op = get_range_op_handler (vr, code, expr_type); - *vr = op->fold_range (expr_type, - vr0->normalize_symbolics (), - value_range (expr_type)); + op->fold_range (*vr, expr_type, vr0->normalize_symbolics (), + value_range (expr_type)); return true; } return false; @@ -1846,9 +1844,8 @@ range_fold_binary_expr (value_range *vr, if (range_fold_binary_symbolics_p (vr, code, expr_type, &vr0, &vr1)) return; - *vr = op->fold_range (expr_type, - vr0.normalize_addresses (), - vr1.normalize_addresses ()); + op->fold_range (*vr, expr_type, vr0.normalize_addresses (), + vr1.normalize_addresses ()); } /* Perform a unary operation on a range. */ @@ -1869,9 +1866,8 @@ range_fold_unary_expr (value_range *vr, if (range_fold_unary_symbolics_p (vr, code, expr_type, vr0)) return; - *vr = op->fold_range (expr_type, - vr0->normalize_addresses (), - value_range (expr_type)); + op->fold_range (*vr, expr_type, vr0->normalize_addresses (), + value_range (expr_type)); } /* Given a COND_EXPR COND of the form 'V OP W', and an SSA name V, |