{
unsigned HOST_WIDE_INT bytes;
int object_size_type;
- int precision = TYPE_PRECISION (TREE_TYPE (ptr));
if (!validate_arg (ptr, POINTER_TYPE)
|| !validate_arg (ost, INTEGER_TYPE))
if (TREE_CODE (ptr) == ADDR_EXPR)
{
- wide_int wbytes
- = wi::uhwi (compute_builtin_object_size (ptr, object_size_type),
- precision);
- if (wi::fits_to_tree_p (wbytes, size_type_node))
- return wide_int_to_tree (size_type_node, wbytes);
+ bytes = compute_builtin_object_size (ptr, object_size_type);
+ if (wi::fits_to_tree_p (bytes, size_type_node))
+ return build_int_cstu (size_type_node, bytes);
}
else if (TREE_CODE (ptr) == SSA_NAME)
{
later. Maybe subsequent passes will help determining
it. */
bytes = compute_builtin_object_size (ptr, object_size_type);
- wide_int wbytes = wi::uhwi (bytes, precision);
if (bytes != (unsigned HOST_WIDE_INT) (object_size_type < 2 ? -1 : 0)
- && wi::fits_to_tree_p (wbytes, size_type_node))
- return wide_int_to_tree (size_type_node, wbytes);
+ && wi::fits_to_tree_p (bytes, size_type_node))
+ return build_int_cstu (size_type_node, bytes);
}
return NULL_TREE;
for (; args; args = TREE_CHAIN (args))
{
tree position = TREE_VALUE (args);
- wide_int p;
if (TREE_CODE (position) != INTEGER_CST
- || wi::ltu_p (p = wide_int (position), 1)
- || wi::gtu_p (p, arg_count))
+ || wi::ltu_p (position, 1)
+ || wi::gtu_p (position, arg_count))
{
warning (OPT_Wattributes,
"alloc_size parameter outside range");
if (TREE_CODE (ce->index) == INTEGER_CST)
{
/* A C99 designator is OK if it matches the current index. */
- if (tree_fits_uhwi_p (ce->index)
- && tree_to_uhwi (ce->index) == index)
+ if (wi::eq_p (ce->index, index))
return true;
else
sorry ("non-trivial designated initializers not supported");
|| (cst_fits_uhwi_p (bound) && wi::ges_p (bound, 0)))
add_AT_unsigned (subrange_die, bound_attr, tree_to_hwi (bound));
else
- add_AT_wide (subrange_die, bound_attr, wide_int (bound));
+ add_AT_wide (subrange_die, bound_attr, bound);
}
break;
else
/* Enumeration constants may be wider than HOST_WIDE_INT. Handle
that here. */
- add_AT_wide (enum_die, DW_AT_const_value, wide_int (value));
+ add_AT_wide (enum_die, DW_AT_const_value, value);
}
add_gnat_descriptive_type_attribute (type_die, type, context_die);
((unsigned HOST_WIDE_INT)
tree_to_uhwi (TREE_VALUE (element))));
else
- print_hex (wide_int (element), buf);
+ print_hex (element, buf);
mhval->value = xstrdup (buf);
*slot = mhval;
else if (GET_CODE (rhs) == MULT
&& CONST_INT_P (XEXP (rhs, 1)))
{
- negcoeff1 = -wide_int (std::make_pair (XEXP (rhs, 1), mode));
+ negcoeff1 = wi::neg (std::make_pair (XEXP (rhs, 1), mode));
rhs = XEXP (rhs, 0);
}
else if (GET_CODE (rhs) == ASHIFT
case INTEGER_CST:
fprintf (di->stream, "int: ");
- print_decs (wide_int (t), di->stream);
+ print_decs (t, di->stream);
break;
case STRING_CST:
struct mem_addr_template *templ;
if (addr->step && !integer_onep (addr->step))
- st = immed_wide_int_const (wide_int (addr->step), pointer_mode);
+ st = immed_wide_int_const (addr->step, pointer_mode);
else
st = NULL_RTX;
}
else
{
- widest_int nonzero_bits = val->mask;
- nonzero_bits = nonzero_bits | wi::to_widest (val->value);
+ widest_int nonzero_bits = val->mask | wi::to_widest (val->value);
nonzero_bits &= get_nonzero_bits (name);
set_nonzero_bits (name, nonzero_bits);
}
if (gimple_assign_rhs1 (def_stmt) != ptr)
return false;
- algn = wide_int_to_tree (TREE_TYPE (ptr), ~wide_int (algn));
+ algn = wide_int_to_tree (TREE_TYPE (ptr), wi::bit_not (algn));
gimple_assign_set_rhs_with_ops (gsi, BIT_AND_EXPR, ptr, algn);
fold_stmt_inplace (gsi);
update_stmt (stmt);
{
vr0->type = VR_RANGE;
vr0->min = vrp_val_min (type);
- vr0->max
- = wide_int_to_tree (type,
- wide_int (ar->min) - 1);
+ vr0->max = wide_int_to_tree (type, wi::sub (ar->min, 1));
}
if (!vrp_val_is_max (ar->max))
{
vr1->type = VR_RANGE;
- vr1->min
- = wide_int_to_tree (type,
- wide_int (ar->max) + 1);
+ vr1->min = wide_int_to_tree (type, wi::add (ar->max, 1));
vr1->max = vrp_val_max (type);
}
if (vr0->type == VR_UNDEFINED)
if (!TYPE_OVERFLOW_WRAPS (expr_type))
{
if (vrp_val_min (expr_type))
- type_min = wide_int (vrp_val_min (expr_type));
+ type_min = vrp_val_min (expr_type);
if (vrp_val_max (expr_type))
- type_max = wide_int (vrp_val_max (expr_type));
+ type_max = vrp_val_max (expr_type);
}
/* Check for type overflow. */
wide_int minval
= wi::min_value (prec, TYPE_SIGN (TREE_TYPE (val)));
new_val = val2;
- if (minval == wide_int (new_val))
+ if (minval == new_val)
new_val = NULL_TREE;
}
else
{
wide_int maxval
= wi::max_value (prec, TYPE_SIGN (TREE_TYPE (val)));
- mask |= wide_int (val2);
+ mask |= val2;
if (mask == maxval)
new_val = NULL_TREE;
else