From: rsandifo Date: Mon, 4 Nov 2013 20:38:18 +0000 (+0000) Subject: Simplify some force_fit_type calls in tree-vrp.c. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8945e16bd0dc520c80b423cc0802c89ce551ff08;p=thirdparty%2Fgcc.git Simplify some force_fit_type calls in tree-vrp.c. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@204361 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 65f012d06fa0..fa30d1da9975 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1617,16 +1617,8 @@ extract_range_from_assert (value_range_t *vr_p, tree expr) /* Make sure to not set TREE_OVERFLOW on the final type conversion. We are willingly interpreting large positive unsigned values as negative singed values here. */ - min = force_fit_type (TREE_TYPE (var), - wide_int::from (min, - TYPE_PRECISION (TREE_TYPE (var)), - TYPE_SIGN (TREE_TYPE (min))), - 0, false); - max = force_fit_type (TREE_TYPE (var), - wide_int::from (max, - TYPE_PRECISION (TREE_TYPE (var)), - TYPE_SIGN (TREE_TYPE (max))), - 0, false); + min = force_fit_type (TREE_TYPE (var), wi::to_widest (min), 0, false); + max = force_fit_type (TREE_TYPE (var), wi::to_widest (max), 0, false); /* We can transform a max, min range to an anti-range or vice-versa. Use set_and_canonicalize_value_range which does @@ -3235,20 +3227,12 @@ extract_range_from_unary_expr_1 (value_range_t *vr, if (is_overflow_infinity (vr0.min)) new_min = negative_overflow_infinity (outer_type); else - new_min = force_fit_type (outer_type, - wide_int::from - (vr0.min, - TYPE_PRECISION (outer_type), - TYPE_SIGN (TREE_TYPE (vr0.min))), + new_min = force_fit_type (outer_type, wi::to_widest (vr0.min), 0, false); if (is_overflow_infinity (vr0.max)) new_max = positive_overflow_infinity (outer_type); else - new_max = force_fit_type (outer_type, - wide_int::from - (vr0.max, - TYPE_PRECISION (outer_type), - TYPE_SIGN (TREE_TYPE (vr0.max))), + new_max = force_fit_type (outer_type, wi::to_widest (vr0.max), 0, false); set_and_canonicalize_value_range (vr, vr0.type, new_min, new_max, NULL);