aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2012-01-05 20:43:43 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2012-01-05 20:43:43 +0000
commit629c2cca17ff1c931a89011abdbd3ef4761aecb6 (patch)
tree8e9c2b0881e40714f0928329bbc8c5727872e7b4
parenta3e6a37b65335d59140b5415cabcb34ca6951371 (diff)
downloadgcc-629c2cca17ff1c931a89011abdbd3ef4761aecb6.zip
gcc-629c2cca17ff1c931a89011abdbd3ef4761aecb6.tar.gz
gcc-629c2cca17ff1c931a89011abdbd3ef4761aecb6.tar.bz2
tree-vrp.c (extract_range_from_binary_expr_1): Remove duplicated condition.
* tree-vrp.c (extract_range_from_binary_expr_1): Remove duplicated condition. (extract_range_from_unary_expr_1): Avoid useless computations. From-SVN: r182923
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-vrp.c30
2 files changed, 20 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1bd3bb2..7991f1a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-vrp.c (extract_range_from_binary_expr_1): Remove duplicated
+ condition.
+ (extract_range_from_unary_expr_1): Avoid useless computations.
+
2012-01-05 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/51767
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 494cdd3..4a018f7 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -2579,17 +2579,13 @@ extract_range_from_binary_expr_1 (value_range_t *vr,
behavior from the shift operation. We cannot even trust
SHIFT_COUNT_TRUNCATED at this stage, because that applies to rtl
shifts, and the operation at the tree level may be widened. */
- if (code == RSHIFT_EXPR)
+ if (vr1.type != VR_RANGE
+ || !value_range_nonnegative_p (&vr1)
+ || TREE_CODE (vr1.max) != INTEGER_CST
+ || compare_tree_int (vr1.max, TYPE_PRECISION (expr_type) - 1) == 1)
{
- if (vr1.type != VR_RANGE
- || !value_range_nonnegative_p (&vr1)
- || TREE_CODE (vr1.max) != INTEGER_CST
- || compare_tree_int (vr1.max,
- TYPE_PRECISION (expr_type) - 1) == 1)
- {
- set_value_range_to_varying (vr);
- return;
- }
+ set_value_range_to_varying (vr);
+ return;
}
extract_range_from_multiplicative_op_1 (vr, code, &vr0, &vr1);
@@ -2990,16 +2986,18 @@ extract_range_from_unary_expr_1 (value_range_t *vr,
size_int (TYPE_PRECISION (outer_type)))))))
{
tree new_min, new_max;
- new_min = force_fit_type_double (outer_type,
- tree_to_double_int (vr0.min),
- 0, false);
- new_max = force_fit_type_double (outer_type,
- tree_to_double_int (vr0.max),
- 0, false);
if (is_overflow_infinity (vr0.min))
new_min = negative_overflow_infinity (outer_type);
+ else
+ new_min = force_fit_type_double (outer_type,
+ tree_to_double_int (vr0.min),
+ 0, false);
if (is_overflow_infinity (vr0.max))
new_max = positive_overflow_infinity (outer_type);
+ else
+ new_max = force_fit_type_double (outer_type,
+ tree_to_double_int (vr0.max),
+ 0, false);
set_and_canonicalize_value_range (vr, vr0.type,
new_min, new_max, NULL);
return;