summaryrefslogtreecommitdiff
path: root/gcc/double-int.c
diff options
context:
space:
mode:
authoraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-28 18:23:16 +0000
committeraesok <aesok@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-28 18:23:16 +0000
commitd3237426929c302bcab9d683353b041667b22488 (patch)
tree4667776860379c311babeb25f863259e7d46dbc0 /gcc/double-int.c
parentf343b8e8f2730a69ddc966204e4b83406966c0b0 (diff)
downloadgcc-d3237426929c302bcab9d683353b041667b22488.tar.gz
* double-int.h (force_fit_type_double): Remove declaration.
* double-int.c (force_fit_type_double): Move to tree.c. * tree.h (force_fit_type_double): Declare. * tree.h (force_fit_type_double): Moved from double-int.c. Use double_int type for 'cst' argument. Use double_int_fits_to_tree_p and double_int_to_tree instead of fit_double_type and build_int_cst_wide. * convert.c (convert_to_pointer): Adjust call to force_fit_type_double. * tree-vrp.c (extract_range_from_assert, extract_range_from_unary_expr): Adjust call to force_fit_type_double. * fold-const.c: Update comment. (int_const_binop, fold_convert_const_int_from_int, fold_convert_const_int_from_real, fold_convert_const_int_from_fixed, extract_muldiv_1, fold_div_compare, fold_sign_changed_comparison, fold_unary_loc, fold_negate_const, fold_abs_const, fold_not_const, round_up_loc): Adjust call to force_fit_type_double. /c-family * c-common.c (shorten_compare): Adjust call to force_fit_type_double. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161509 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/double-int.c')
-rw-r--r--gcc/double-int.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/gcc/double-int.c b/gcc/double-int.c
index 7bdda7da212..aa175e89d41 100644
--- a/gcc/double-int.c
+++ b/gcc/double-int.c
@@ -134,56 +134,6 @@ fit_double_type (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
return l1 != low0 || h1 != high0;
}
-/* We force the double-int HIGH:LOW to the range of the type TYPE by
- sign or zero extending it.
- OVERFLOWABLE indicates if we are interested
- in overflow of the value, when >0 we are only interested in signed
- overflow, for <0 we are interested in any overflow. OVERFLOWED
- indicates whether overflow has already occurred. CONST_OVERFLOWED
- indicates whether constant overflow has already occurred. We force
- T's value to be within range of T's type (by setting to 0 or 1 all
- the bits outside the type's range). We set TREE_OVERFLOWED if,
- OVERFLOWED is nonzero,
- or OVERFLOWABLE is >0 and signed overflow occurs
- or OVERFLOWABLE is <0 and any overflow occurs
- We return a new tree node for the extended double-int. The node
- is shared if no overflow flags are set. */
-
-tree
-force_fit_type_double (tree type, unsigned HOST_WIDE_INT low,
- HOST_WIDE_INT high, int overflowable,
- bool overflowed)
-{
- int sign_extended_type;
- bool overflow;
-
- /* Size types *are* sign extended. */
- sign_extended_type = (!TYPE_UNSIGNED (type)
- || (TREE_CODE (type) == INTEGER_TYPE
- && TYPE_IS_SIZETYPE (type)));
-
- overflow = fit_double_type (low, high, &low, &high, type);
-
- /* If we need to set overflow flags, return a new unshared node. */
- if (overflowed || overflow)
- {
- if (overflowed
- || overflowable < 0
- || (overflowable > 0 && sign_extended_type))
- {
- tree t = make_node (INTEGER_CST);
- TREE_INT_CST_LOW (t) = low;
- TREE_INT_CST_HIGH (t) = high;
- TREE_TYPE (t) = type;
- TREE_OVERFLOW (t) = 1;
- return t;
- }
- }
-
- /* Else build a shared node. */
- return build_int_cst_wide (type, low, high);
-}
-
/* Add two doubleword integers with doubleword result.
Return nonzero if the operation overflows according to UNSIGNED_P.
Each argument is given as two `HOST_WIDE_INT' pieces.