diff options
Diffstat (limited to 'gcc-4.8/gcc/tree-vrp.c')
-rw-r--r-- | gcc-4.8/gcc/tree-vrp.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc-4.8/gcc/tree-vrp.c b/gcc-4.8/gcc/tree-vrp.c index a8caed603..96a439a9b 100644 --- a/gcc-4.8/gcc/tree-vrp.c +++ b/gcc-4.8/gcc/tree-vrp.c @@ -5271,9 +5271,13 @@ register_edge_assert_for_1 (tree op, enum tree_code code, } else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (op_def))) { - /* Recurse through the type conversion. */ - retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def), - code, e, bsi); + /* Recurse through the type conversion, unless it is a narrowing + conversion or conversion from non-integral type. */ + tree rhs = gimple_assign_rhs1 (op_def); + if (INTEGRAL_TYPE_P (TREE_TYPE (rhs)) + && (TYPE_PRECISION (TREE_TYPE (rhs)) + <= TYPE_PRECISION (TREE_TYPE (op)))) + retval |= register_edge_assert_for_1 (rhs, code, e, bsi); } return retval; @@ -7453,7 +7457,8 @@ union_ranges (enum value_range_type *vr0type, } else if ((operand_less_p (vr1min, *vr0max) == 1 || operand_equal_p (vr1min, *vr0max, 0)) - && operand_less_p (*vr0min, vr1min) == 1) + && operand_less_p (*vr0min, vr1min) == 1 + && operand_less_p (*vr0max, vr1max) == 1) { /* [ ( ] ) or [ ]( ) */ if (*vr0type == VR_RANGE @@ -7487,7 +7492,8 @@ union_ranges (enum value_range_type *vr0type, } else if ((operand_less_p (*vr0min, vr1max) == 1 || operand_equal_p (*vr0min, vr1max, 0)) - && operand_less_p (vr1min, *vr0min) == 1) + && operand_less_p (vr1min, *vr0min) == 1 + && operand_less_p (vr1max, *vr0max) == 1) { /* ( [ ) ] or ( )[ ] */ if (*vr0type == VR_RANGE |