decl.c, [...]: Replace host_integerp (..., 1) with tree_fits_uhwi_p throughout.

gcc/ada/
	* gcc-interface/decl.c, gcc-interface/misc.c, gcc-interface/utils.c:
	Replace host_integerp (..., 1) with tree_fits_uhwi_p throughout.

gcc/c-family/
	* c-ada-spec.c, c-common.c, c-pretty-print.c: Replace
	host_integerp (..., 1) with tree_fits_uhwi_p throughout.

gcc/cp/
	* decl.c: Replace host_integerp (..., 1) with tree_fits_uhwi_p
	throughout.

gcc/
	* builtins.c, config/alpha/alpha.c, config/iq2000/iq2000.c,
	config/mips/mips.c, dbxout.c, dwarf2out.c, expr.c, fold-const.c,
	gimple-fold.c, godump.c, omp-low.c, predict.c, sdbout.c, stor-layout.c,
	tree-dfa.c, tree-sra.c, tree-ssa-forwprop.c, tree-ssa-loop-prefetch.c,
	tree-ssa-phiopt.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-vect-data-refs.c, tree-vect-patterns.c,
	tree.c, varasm.c, alias.c, cfgexpand.c, config/aarch64/aarch64.c,
	config/arm/arm.c, config/epiphany/epiphany.c, config/i386/i386.c,
	config/m32c/m32c-pragma.c, config/mep/mep-pragma.c,
	config/rs6000/rs6000.c, config/sparc/sparc.c, emit-rtl.c, function.c,
	gimplify.c, ipa-prop.c, stmt.c, trans-mem.c, tree-cfg.c,
	tree-object-size.c, tree-ssa-ccp.c, tree-ssa-loop-ivcanon.c,
	tree-stdarg.c, tree-switch-conversion.c, tree-vect-generic.c,
	tree-vrp.c, tsan.c, ubsan.c: Replace host_integerp (..., 1) with
	tree_fits_uhwi_p throughout.

From-SVN: r204956
This commit is contained in:
Richard Sandiford 2013-11-18 14:51:26 +00:00 committed by Richard Sandiford
parent 9541ffee8c
commit cc269bb6d9
63 changed files with 306 additions and 273 deletions

View File

@ -1,3 +1,21 @@
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* builtins.c, config/alpha/alpha.c, config/iq2000/iq2000.c,
config/mips/mips.c, dbxout.c, dwarf2out.c, expr.c, fold-const.c,
gimple-fold.c, godump.c, omp-low.c, predict.c, sdbout.c, stor-layout.c,
tree-dfa.c, tree-sra.c, tree-ssa-forwprop.c, tree-ssa-loop-prefetch.c,
tree-ssa-phiopt.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-vect-data-refs.c, tree-vect-patterns.c,
tree.c, varasm.c, alias.c, cfgexpand.c, config/aarch64/aarch64.c,
config/arm/arm.c, config/epiphany/epiphany.c, config/i386/i386.c,
config/m32c/m32c-pragma.c, config/mep/mep-pragma.c,
config/rs6000/rs6000.c, config/sparc/sparc.c, emit-rtl.c, function.c,
gimplify.c, ipa-prop.c, stmt.c, trans-mem.c, tree-cfg.c,
tree-object-size.c, tree-ssa-ccp.c, tree-ssa-loop-ivcanon.c,
tree-stdarg.c, tree-switch-conversion.c, tree-vect-generic.c,
tree-vrp.c, tsan.c, ubsan.c: Replace host_integerp (..., 1) with
tree_fits_uhwi_p throughout.
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com> 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* builtins.c, config/alpha/alpha.c, config/c6x/predicates.md, * builtins.c, config/alpha/alpha.c, config/c6x/predicates.md,

View File

@ -1,3 +1,8 @@
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* gcc-interface/decl.c, gcc-interface/misc.c, gcc-interface/utils.c:
Replace host_integerp (..., 1) with tree_fits_uhwi_p throughout.
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com> 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* gcc-interface/cuintp.c: Replace host_integerp (..., 0) with * gcc-interface/cuintp.c: Replace host_integerp (..., 0) with

View File

@ -837,7 +837,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
align_cap = get_mode_alignment (ptr_mode); align_cap = get_mode_alignment (ptr_mode);
} }
if (!host_integerp (TYPE_SIZE (gnu_type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (gnu_type))
|| compare_tree_int (TYPE_SIZE (gnu_type), size_cap) > 0) || compare_tree_int (TYPE_SIZE (gnu_type), size_cap) > 0)
align = 0; align = 0;
else if (compare_tree_int (TYPE_SIZE (gnu_type), align_cap) > 0) else if (compare_tree_int (TYPE_SIZE (gnu_type), align_cap) > 0)
@ -1482,7 +1482,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& const_flag && const_flag
&& gnu_expr && TREE_CONSTANT (gnu_expr) && gnu_expr && TREE_CONSTANT (gnu_expr)
&& AGGREGATE_TYPE_P (gnu_type) && AGGREGATE_TYPE_P (gnu_type)
&& host_integerp (TYPE_SIZE_UNIT (gnu_type), 1) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (gnu_type))
&& !(TYPE_IS_PADDING_P (gnu_type) && !(TYPE_IS_PADDING_P (gnu_type)
&& !host_integerp (TYPE_SIZE_UNIT && !host_integerp (TYPE_SIZE_UNIT
(TREE_TYPE (TYPE_FIELDS (gnu_type))), 1))) (TREE_TYPE (TYPE_FIELDS (gnu_type))), 1)))
@ -3497,7 +3497,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_size = DECL_SIZE (gnu_old_field); gnu_size = DECL_SIZE (gnu_old_field);
if (RECORD_OR_UNION_TYPE_P (gnu_field_type) if (RECORD_OR_UNION_TYPE_P (gnu_field_type)
&& !TYPE_FAT_POINTER_P (gnu_field_type) && !TYPE_FAT_POINTER_P (gnu_field_type)
&& host_integerp (TYPE_SIZE (gnu_field_type), 1)) && tree_fits_uhwi_p (TYPE_SIZE (gnu_field_type)))
gnu_field_type gnu_field_type
= make_packable_type (gnu_field_type, true); = make_packable_type (gnu_field_type, true);
} }
@ -4922,7 +4922,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Consider an alignment as suspicious if the alignment/size /* Consider an alignment as suspicious if the alignment/size
ratio is greater or equal to the byte/bit ratio. */ ratio is greater or equal to the byte/bit ratio. */
if (host_integerp (size, 1) if (tree_fits_uhwi_p (size)
&& align >= TREE_INT_CST_LOW (size) * BITS_PER_UNIT) && align >= TREE_INT_CST_LOW (size) * BITS_PER_UNIT)
post_error_ne ("?suspiciously large alignment specified for&", post_error_ne ("?suspiciously large alignment specified for&",
Expression (Alignment_Clause (gnat_entity)), Expression (Alignment_Clause (gnat_entity)),
@ -4930,12 +4930,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
} }
} }
else if (Is_Atomic (gnat_entity) && !gnu_size else if (Is_Atomic (gnat_entity) && !gnu_size
&& host_integerp (TYPE_SIZE (gnu_type), 1) && tree_fits_uhwi_p (TYPE_SIZE (gnu_type))
&& integer_pow2p (TYPE_SIZE (gnu_type))) && integer_pow2p (TYPE_SIZE (gnu_type)))
align = MIN (BIGGEST_ALIGNMENT, align = MIN (BIGGEST_ALIGNMENT,
tree_low_cst (TYPE_SIZE (gnu_type), 1)); tree_low_cst (TYPE_SIZE (gnu_type), 1));
else if (Is_Atomic (gnat_entity) && gnu_size else if (Is_Atomic (gnat_entity) && gnu_size
&& host_integerp (gnu_size, 1) && tree_fits_uhwi_p (gnu_size)
&& integer_pow2p (gnu_size)) && integer_pow2p (gnu_size))
align = MIN (BIGGEST_ALIGNMENT, tree_low_cst (gnu_size, 1)); align = MIN (BIGGEST_ALIGNMENT, tree_low_cst (gnu_size, 1));
@ -5583,7 +5583,7 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition,
&& !Strict_Alignment (gnat_type) && !Strict_Alignment (gnat_type)
&& RECORD_OR_UNION_TYPE_P (gnu_type) && RECORD_OR_UNION_TYPE_P (gnu_type)
&& !TYPE_FAT_POINTER_P (gnu_type) && !TYPE_FAT_POINTER_P (gnu_type)
&& host_integerp (TYPE_SIZE (gnu_type), 1)) && tree_fits_uhwi_p (TYPE_SIZE (gnu_type)))
gnu_type = make_packable_type (gnu_type, false); gnu_type = make_packable_type (gnu_type, false);
if (Has_Atomic_Components (gnat_array)) if (Has_Atomic_Components (gnat_array))
@ -6507,7 +6507,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
if (!needs_strict_alignment if (!needs_strict_alignment
&& RECORD_OR_UNION_TYPE_P (gnu_field_type) && RECORD_OR_UNION_TYPE_P (gnu_field_type)
&& !TYPE_FAT_POINTER_P (gnu_field_type) && !TYPE_FAT_POINTER_P (gnu_field_type)
&& host_integerp (TYPE_SIZE (gnu_field_type), 1) && tree_fits_uhwi_p (TYPE_SIZE (gnu_field_type))
&& (packed == 1 && (packed == 1
|| (gnu_size || (gnu_size
&& (tree_int_cst_lt (gnu_size, TYPE_SIZE (gnu_field_type)) && (tree_int_cst_lt (gnu_size, TYPE_SIZE (gnu_field_type))

View File

@ -591,7 +591,7 @@ gnat_type_max_size (const_tree gnu_type)
/* If we don't have a constant, see what we can get from TYPE_ADA_SIZE, /* If we don't have a constant, see what we can get from TYPE_ADA_SIZE,
which should stay untouched. */ which should stay untouched. */
if (!host_integerp (max_unitsize, 1) if (!tree_fits_uhwi_p (max_unitsize)
&& RECORD_OR_UNION_TYPE_P (gnu_type) && RECORD_OR_UNION_TYPE_P (gnu_type)
&& !TYPE_FAT_POINTER_P (gnu_type) && !TYPE_FAT_POINTER_P (gnu_type)
&& TYPE_ADA_SIZE (gnu_type)) && TYPE_ADA_SIZE (gnu_type))
@ -600,7 +600,7 @@ gnat_type_max_size (const_tree gnu_type)
/* If we have succeeded in finding a constant, round it up to the /* If we have succeeded in finding a constant, round it up to the
type's alignment and return the result in units. */ type's alignment and return the result in units. */
if (host_integerp (max_adasize, 1)) if (tree_fits_uhwi_p (max_adasize))
max_unitsize max_unitsize
= size_binop (CEIL_DIV_EXPR, = size_binop (CEIL_DIV_EXPR,
round_up (max_adasize, TYPE_ALIGN (gnu_type)), round_up (max_adasize, TYPE_ALIGN (gnu_type)),

View File

@ -806,7 +806,7 @@ make_packable_type (tree type, bool in_record)
/* Do not try to shrink the size if the RM size is not constant. */ /* Do not try to shrink the size if the RM size is not constant. */
if (TYPE_CONTAINS_TEMPLATE_P (type) if (TYPE_CONTAINS_TEMPLATE_P (type)
|| !host_integerp (TYPE_ADA_SIZE (type), 1)) || !tree_fits_uhwi_p (TYPE_ADA_SIZE (type)))
return type; return type;
/* Round the RM size up to a unit boundary to get the minimal size /* Round the RM size up to a unit boundary to get the minimal size
@ -832,7 +832,7 @@ make_packable_type (tree type, bool in_record)
if (RECORD_OR_UNION_TYPE_P (new_field_type) if (RECORD_OR_UNION_TYPE_P (new_field_type)
&& !TYPE_FAT_POINTER_P (new_field_type) && !TYPE_FAT_POINTER_P (new_field_type)
&& host_integerp (TYPE_SIZE (new_field_type), 1)) && tree_fits_uhwi_p (TYPE_SIZE (new_field_type)))
new_field_type = make_packable_type (new_field_type, true); new_field_type = make_packable_type (new_field_type, true);
/* However, for the last field in a not already packed record type /* However, for the last field in a not already packed record type
@ -915,7 +915,7 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
/* If size indicates an error, just return TYPE to avoid propagating /* If size indicates an error, just return TYPE to avoid propagating
the error. Likewise if it's too large to represent. */ the error. Likewise if it's too large to represent. */
if (!size_tree || !host_integerp (size_tree, 1)) if (!size_tree || !tree_fits_uhwi_p (size_tree))
return type; return type;
size = tree_low_cst (size_tree, 1); size = tree_low_cst (size_tree, 1);
@ -1741,7 +1741,7 @@ rest_of_record_type_compilation (tree record_type)
if (!pos if (!pos
&& TREE_CODE (curpos) == MULT_EXPR && TREE_CODE (curpos) == MULT_EXPR
&& host_integerp (TREE_OPERAND (curpos, 1), 1)) && tree_fits_uhwi_p (TREE_OPERAND (curpos, 1)))
{ {
tree offset = TREE_OPERAND (curpos, 0); tree offset = TREE_OPERAND (curpos, 0);
align = tree_low_cst (TREE_OPERAND (curpos, 1), 1); align = tree_low_cst (TREE_OPERAND (curpos, 1), 1);
@ -1751,7 +1751,7 @@ rest_of_record_type_compilation (tree record_type)
} }
else if (!pos else if (!pos
&& TREE_CODE (curpos) == PLUS_EXPR && TREE_CODE (curpos) == PLUS_EXPR
&& host_integerp (TREE_OPERAND (curpos, 1), 1) && tree_fits_uhwi_p (TREE_OPERAND (curpos, 1))
&& TREE_CODE (TREE_OPERAND (curpos, 0)) == MULT_EXPR && TREE_CODE (TREE_OPERAND (curpos, 0)) == MULT_EXPR
&& host_integerp && host_integerp
(TREE_OPERAND (TREE_OPERAND (curpos, 0), 1), 1)) (TREE_OPERAND (TREE_OPERAND (curpos, 0), 1), 1))
@ -2377,7 +2377,7 @@ create_field_decl (tree field_name, tree field_type, tree record_type,
that an alignment of 0 is taken as infinite. */ that an alignment of 0 is taken as infinite. */
unsigned int known_align; unsigned int known_align;
if (host_integerp (pos, 1)) if (tree_fits_uhwi_p (pos))
known_align = tree_low_cst (pos, 1) & - tree_low_cst (pos, 1); known_align = tree_low_cst (pos, 1) & - tree_low_cst (pos, 1);
else else
known_align = BITS_PER_UNIT; known_align = BITS_PER_UNIT;
@ -2388,7 +2388,7 @@ create_field_decl (tree field_name, tree field_type, tree record_type,
layout_decl (field_decl, known_align); layout_decl (field_decl, known_align);
SET_DECL_OFFSET_ALIGN (field_decl, SET_DECL_OFFSET_ALIGN (field_decl,
host_integerp (pos, 1) ? BIGGEST_ALIGNMENT tree_fits_uhwi_p (pos) ? BIGGEST_ALIGNMENT
: BITS_PER_UNIT); : BITS_PER_UNIT);
pos_from_bit (&DECL_FIELD_OFFSET (field_decl), pos_from_bit (&DECL_FIELD_OFFSET (field_decl),
&DECL_FIELD_BIT_OFFSET (field_decl), &DECL_FIELD_BIT_OFFSET (field_decl),
@ -2548,7 +2548,7 @@ invalidate_global_renaming_pointers (void)
bool bool
value_factor_p (tree value, HOST_WIDE_INT factor) value_factor_p (tree value, HOST_WIDE_INT factor)
{ {
if (host_integerp (value, 1)) if (tree_fits_uhwi_p (value))
return tree_low_cst (value, 1) % factor == 0; return tree_low_cst (value, 1) % factor == 0;
if (TREE_CODE (value) == MULT_EXPR) if (TREE_CODE (value) == MULT_EXPR)
@ -2608,14 +2608,14 @@ potential_alignment_gap (tree prev_field, tree curr_field, tree offset)
/* If the distance between the end of prev_field and the beginning of /* If the distance between the end of prev_field and the beginning of
curr_field is constant, then there is a gap if the value of this curr_field is constant, then there is a gap if the value of this
constant is not null. */ constant is not null. */
if (offset && host_integerp (offset, 1)) if (offset && tree_fits_uhwi_p (offset))
return !integer_zerop (offset); return !integer_zerop (offset);
/* If the size and position of the previous field are constant, /* If the size and position of the previous field are constant,
then check the sum of this size and position. There will be a gap then check the sum of this size and position. There will be a gap
iff it is not multiple of the current field alignment. */ iff it is not multiple of the current field alignment. */
if (host_integerp (DECL_SIZE (prev_field), 1) if (tree_fits_uhwi_p (DECL_SIZE (prev_field))
&& host_integerp (bit_position (prev_field), 1)) && tree_fits_uhwi_p (bit_position (prev_field)))
return ((tree_low_cst (bit_position (prev_field), 1) return ((tree_low_cst (bit_position (prev_field), 1)
+ tree_low_cst (DECL_SIZE (prev_field), 1)) + tree_low_cst (DECL_SIZE (prev_field), 1))
% DECL_ALIGN (curr_field) != 0); % DECL_ALIGN (curr_field) != 0);
@ -6302,7 +6302,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
size = TREE_VALUE (args); size = TREE_VALUE (args);
if (!host_integerp (size, 1)) if (!tree_fits_uhwi_p (size))
{ {
warning (OPT_Wattributes, "%qs attribute ignored", warning (OPT_Wattributes, "%qs attribute ignored",
IDENTIFIER_POINTER (name)); IDENTIFIER_POINTER (name));
@ -6334,7 +6334,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
|| (!SCALAR_FLOAT_MODE_P (orig_mode) || (!SCALAR_FLOAT_MODE_P (orig_mode)
&& GET_MODE_CLASS (orig_mode) != MODE_INT && GET_MODE_CLASS (orig_mode) != MODE_INT
&& !ALL_SCALAR_FIXED_POINT_MODE_P (orig_mode)) && !ALL_SCALAR_FIXED_POINT_MODE_P (orig_mode))
|| !host_integerp (TYPE_SIZE_UNIT (type), 1) || !tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
|| TREE_CODE (type) == BOOLEAN_TYPE) || TREE_CODE (type) == BOOLEAN_TYPE)
{ {
error ("invalid vector type for attribute %qs", error ("invalid vector type for attribute %qs",
@ -6403,7 +6403,7 @@ handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args),
bases, and this attribute is for binding implementors, not end-users, so bases, and this attribute is for binding implementors, not end-users, so
we should never get there from legitimate explicit uses. */ we should never get there from legitimate explicit uses. */
if (!host_integerp (rep_size, 1)) if (!tree_fits_uhwi_p (rep_size))
return NULL_TREE; return NULL_TREE;
/* Get the element type/mode and check this is something we know /* Get the element type/mode and check this is something we know
@ -6418,7 +6418,7 @@ handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args),
|| (!SCALAR_FLOAT_MODE_P (elem_mode) || (!SCALAR_FLOAT_MODE_P (elem_mode)
&& GET_MODE_CLASS (elem_mode) != MODE_INT && GET_MODE_CLASS (elem_mode) != MODE_INT
&& !ALL_SCALAR_FIXED_POINT_MODE_P (elem_mode)) && !ALL_SCALAR_FIXED_POINT_MODE_P (elem_mode))
|| !host_integerp (TYPE_SIZE_UNIT (elem_type), 1)) || !tree_fits_uhwi_p (TYPE_SIZE_UNIT (elem_type)))
{ {
error ("invalid element type for attribute %qs", error ("invalid element type for attribute %qs",
IDENTIFIER_POINTER (name)); IDENTIFIER_POINTER (name));

View File

@ -338,7 +338,7 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem)
if (MEM_EXPR (mem) != get_spill_slot_decl (false) if (MEM_EXPR (mem) != get_spill_slot_decl (false)
&& (ref->offset < 0 && (ref->offset < 0
|| (DECL_P (ref->base) || (DECL_P (ref->base)
&& (!host_integerp (DECL_SIZE (ref->base), 1) && (!tree_fits_uhwi_p (DECL_SIZE (ref->base))
|| (TREE_INT_CST_LOW (DECL_SIZE ((ref->base))) || (TREE_INT_CST_LOW (DECL_SIZE ((ref->base)))
< (unsigned HOST_WIDE_INT)(ref->offset + ref->size)))))) < (unsigned HOST_WIDE_INT)(ref->offset + ref->size))))))
return false; return false;
@ -2347,7 +2347,7 @@ adjust_offset_for_component_ref (tree x, bool *known_p,
tree xoffset = component_ref_field_offset (x); tree xoffset = component_ref_field_offset (x);
tree field = TREE_OPERAND (x, 1); tree field = TREE_OPERAND (x, 1);
if (! host_integerp (xoffset, 1)) if (! tree_fits_uhwi_p (xoffset))
{ {
*known_p = false; *known_p = false;
return; return;

View File

@ -658,7 +658,7 @@ c_getstr (tree src)
if (offset_node == 0) if (offset_node == 0)
return TREE_STRING_POINTER (src); return TREE_STRING_POINTER (src);
else if (!host_integerp (offset_node, 1) else if (!tree_fits_uhwi_p (offset_node)
|| compare_tree_int (offset_node, TREE_STRING_LENGTH (src) - 1) > 0) || compare_tree_int (offset_node, TREE_STRING_LENGTH (src) - 1) > 0)
return 0; return 0;
@ -3125,11 +3125,11 @@ determine_block_size (tree len, rtx len_rtx,
} }
else else
{ {
if (host_integerp (TYPE_MIN_VALUE (TREE_TYPE (len)), 1)) if (tree_fits_uhwi_p (TYPE_MIN_VALUE (TREE_TYPE (len))))
*min_size = tree_low_cst (TYPE_MIN_VALUE (TREE_TYPE (len)), 1); *min_size = tree_low_cst (TYPE_MIN_VALUE (TREE_TYPE (len)), 1);
else else
*min_size = 0; *min_size = 0;
if (host_integerp (TYPE_MAX_VALUE (TREE_TYPE (len)), 1)) if (tree_fits_uhwi_p (TYPE_MAX_VALUE (TREE_TYPE (len))))
*max_size = tree_low_cst (TYPE_MAX_VALUE (TREE_TYPE (len)), 1); *max_size = tree_low_cst (TYPE_MAX_VALUE (TREE_TYPE (len)), 1);
else else
*max_size = GET_MODE_MASK (GET_MODE (len_rtx)); *max_size = GET_MODE_MASK (GET_MODE (len_rtx));
@ -3279,7 +3279,7 @@ expand_builtin_mempcpy_args (tree dest, tree src, tree len,
return NULL_RTX; return NULL_RTX;
/* If LEN is not constant, call the normal function. */ /* If LEN is not constant, call the normal function. */
if (! host_integerp (len, 1)) if (! tree_fits_uhwi_p (len))
return NULL_RTX; return NULL_RTX;
len_rtx = expand_normal (len); len_rtx = expand_normal (len);
@ -3514,7 +3514,7 @@ expand_builtin_strncpy (tree exp, rtx target)
tree slen = c_strlen (src, 1); tree slen = c_strlen (src, 1);
/* We must be passed a constant len and src parameter. */ /* We must be passed a constant len and src parameter. */
if (!host_integerp (len, 1) || !slen || !host_integerp (slen, 1)) if (!tree_fits_uhwi_p (len) || !slen || !tree_fits_uhwi_p (slen))
return NULL_RTX; return NULL_RTX;
slen = size_binop_loc (loc, PLUS_EXPR, slen, ssize_int (1)); slen = size_binop_loc (loc, PLUS_EXPR, slen, ssize_int (1));
@ -3528,7 +3528,7 @@ expand_builtin_strncpy (tree exp, rtx target)
const char *p = c_getstr (src); const char *p = c_getstr (src);
rtx dest_mem; rtx dest_mem;
if (!p || dest_align == 0 || !host_integerp (len, 1) if (!p || dest_align == 0 || !tree_fits_uhwi_p (len)
|| !can_store_by_pieces (tree_low_cst (len, 1), || !can_store_by_pieces (tree_low_cst (len, 1),
builtin_strncpy_read_str, builtin_strncpy_read_str,
CONST_CAST (char *, p), CONST_CAST (char *, p),
@ -3672,7 +3672,7 @@ expand_builtin_memset_args (tree dest, tree val, tree len,
* the coefficients by pieces (in the required modes). * the coefficients by pieces (in the required modes).
* We can't pass builtin_memset_gen_str as that emits RTL. */ * We can't pass builtin_memset_gen_str as that emits RTL. */
c = 1; c = 1;
if (host_integerp (len, 1) if (tree_fits_uhwi_p (len)
&& can_store_by_pieces (tree_low_cst (len, 1), && can_store_by_pieces (tree_low_cst (len, 1),
builtin_memset_read_str, &c, dest_align, builtin_memset_read_str, &c, dest_align,
true)) true))
@ -3697,7 +3697,7 @@ expand_builtin_memset_args (tree dest, tree val, tree len,
if (c) if (c)
{ {
if (host_integerp (len, 1) if (tree_fits_uhwi_p (len)
&& can_store_by_pieces (tree_low_cst (len, 1), && can_store_by_pieces (tree_low_cst (len, 1),
builtin_memset_read_str, &c, dest_align, builtin_memset_read_str, &c, dest_align,
true)) true))
@ -4394,7 +4394,7 @@ expand_builtin_frame_address (tree fndecl, tree exp)
if (call_expr_nargs (exp) == 0) if (call_expr_nargs (exp) == 0)
/* Warning about missing arg was already issued. */ /* Warning about missing arg was already issued. */
return const0_rtx; return const0_rtx;
else if (! host_integerp (CALL_EXPR_ARG (exp, 0), 1)) else if (! tree_fits_uhwi_p (CALL_EXPR_ARG (exp, 0)))
{ {
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
error ("invalid argument to %<__builtin_frame_address%>"); error ("invalid argument to %<__builtin_frame_address%>");
@ -8646,7 +8646,7 @@ fold_builtin_memset (location_t loc, tree dest, tree c, tree len,
|| ! validate_arg (len, INTEGER_TYPE)) || ! validate_arg (len, INTEGER_TYPE))
return NULL_TREE; return NULL_TREE;
if (! host_integerp (len, 1)) if (! tree_fits_uhwi_p (len))
return NULL_TREE; return NULL_TREE;
/* If the LEN parameter is zero, return DEST. */ /* If the LEN parameter is zero, return DEST. */
@ -8779,7 +8779,7 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
if (!dest_align || !src_align) if (!dest_align || !src_align)
return NULL_TREE; return NULL_TREE;
if (readonly_data_expr (src) if (readonly_data_expr (src)
|| (host_integerp (len, 1) || (tree_fits_uhwi_p (len)
&& (MIN (src_align, dest_align) / BITS_PER_UNIT && (MIN (src_align, dest_align) / BITS_PER_UNIT
>= (unsigned HOST_WIDE_INT) tree_low_cst (len, 1)))) >= (unsigned HOST_WIDE_INT) tree_low_cst (len, 1))))
{ {
@ -8804,7 +8804,7 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
destvar = TREE_OPERAND (dest, 0); destvar = TREE_OPERAND (dest, 0);
dest_base = get_ref_base_and_extent (destvar, &dest_offset, dest_base = get_ref_base_and_extent (destvar, &dest_offset,
&size, &maxsize); &size, &maxsize);
if (host_integerp (len, 1)) if (tree_fits_uhwi_p (len))
maxsize = tree_low_cst (len, 1); maxsize = tree_low_cst (len, 1);
else else
maxsize = -1; maxsize = -1;
@ -9159,7 +9159,7 @@ fold_builtin_memchr (location_t loc, tree arg1, tree arg2, tree len, tree type)
const char *p1; const char *p1;
if (TREE_CODE (arg2) != INTEGER_CST if (TREE_CODE (arg2) != INTEGER_CST
|| !host_integerp (len, 1)) || !tree_fits_uhwi_p (len))
return NULL_TREE; return NULL_TREE;
p1 = c_getstr (arg1); p1 = c_getstr (arg1);
@ -9211,7 +9211,7 @@ fold_builtin_memcmp (location_t loc, tree arg1, tree arg2, tree len)
/* If all arguments are constant, and the value of len is not greater /* If all arguments are constant, and the value of len is not greater
than the lengths of arg1 and arg2, evaluate at compile-time. */ than the lengths of arg1 and arg2, evaluate at compile-time. */
if (host_integerp (len, 1) && p1 && p2 if (tree_fits_uhwi_p (len) && p1 && p2
&& compare_tree_int (len, strlen (p1) + 1) <= 0 && compare_tree_int (len, strlen (p1) + 1) <= 0
&& compare_tree_int (len, strlen (p2) + 1) <= 0) && compare_tree_int (len, strlen (p2) + 1) <= 0)
{ {
@ -9227,7 +9227,7 @@ fold_builtin_memcmp (location_t loc, tree arg1, tree arg2, tree len)
/* If len parameter is one, return an expression corresponding to /* If len parameter is one, return an expression corresponding to
(*(const unsigned char*)arg1 - (const unsigned char*)arg2). */ (*(const unsigned char*)arg1 - (const unsigned char*)arg2). */
if (host_integerp (len, 1) && tree_low_cst (len, 1) == 1) if (tree_fits_uhwi_p (len) && tree_low_cst (len, 1) == 1)
{ {
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
tree cst_uchar_ptr_node tree cst_uchar_ptr_node
@ -9339,7 +9339,7 @@ fold_builtin_strncmp (location_t loc, tree arg1, tree arg2, tree len)
p1 = c_getstr (arg1); p1 = c_getstr (arg1);
p2 = c_getstr (arg2); p2 = c_getstr (arg2);
if (host_integerp (len, 1) && p1 && p2) if (tree_fits_uhwi_p (len) && p1 && p2)
{ {
const int i = strncmp (p1, p2, tree_low_cst (len, 1)); const int i = strncmp (p1, p2, tree_low_cst (len, 1));
if (i > 0) if (i > 0)
@ -9387,7 +9387,7 @@ fold_builtin_strncmp (location_t loc, tree arg1, tree arg2, tree len)
/* If len parameter is one, return an expression corresponding to /* If len parameter is one, return an expression corresponding to
(*(const unsigned char*)arg1 - (const unsigned char*)arg2). */ (*(const unsigned char*)arg1 - (const unsigned char*)arg2). */
if (host_integerp (len, 1) && tree_low_cst (len, 1) == 1) if (tree_fits_uhwi_p (len) && tree_low_cst (len, 1) == 1)
{ {
tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0); tree cst_uchar_node = build_type_variant (unsigned_char_type_node, 1, 0);
tree cst_uchar_ptr_node tree cst_uchar_ptr_node
@ -12242,7 +12242,7 @@ fold_builtin_snprintf (location_t loc, tree dest, tree destsize, tree fmt,
if (orig && !validate_arg (orig, POINTER_TYPE)) if (orig && !validate_arg (orig, POINTER_TYPE))
return NULL_TREE; return NULL_TREE;
if (!host_integerp (destsize, 1)) if (!tree_fits_uhwi_p (destsize))
return NULL_TREE; return NULL_TREE;
/* Check whether the format is a literal string constant. */ /* Check whether the format is a literal string constant. */
@ -12301,7 +12301,7 @@ fold_builtin_snprintf (location_t loc, tree dest, tree destsize, tree fmt,
return NULL_TREE; return NULL_TREE;
retval = c_strlen (orig, 1); retval = c_strlen (orig, 1);
if (!retval || !host_integerp (retval, 1)) if (!retval || !tree_fits_uhwi_p (retval))
return NULL_TREE; return NULL_TREE;
origlen = tree_low_cst (retval, 1); origlen = tree_low_cst (retval, 1);
@ -12395,10 +12395,10 @@ expand_builtin_memory_chk (tree exp, rtx target, enum machine_mode mode,
len = CALL_EXPR_ARG (exp, 2); len = CALL_EXPR_ARG (exp, 2);
size = CALL_EXPR_ARG (exp, 3); size = CALL_EXPR_ARG (exp, 3);
if (! host_integerp (size, 1)) if (! tree_fits_uhwi_p (size))
return NULL_RTX; return NULL_RTX;
if (host_integerp (len, 1) || integer_all_onesp (size)) if (tree_fits_uhwi_p (len) || integer_all_onesp (size))
{ {
tree fn; tree fn;
@ -12529,22 +12529,22 @@ maybe_emit_chk_warning (tree exp, enum built_in_function fcode)
if (!len || !size) if (!len || !size)
return; return;
if (! host_integerp (size, 1) || integer_all_onesp (size)) if (! tree_fits_uhwi_p (size) || integer_all_onesp (size))
return; return;
if (is_strlen) if (is_strlen)
{ {
len = c_strlen (len, 1); len = c_strlen (len, 1);
if (! len || ! host_integerp (len, 1) || tree_int_cst_lt (len, size)) if (! len || ! tree_fits_uhwi_p (len) || tree_int_cst_lt (len, size))
return; return;
} }
else if (fcode == BUILT_IN_STRNCAT_CHK) else if (fcode == BUILT_IN_STRNCAT_CHK)
{ {
tree src = CALL_EXPR_ARG (exp, 1); tree src = CALL_EXPR_ARG (exp, 1);
if (! src || ! host_integerp (len, 1) || tree_int_cst_lt (len, size)) if (! src || ! tree_fits_uhwi_p (len) || tree_int_cst_lt (len, size))
return; return;
src = c_strlen (src, 1); src = c_strlen (src, 1);
if (! src || ! host_integerp (src, 1)) if (! src || ! tree_fits_uhwi_p (src))
{ {
warning_at (loc, 0, "%Kcall to %D might overflow destination buffer", warning_at (loc, 0, "%Kcall to %D might overflow destination buffer",
exp, get_callee_fndecl (exp)); exp, get_callee_fndecl (exp));
@ -12553,7 +12553,7 @@ maybe_emit_chk_warning (tree exp, enum built_in_function fcode)
else if (tree_int_cst_lt (src, size)) else if (tree_int_cst_lt (src, size))
return; return;
} }
else if (! host_integerp (len, 1) || ! tree_int_cst_lt (size, len)) else if (! tree_fits_uhwi_p (len) || ! tree_int_cst_lt (size, len))
return; return;
warning_at (loc, 0, "%Kcall to %D will always overflow destination buffer", warning_at (loc, 0, "%Kcall to %D will always overflow destination buffer",
@ -12577,7 +12577,7 @@ maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode)
size = CALL_EXPR_ARG (exp, 2); size = CALL_EXPR_ARG (exp, 2);
fmt = CALL_EXPR_ARG (exp, 3); fmt = CALL_EXPR_ARG (exp, 3);
if (! host_integerp (size, 1) || integer_all_onesp (size)) if (! tree_fits_uhwi_p (size) || integer_all_onesp (size))
return; return;
/* Check whether the format is a literal string constant. */ /* Check whether the format is a literal string constant. */
@ -12605,7 +12605,7 @@ maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode)
return; return;
len = c_strlen (arg, 1); len = c_strlen (arg, 1);
if (!len || ! host_integerp (len, 1)) if (!len || ! tree_fits_uhwi_p (len))
return; return;
} }
else else
@ -12726,17 +12726,17 @@ fold_builtin_memory_chk (location_t loc, tree fndecl,
} }
} }
if (! host_integerp (size, 1)) if (! tree_fits_uhwi_p (size))
return NULL_TREE; return NULL_TREE;
if (! integer_all_onesp (size)) if (! integer_all_onesp (size))
{ {
if (! host_integerp (len, 1)) if (! tree_fits_uhwi_p (len))
{ {
/* If LEN is not constant, try MAXLEN too. /* If LEN is not constant, try MAXLEN too.
For MAXLEN only allow optimizing into non-_ocs function For MAXLEN only allow optimizing into non-_ocs function
if SIZE is >= MAXLEN, never convert to __ocs_fail (). */ if SIZE is >= MAXLEN, never convert to __ocs_fail (). */
if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1)) if (maxlen == NULL_TREE || ! tree_fits_uhwi_p (maxlen))
{ {
if (fcode == BUILT_IN_MEMPCPY_CHK && ignore) if (fcode == BUILT_IN_MEMPCPY_CHK && ignore)
{ {
@ -12808,18 +12808,18 @@ fold_builtin_stxcpy_chk (location_t loc, tree fndecl, tree dest,
if (fcode == BUILT_IN_STRCPY_CHK && operand_equal_p (src, dest, 0)) if (fcode == BUILT_IN_STRCPY_CHK && operand_equal_p (src, dest, 0))
return fold_convert_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), dest); return fold_convert_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), dest);
if (! host_integerp (size, 1)) if (! tree_fits_uhwi_p (size))
return NULL_TREE; return NULL_TREE;
if (! integer_all_onesp (size)) if (! integer_all_onesp (size))
{ {
len = c_strlen (src, 1); len = c_strlen (src, 1);
if (! len || ! host_integerp (len, 1)) if (! len || ! tree_fits_uhwi_p (len))
{ {
/* If LEN is not constant, try MAXLEN too. /* If LEN is not constant, try MAXLEN too.
For MAXLEN only allow optimizing into non-_ocs function For MAXLEN only allow optimizing into non-_ocs function
if SIZE is >= MAXLEN, never convert to __ocs_fail (). */ if SIZE is >= MAXLEN, never convert to __ocs_fail (). */
if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1)) if (maxlen == NULL_TREE || ! tree_fits_uhwi_p (maxlen))
{ {
if (fcode == BUILT_IN_STPCPY_CHK) if (fcode == BUILT_IN_STPCPY_CHK)
{ {
@ -12895,17 +12895,17 @@ fold_builtin_stxncpy_chk (location_t loc, tree dest, tree src,
return build_call_expr_loc (loc, fn, 4, dest, src, len, size); return build_call_expr_loc (loc, fn, 4, dest, src, len, size);
} }
if (! host_integerp (size, 1)) if (! tree_fits_uhwi_p (size))
return NULL_TREE; return NULL_TREE;
if (! integer_all_onesp (size)) if (! integer_all_onesp (size))
{ {
if (! host_integerp (len, 1)) if (! tree_fits_uhwi_p (len))
{ {
/* If LEN is not constant, try MAXLEN too. /* If LEN is not constant, try MAXLEN too.
For MAXLEN only allow optimizing into non-_ocs function For MAXLEN only allow optimizing into non-_ocs function
if SIZE is >= MAXLEN, never convert to __ocs_fail (). */ if SIZE is >= MAXLEN, never convert to __ocs_fail (). */
if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1)) if (maxlen == NULL_TREE || ! tree_fits_uhwi_p (maxlen))
return NULL_TREE; return NULL_TREE;
} }
else else
@ -12944,7 +12944,7 @@ fold_builtin_strcat_chk (location_t loc, tree fndecl, tree dest,
if (p && *p == '\0') if (p && *p == '\0')
return omit_one_operand_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), dest, src); return omit_one_operand_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), dest, src);
if (! host_integerp (size, 1) || ! integer_all_onesp (size)) if (! tree_fits_uhwi_p (size) || ! integer_all_onesp (size))
return NULL_TREE; return NULL_TREE;
/* If __builtin_strcat_chk is used, assume strcat is available. */ /* If __builtin_strcat_chk is used, assume strcat is available. */
@ -12978,15 +12978,15 @@ fold_builtin_strncat_chk (location_t loc, tree fndecl,
else if (integer_zerop (len)) else if (integer_zerop (len))
return omit_one_operand_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), dest, src); return omit_one_operand_loc (loc, TREE_TYPE (TREE_TYPE (fndecl)), dest, src);
if (! host_integerp (size, 1)) if (! tree_fits_uhwi_p (size))
return NULL_TREE; return NULL_TREE;
if (! integer_all_onesp (size)) if (! integer_all_onesp (size))
{ {
tree src_len = c_strlen (src, 1); tree src_len = c_strlen (src, 1);
if (src_len if (src_len
&& host_integerp (src_len, 1) && tree_fits_uhwi_p (src_len)
&& host_integerp (len, 1) && tree_fits_uhwi_p (len)
&& ! tree_int_cst_lt (len, src_len)) && ! tree_int_cst_lt (len, src_len))
{ {
/* If LEN >= strlen (SRC), optimize into __strcat_chk. */ /* If LEN >= strlen (SRC), optimize into __strcat_chk. */
@ -13035,7 +13035,7 @@ fold_builtin_sprintf_chk_1 (location_t loc, int nargs, tree *args,
if (!validate_arg (fmt, POINTER_TYPE)) if (!validate_arg (fmt, POINTER_TYPE))
return NULL_TREE; return NULL_TREE;
if (! host_integerp (size, 1)) if (! tree_fits_uhwi_p (size))
return NULL_TREE; return NULL_TREE;
len = NULL_TREE; len = NULL_TREE;
@ -13066,7 +13066,7 @@ fold_builtin_sprintf_chk_1 (location_t loc, int nargs, tree *args,
if (validate_arg (arg, POINTER_TYPE)) if (validate_arg (arg, POINTER_TYPE))
{ {
len = c_strlen (arg, 1); len = c_strlen (arg, 1);
if (! len || ! host_integerp (len, 1)) if (! len || ! tree_fits_uhwi_p (len))
len = NULL_TREE; len = NULL_TREE;
} }
} }
@ -13143,17 +13143,17 @@ fold_builtin_snprintf_chk_1 (location_t loc, int nargs, tree *args,
if (!validate_arg (fmt, POINTER_TYPE)) if (!validate_arg (fmt, POINTER_TYPE))
return NULL_TREE; return NULL_TREE;
if (! host_integerp (size, 1)) if (! tree_fits_uhwi_p (size))
return NULL_TREE; return NULL_TREE;
if (! integer_all_onesp (size)) if (! integer_all_onesp (size))
{ {
if (! host_integerp (len, 1)) if (! tree_fits_uhwi_p (len))
{ {
/* If LEN is not constant, try MAXLEN too. /* If LEN is not constant, try MAXLEN too.
For MAXLEN only allow optimizing into non-_ocs function For MAXLEN only allow optimizing into non-_ocs function
if SIZE is >= MAXLEN, never convert to __ocs_fail (). */ if SIZE is >= MAXLEN, never convert to __ocs_fail (). */
if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1)) if (maxlen == NULL_TREE || ! tree_fits_uhwi_p (maxlen))
return NULL_TREE; return NULL_TREE;
} }
else else

View File

@ -1,3 +1,8 @@
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* c-ada-spec.c, c-common.c, c-pretty-print.c: Replace
host_integerp (..., 1) with tree_fits_uhwi_p throughout.
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com> 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* c-ada-spec.c, c-common.c, c-format.c, c-pretty-print.c: Replace * c-ada-spec.c, c-common.c, c-format.c, c-pretty-print.c: Replace

View File

@ -2207,7 +2207,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc,
node = fold_convert (ssizetype, node); node = fold_convert (ssizetype, node);
if (tree_fits_shwi_p (node)) if (tree_fits_shwi_p (node))
pp_wide_integer (buffer, TREE_INT_CST_LOW (node)); pp_wide_integer (buffer, TREE_INT_CST_LOW (node));
else if (host_integerp (node, 1)) else if (tree_fits_uhwi_p (node))
pp_unsigned_wide_integer (buffer, TREE_INT_CST_LOW (node)); pp_unsigned_wide_integer (buffer, TREE_INT_CST_LOW (node));
else else
{ {

View File

@ -8477,7 +8477,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
size = TREE_VALUE (args); size = TREE_VALUE (args);
if (!host_integerp (size, 1)) if (!tree_fits_uhwi_p (size))
{ {
warning (OPT_Wattributes, "%qE attribute ignored", name); warning (OPT_Wattributes, "%qE attribute ignored", name);
return NULL_TREE; return NULL_TREE;
@ -8510,7 +8510,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
|| (!SCALAR_FLOAT_MODE_P (orig_mode) || (!SCALAR_FLOAT_MODE_P (orig_mode)
&& GET_MODE_CLASS (orig_mode) != MODE_INT && GET_MODE_CLASS (orig_mode) != MODE_INT
&& !ALL_SCALAR_FIXED_POINT_MODE_P (orig_mode)) && !ALL_SCALAR_FIXED_POINT_MODE_P (orig_mode))
|| !host_integerp (TYPE_SIZE_UNIT (type), 1) || !tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
|| TREE_CODE (type) == BOOLEAN_TYPE) || TREE_CODE (type) == BOOLEAN_TYPE)
{ {
error ("invalid vector type for attribute %qE", name); error ("invalid vector type for attribute %qE", name);
@ -11702,7 +11702,7 @@ convert_vector_to_pointer_for_subscript (location_t loc,
tree type1; tree type1;
if (TREE_CODE (index) == INTEGER_CST) if (TREE_CODE (index) == INTEGER_CST)
if (!host_integerp (index, 1) if (!tree_fits_uhwi_p (index)
|| ((unsigned HOST_WIDE_INT) tree_low_cst (index, 1) || ((unsigned HOST_WIDE_INT) tree_low_cst (index, 1)
>= TYPE_VECTOR_SUBPARTS (type))) >= TYPE_VECTOR_SUBPARTS (type)))
warning_at (loc, OPT_Warray_bounds, "index value is out of bound"); warning_at (loc, OPT_Warray_bounds, "index value is out of bound");

View File

@ -917,7 +917,7 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
if (tree_fits_shwi_p (i)) if (tree_fits_shwi_p (i))
pp_wide_integer (pp, TREE_INT_CST_LOW (i)); pp_wide_integer (pp, TREE_INT_CST_LOW (i));
else if (host_integerp (i, 1)) else if (tree_fits_uhwi_p (i))
pp_unsigned_wide_integer (pp, TREE_INT_CST_LOW (i)); pp_unsigned_wide_integer (pp, TREE_INT_CST_LOW (i));
else else
{ {

View File

@ -1358,7 +1358,7 @@ stack_protect_classify_type (tree type)
unsigned HOST_WIDE_INT len; unsigned HOST_WIDE_INT len;
if (!TYPE_SIZE_UNIT (type) if (!TYPE_SIZE_UNIT (type)
|| !host_integerp (TYPE_SIZE_UNIT (type), 1)) || !tree_fits_uhwi_p (TYPE_SIZE_UNIT (type)))
len = max; len = max;
else else
len = tree_low_cst (TYPE_SIZE_UNIT (type), 1); len = tree_low_cst (TYPE_SIZE_UNIT (type), 1);

View File

@ -6030,9 +6030,9 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
if (count == -1 if (count == -1
|| !index || !index
|| !TYPE_MAX_VALUE (index) || !TYPE_MAX_VALUE (index)
|| !host_integerp (TYPE_MAX_VALUE (index), 1) || !tree_fits_uhwi_p (TYPE_MAX_VALUE (index))
|| !TYPE_MIN_VALUE (index) || !TYPE_MIN_VALUE (index)
|| !host_integerp (TYPE_MIN_VALUE (index), 1) || !tree_fits_uhwi_p (TYPE_MIN_VALUE (index))
|| count < 0) || count < 0)
return -1; return -1;
@ -6040,7 +6040,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
- tree_low_cst (TYPE_MIN_VALUE (index), 1)); - tree_low_cst (TYPE_MIN_VALUE (index), 1));
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;
@ -6070,7 +6070,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
} }
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;
@ -6102,7 +6102,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
} }
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;

View File

@ -5860,7 +5860,7 @@ va_list_skip_additions (tree lhs)
if (!CONVERT_EXPR_CODE_P (code) if (!CONVERT_EXPR_CODE_P (code)
&& ((code != PLUS_EXPR && code != POINTER_PLUS_EXPR) && ((code != PLUS_EXPR && code != POINTER_PLUS_EXPR)
|| TREE_CODE (gimple_assign_rhs2 (stmt)) != INTEGER_CST || TREE_CODE (gimple_assign_rhs2 (stmt)) != INTEGER_CST
|| !host_integerp (gimple_assign_rhs2 (stmt), 1))) || !tree_fits_uhwi_p (gimple_assign_rhs2 (stmt))))
return stmt; return stmt;
lhs = gimple_assign_rhs1 (stmt); lhs = gimple_assign_rhs1 (stmt);

View File

@ -4728,9 +4728,9 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
if (count == -1 if (count == -1
|| !index || !index
|| !TYPE_MAX_VALUE (index) || !TYPE_MAX_VALUE (index)
|| !host_integerp (TYPE_MAX_VALUE (index), 1) || !tree_fits_uhwi_p (TYPE_MAX_VALUE (index))
|| !TYPE_MIN_VALUE (index) || !TYPE_MIN_VALUE (index)
|| !host_integerp (TYPE_MIN_VALUE (index), 1) || !tree_fits_uhwi_p (TYPE_MIN_VALUE (index))
|| count < 0) || count < 0)
return -1; return -1;
@ -4738,7 +4738,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
- tree_low_cst (TYPE_MIN_VALUE (index), 1)); - tree_low_cst (TYPE_MIN_VALUE (index), 1));
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;
@ -4768,7 +4768,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
} }
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;
@ -4800,7 +4800,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
} }
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;

View File

@ -2758,7 +2758,7 @@ epiphany_special_round_type_align (tree type, unsigned computed,
continue; continue;
offset = bit_position (field); offset = bit_position (field);
size = DECL_SIZE (field); size = DECL_SIZE (field);
if (!host_integerp (offset, 1) || !host_integerp (size, 1) if (!tree_fits_uhwi_p (offset) || !tree_fits_uhwi_p (size)
|| TREE_INT_CST_LOW (offset) >= try_align || TREE_INT_CST_LOW (offset) >= try_align
|| TREE_INT_CST_LOW (size) >= try_align) || TREE_INT_CST_LOW (size) >= try_align)
return try_align; return try_align;
@ -2785,7 +2785,7 @@ epiphany_adjust_field_align (tree field, unsigned computed)
{ {
tree elmsz = TYPE_SIZE (TREE_TYPE (TREE_TYPE (field))); tree elmsz = TYPE_SIZE (TREE_TYPE (TREE_TYPE (field)));
if (!host_integerp (elmsz, 1) || tree_low_cst (elmsz, 1) >= 32) if (!tree_fits_uhwi_p (elmsz) || tree_low_cst (elmsz, 1) >= 32)
return 64; return 64;
} }
return computed; return computed;

View File

@ -32657,7 +32657,7 @@ get_element_number (tree vec_type, tree arg)
{ {
unsigned HOST_WIDE_INT elt, max = TYPE_VECTOR_SUBPARTS (vec_type) - 1; unsigned HOST_WIDE_INT elt, max = TYPE_VECTOR_SUBPARTS (vec_type) - 1;
if (!host_integerp (arg, 1) if (!tree_fits_uhwi_p (arg)
|| (elt = tree_low_cst (arg, 1), elt > max)) || (elt = tree_low_cst (arg, 1), elt > max))
{ {
error ("selector must be an integer constant in the range 0..%wi", max); error ("selector must be an integer constant in the range 0..%wi", max);

View File

@ -1279,7 +1279,7 @@ iq2000_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
if (! type || TREE_CODE (type) != RECORD_TYPE if (! type || TREE_CODE (type) != RECORD_TYPE
|| ! named || ! TYPE_SIZE_UNIT (type) || ! named || ! TYPE_SIZE_UNIT (type)
|| ! host_integerp (TYPE_SIZE_UNIT (type), 1)) || ! tree_fits_uhwi_p (TYPE_SIZE_UNIT (type)))
ret = gen_rtx_REG (mode, regbase + *arg_words + bias); ret = gen_rtx_REG (mode, regbase + *arg_words + bias);
else else
{ {

View File

@ -46,7 +46,7 @@ m32c_pragma_memregs (cpp_reader * reader ATTRIBUTE_UNUSED)
type = pragma_lex (&val); type = pragma_lex (&val);
if (type == CPP_NUMBER) if (type == CPP_NUMBER)
{ {
if (host_integerp (val, 1)) if (tree_fits_uhwi_p (val))
{ {
i = tree_low_cst (val, 1); i = tree_low_cst (val, 1);

View File

@ -232,7 +232,7 @@ mep_pragma_coprocessor_width (void)
switch (type) switch (type)
{ {
case CPP_NUMBER: case CPP_NUMBER:
if (! host_integerp (val, 1)) if (! tree_fits_uhwi_p (val))
break; break;
i = tree_low_cst (val, 1); i = tree_low_cst (val, 1);
/* This pragma no longer has any effect. */ /* This pragma no longer has any effect. */

View File

@ -5149,7 +5149,7 @@ mips_function_arg (cumulative_args_t cum_v, enum machine_mode mode,
&& type != 0 && type != 0
&& TREE_CODE (type) == RECORD_TYPE && TREE_CODE (type) == RECORD_TYPE
&& TYPE_SIZE_UNIT (type) && TYPE_SIZE_UNIT (type)
&& host_integerp (TYPE_SIZE_UNIT (type), 1)) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (type)))
{ {
tree field; tree field;

View File

@ -6125,7 +6125,7 @@ offsettable_ok_by_alignment (rtx op, HOST_WIDE_INT offset,
if (!DECL_SIZE_UNIT (decl)) if (!DECL_SIZE_UNIT (decl))
return false; return false;
if (!host_integerp (DECL_SIZE_UNIT (decl), 1)) if (!tree_fits_uhwi_p (DECL_SIZE_UNIT (decl)))
return false; return false;
dsize = tree_low_cst (DECL_SIZE_UNIT (decl), 1); dsize = tree_low_cst (DECL_SIZE_UNIT (decl), 1);
@ -6151,7 +6151,7 @@ offsettable_ok_by_alignment (rtx op, HOST_WIDE_INT offset,
if (TREE_CODE (decl) == STRING_CST) if (TREE_CODE (decl) == STRING_CST)
dsize = TREE_STRING_LENGTH (decl); dsize = TREE_STRING_LENGTH (decl);
else if (TYPE_SIZE_UNIT (type) else if (TYPE_SIZE_UNIT (type)
&& host_integerp (TYPE_SIZE_UNIT (type), 1)) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (type)))
dsize = tree_low_cst (TYPE_SIZE_UNIT (type), 1); dsize = tree_low_cst (TYPE_SIZE_UNIT (type), 1);
else else
return false; return false;
@ -8553,9 +8553,9 @@ rs6000_aggregate_candidate (const_tree type, enum machine_mode *modep)
if (count == -1 if (count == -1
|| !index || !index
|| !TYPE_MAX_VALUE (index) || !TYPE_MAX_VALUE (index)
|| !host_integerp (TYPE_MAX_VALUE (index), 1) || !tree_fits_uhwi_p (TYPE_MAX_VALUE (index))
|| !TYPE_MIN_VALUE (index) || !TYPE_MIN_VALUE (index)
|| !host_integerp (TYPE_MIN_VALUE (index), 1) || !tree_fits_uhwi_p (TYPE_MIN_VALUE (index))
|| count < 0) || count < 0)
return -1; return -1;
@ -8563,7 +8563,7 @@ rs6000_aggregate_candidate (const_tree type, enum machine_mode *modep)
- tree_low_cst (TYPE_MIN_VALUE (index), 1)); - tree_low_cst (TYPE_MIN_VALUE (index), 1));
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;
@ -8593,7 +8593,7 @@ rs6000_aggregate_candidate (const_tree type, enum machine_mode *modep)
} }
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;
@ -8625,7 +8625,7 @@ rs6000_aggregate_candidate (const_tree type, enum machine_mode *modep)
} }
/* There must be no padding. */ /* There must be no padding. */
if (!host_integerp (TYPE_SIZE (type), 1) if (!tree_fits_uhwi_p (TYPE_SIZE (type))
|| (tree_low_cst (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)
!= count * GET_MODE_BITSIZE (*modep))) != count * GET_MODE_BITSIZE (*modep)))
return -1; return -1;
@ -9159,7 +9159,7 @@ rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *cum,
mode = TYPE_MODE (ftype); mode = TYPE_MODE (ftype);
if (DECL_SIZE (f) != 0 if (DECL_SIZE (f) != 0
&& host_integerp (bit_position (f), 1)) && tree_fits_uhwi_p (bit_position (f)))
bitpos += int_bit_position (f); bitpos += int_bit_position (f);
/* ??? FIXME: else assume zero offset. */ /* ??? FIXME: else assume zero offset. */
@ -9641,7 +9641,7 @@ rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *cum, const_tree type,
mode = TYPE_MODE (ftype); mode = TYPE_MODE (ftype);
if (DECL_SIZE (f) != 0 if (DECL_SIZE (f) != 0
&& host_integerp (bit_position (f), 1)) && tree_fits_uhwi_p (bit_position (f)))
bitpos += int_bit_position (f); bitpos += int_bit_position (f);
/* ??? FIXME: else assume zero offset. */ /* ??? FIXME: else assume zero offset. */
@ -12386,7 +12386,7 @@ get_element_number (tree vec_type, tree arg)
{ {
unsigned HOST_WIDE_INT elt, max = TYPE_VECTOR_SUBPARTS (vec_type) - 1; unsigned HOST_WIDE_INT elt, max = TYPE_VECTOR_SUBPARTS (vec_type) - 1;
if (!host_integerp (arg, 1) if (!tree_fits_uhwi_p (arg)
|| (elt = tree_low_cst (arg, 1), elt > max)) || (elt = tree_low_cst (arg, 1), elt > max))
{ {
error ("selector must be an integer constant in the range 0..%wi", max); error ("selector must be an integer constant in the range 0..%wi", max);

View File

@ -6332,7 +6332,7 @@ function_arg_record_value_1 (const_tree type, HOST_WIDE_INT startbitpos,
if (integer_zerop (DECL_SIZE (field))) if (integer_zerop (DECL_SIZE (field)))
continue; continue;
if (host_integerp (bit_position (field), 1)) if (tree_fits_uhwi_p (bit_position (field)))
bitpos += int_bit_position (field); bitpos += int_bit_position (field);
} }
@ -6480,7 +6480,7 @@ function_arg_record_value_2 (const_tree type, HOST_WIDE_INT startbitpos,
if (integer_zerop (DECL_SIZE (field))) if (integer_zerop (DECL_SIZE (field)))
continue; continue;
if (host_integerp (bit_position (field), 1)) if (tree_fits_uhwi_p (bit_position (field)))
bitpos += int_bit_position (field); bitpos += int_bit_position (field);
} }

View File

@ -1,3 +1,8 @@
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* decl.c: Replace host_integerp (..., 1) with tree_fits_uhwi_p
throughout.
2013-11-18 Richard Sandiford <rdsandiford@googlemail.com> 2013-11-18 Richard Sandiford <rdsandiford@googlemail.com>
* error.c, init.c, parser.c, semantics.c: Replace * error.c, init.c, parser.c, semantics.c: Replace

View File

@ -5093,7 +5093,7 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d,
if (integer_all_onesp (max_index)) if (integer_all_onesp (max_index))
return new_init; return new_init;
if (host_integerp (max_index, 1)) if (tree_fits_uhwi_p (max_index))
max_index_cst = tree_low_cst (max_index, 1); max_index_cst = tree_low_cst (max_index, 1);
/* sizetype is sign extended, not zero extended. */ /* sizetype is sign extended, not zero extended. */
else else

View File

@ -1521,7 +1521,7 @@ dbxout_type_fields (tree type)
|| (TREE_CODE (tem) == FIELD_DECL || (TREE_CODE (tem) == FIELD_DECL
&& (! tree_fits_shwi_p (bit_position (tem)) && (! tree_fits_shwi_p (bit_position (tem))
|| ! DECL_SIZE (tem) || ! DECL_SIZE (tem)
|| ! host_integerp (DECL_SIZE (tem), 1)))) || ! tree_fits_uhwi_p (DECL_SIZE (tem)))))
continue; continue;
else if (TREE_CODE (tem) != CONST_DECL) else if (TREE_CODE (tem) != CONST_DECL)
@ -1864,7 +1864,7 @@ dbxout_type (tree type, int full)
Sun dbx crashes if we do. */ Sun dbx crashes if we do. */
if (! full || !COMPLETE_TYPE_P (type) if (! full || !COMPLETE_TYPE_P (type)
/* No way in DBX fmt to describe a variable size. */ /* No way in DBX fmt to describe a variable size. */
|| ! host_integerp (TYPE_SIZE (type), 1)) || ! tree_fits_uhwi_p (TYPE_SIZE (type)))
return; return;
break; break;
case TYPE_DEFINED: case TYPE_DEFINED:
@ -1889,7 +1889,7 @@ dbxout_type (tree type, int full)
&& !full) && !full)
|| !COMPLETE_TYPE_P (type) || !COMPLETE_TYPE_P (type)
/* No way in DBX fmt to describe a variable size. */ /* No way in DBX fmt to describe a variable size. */
|| ! host_integerp (TYPE_SIZE (type), 1)) || ! tree_fits_uhwi_p (TYPE_SIZE (type)))
{ {
typevec[TYPE_SYMTAB_ADDRESS (type)].status = TYPE_XREF; typevec[TYPE_SYMTAB_ADDRESS (type)].status = TYPE_XREF;
return; return;
@ -2147,7 +2147,7 @@ dbxout_type (tree type, int full)
&& !full) && !full)
|| !COMPLETE_TYPE_P (type) || !COMPLETE_TYPE_P (type)
/* No way in DBX fmt to describe a variable size. */ /* No way in DBX fmt to describe a variable size. */
|| ! host_integerp (TYPE_SIZE (type), 1)) || ! tree_fits_uhwi_p (TYPE_SIZE (type)))
{ {
/* If the type is just a cross reference, output one /* If the type is just a cross reference, output one
and mark the type as partially described. and mark the type as partially described.
@ -2796,7 +2796,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
/* Do not generate a tag for records of variable size, /* Do not generate a tag for records of variable size,
since this type can not be properly described in the since this type can not be properly described in the
DBX format, and it confuses some tools such as objdump. */ DBX format, and it confuses some tools such as objdump. */
&& host_integerp (TYPE_SIZE (type), 1)) && tree_fits_uhwi_p (TYPE_SIZE (type)))
{ {
tree name = TYPE_NAME (type); tree name = TYPE_NAME (type);
if (TREE_CODE (name) == TYPE_DECL) if (TREE_CODE (name) == TYPE_DECL)

View File

@ -10261,7 +10261,7 @@ simple_type_size_in_bits (const_tree type)
return BITS_PER_WORD; return BITS_PER_WORD;
else if (TYPE_SIZE (type) == NULL_TREE) else if (TYPE_SIZE (type) == NULL_TREE)
return 0; return 0;
else if (host_integerp (TYPE_SIZE (type), 1)) else if (tree_fits_uhwi_p (TYPE_SIZE (type)))
return tree_low_cst (TYPE_SIZE (type), 1); return tree_low_cst (TYPE_SIZE (type), 1);
else else
return TYPE_ALIGN (type); return TYPE_ALIGN (type);
@ -13540,7 +13540,7 @@ dw_sra_loc_expr (tree decl, rtx loc)
enum var_init_status initialized; enum var_init_status initialized;
if (DECL_SIZE (decl) == NULL if (DECL_SIZE (decl) == NULL
|| !host_integerp (DECL_SIZE (decl), 1)) || !tree_fits_uhwi_p (DECL_SIZE (decl)))
return NULL; return NULL;
decl_size = tree_low_cst (DECL_SIZE (decl), 1); decl_size = tree_low_cst (DECL_SIZE (decl), 1);
@ -16395,7 +16395,7 @@ add_bit_offset_attribute (dw_die_ref die, tree decl)
encounter such things, just return without generating any attribute encounter such things, just return without generating any attribute
whatsoever. Likewise for variable or too large size. */ whatsoever. Likewise for variable or too large size. */
if (! tree_fits_shwi_p (bit_position (decl)) if (! tree_fits_shwi_p (bit_position (decl))
|| ! host_integerp (DECL_SIZE (decl), 1)) || ! tree_fits_uhwi_p (DECL_SIZE (decl)))
return; return;
bitpos_int = int_bit_position (decl); bitpos_int = int_bit_position (decl);
@ -16435,7 +16435,7 @@ add_bit_size_attribute (dw_die_ref die, tree decl)
gcc_assert (TREE_CODE (decl) == FIELD_DECL gcc_assert (TREE_CODE (decl) == FIELD_DECL
&& DECL_BIT_FIELD_TYPE (decl)); && DECL_BIT_FIELD_TYPE (decl));
if (host_integerp (DECL_SIZE (decl), 1)) if (tree_fits_uhwi_p (DECL_SIZE (decl)))
add_AT_unsigned (die, DW_AT_bit_size, tree_low_cst (DECL_SIZE (decl), 1)); add_AT_unsigned (die, DW_AT_bit_size, tree_low_cst (DECL_SIZE (decl), 1));
} }
@ -17072,7 +17072,7 @@ descr_info_loc (tree val, tree base_decl)
return loc; return loc;
case POINTER_PLUS_EXPR: case POINTER_PLUS_EXPR:
case PLUS_EXPR: case PLUS_EXPR:
if (host_integerp (TREE_OPERAND (val, 1), 1) if (tree_fits_uhwi_p (TREE_OPERAND (val, 1))
&& (unsigned HOST_WIDE_INT) tree_low_cst (TREE_OPERAND (val, 1), 1) && (unsigned HOST_WIDE_INT) tree_low_cst (TREE_OPERAND (val, 1), 1)
< 16384) < 16384)
{ {

View File

@ -1541,8 +1541,8 @@ get_mem_align_offset (rtx mem, unsigned int align)
tree bit_offset = DECL_FIELD_BIT_OFFSET (field); tree bit_offset = DECL_FIELD_BIT_OFFSET (field);
if (!byte_offset if (!byte_offset
|| !host_integerp (byte_offset, 1) || !tree_fits_uhwi_p (byte_offset)
|| !host_integerp (bit_offset, 1)) || !tree_fits_uhwi_p (bit_offset))
return -1; return -1;
offset += tree_low_cst (byte_offset, 1); offset += tree_low_cst (byte_offset, 1);
@ -1770,7 +1770,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
{ {
attrs.expr = t2; attrs.expr = t2;
attrs.offset_known_p = false; attrs.offset_known_p = false;
if (host_integerp (off_tree, 1)) if (tree_fits_uhwi_p (off_tree))
{ {
attrs.offset_known_p = true; attrs.offset_known_p = true;
attrs.offset = tree_low_cst (off_tree, 1); attrs.offset = tree_low_cst (off_tree, 1);
@ -1800,7 +1800,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
attrs.align = MAX (attrs.align, obj_align); attrs.align = MAX (attrs.align, obj_align);
} }
if (host_integerp (new_size, 1)) if (tree_fits_uhwi_p (new_size))
{ {
attrs.size_known_p = true; attrs.size_known_p = true;
attrs.size = tree_low_cst (new_size, 1); attrs.size = tree_low_cst (new_size, 1);
@ -2273,7 +2273,7 @@ widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset)
&& attrs.offset >= 0) && attrs.offset >= 0)
break; break;
if (! host_integerp (offset, 1)) if (! tree_fits_uhwi_p (offset))
{ {
attrs.expr = NULL_TREE; attrs.expr = NULL_TREE;
break; break;

View File

@ -4628,8 +4628,8 @@ get_bit_range (unsigned HOST_WIDE_INT *bitstart,
relative to the representative. DECL_FIELD_OFFSET of field and relative to the representative. DECL_FIELD_OFFSET of field and
repr are the same by construction if they are not constants, repr are the same by construction if they are not constants,
see finish_bitfield_layout. */ see finish_bitfield_layout. */
if (host_integerp (DECL_FIELD_OFFSET (field), 1) if (tree_fits_uhwi_p (DECL_FIELD_OFFSET (field))
&& host_integerp (DECL_FIELD_OFFSET (repr), 1)) && tree_fits_uhwi_p (DECL_FIELD_OFFSET (repr)))
bitoffset = (tree_low_cst (DECL_FIELD_OFFSET (field), 1) bitoffset = (tree_low_cst (DECL_FIELD_OFFSET (field), 1)
- tree_low_cst (DECL_FIELD_OFFSET (repr), 1)) * BITS_PER_UNIT; - tree_low_cst (DECL_FIELD_OFFSET (repr), 1)) * BITS_PER_UNIT;
else else
@ -5470,7 +5470,7 @@ count_type_elements (const_tree type, bool for_ctor_p)
tree nelts; tree nelts;
nelts = array_type_nelts (type); nelts = array_type_nelts (type);
if (nelts && host_integerp (nelts, 1)) if (nelts && tree_fits_uhwi_p (nelts))
{ {
unsigned HOST_WIDE_INT n; unsigned HOST_WIDE_INT n;
@ -5589,7 +5589,7 @@ categorize_ctor_elements_1 (const_tree ctor, HOST_WIDE_INT *p_nz_elts,
tree lo_index = TREE_OPERAND (purpose, 0); tree lo_index = TREE_OPERAND (purpose, 0);
tree hi_index = TREE_OPERAND (purpose, 1); tree hi_index = TREE_OPERAND (purpose, 1);
if (host_integerp (lo_index, 1) && host_integerp (hi_index, 1)) if (tree_fits_uhwi_p (lo_index) && tree_fits_uhwi_p (hi_index))
mult = (tree_low_cst (hi_index, 1) mult = (tree_low_cst (hi_index, 1)
- tree_low_cst (lo_index, 1) + 1); - tree_low_cst (lo_index, 1) + 1);
} }
@ -5908,7 +5908,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
if (cleared && initializer_zerop (value)) if (cleared && initializer_zerop (value))
continue; continue;
if (host_integerp (DECL_SIZE (field), 1)) if (tree_fits_uhwi_p (DECL_SIZE (field)))
bitsize = tree_low_cst (DECL_SIZE (field), 1); bitsize = tree_low_cst (DECL_SIZE (field), 1);
else else
bitsize = -1; bitsize = -1;
@ -6047,8 +6047,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
tree lo_index = TREE_OPERAND (index, 0); tree lo_index = TREE_OPERAND (index, 0);
tree hi_index = TREE_OPERAND (index, 1); tree hi_index = TREE_OPERAND (index, 1);
if (! host_integerp (lo_index, 1) if (! tree_fits_uhwi_p (lo_index)
|| ! host_integerp (hi_index, 1)) || ! tree_fits_uhwi_p (hi_index))
{ {
need_to_clear = 1; need_to_clear = 1;
break; break;
@ -6102,7 +6102,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
mode = TYPE_MODE (elttype); mode = TYPE_MODE (elttype);
if (mode == BLKmode) if (mode == BLKmode)
bitsize = (host_integerp (TYPE_SIZE (elttype), 1) bitsize = (tree_fits_uhwi_p (TYPE_SIZE (elttype))
? tree_low_cst (TYPE_SIZE (elttype), 1) ? tree_low_cst (TYPE_SIZE (elttype), 1)
: -1); : -1);
else else
@ -6125,7 +6125,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
count = hi - lo + 1, count = hi - lo + 1,
(!MEM_P (target) (!MEM_P (target)
|| count <= 2 || count <= 2
|| (host_integerp (TYPE_SIZE (elttype), 1) || (tree_fits_uhwi_p (TYPE_SIZE (elttype))
&& (tree_low_cst (TYPE_SIZE (elttype), 1) * count && (tree_low_cst (TYPE_SIZE (elttype), 1) * count
<= 40 * 8))))) <= 40 * 8)))))
{ {
@ -6208,7 +6208,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
} }
} }
else if ((index != 0 && ! tree_fits_shwi_p (index)) else if ((index != 0 && ! tree_fits_shwi_p (index))
|| ! host_integerp (TYPE_SIZE (elttype), 1)) || ! tree_fits_uhwi_p (TYPE_SIZE (elttype)))
{ {
tree position; tree position;
@ -6676,7 +6676,7 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
if (size_tree != 0) if (size_tree != 0)
{ {
if (! host_integerp (size_tree, 1)) if (! tree_fits_uhwi_p (size_tree))
mode = BLKmode, *pbitsize = -1; mode = BLKmode, *pbitsize = -1;
else else
*pbitsize = tree_low_cst (size_tree, 1); *pbitsize = tree_low_cst (size_tree, 1);
@ -7756,7 +7756,7 @@ expand_constructor (tree exp, rtx target, enum expand_modifier modifier,
&& ((mode == BLKmode && ((mode == BLKmode
&& ! (target != 0 && safe_from_p (target, exp, 1))) && ! (target != 0 && safe_from_p (target, exp, 1)))
|| TREE_ADDRESSABLE (exp) || TREE_ADDRESSABLE (exp)
|| (host_integerp (TYPE_SIZE_UNIT (type), 1) || (tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
&& (! MOVE_BY_PIECES_P && (! MOVE_BY_PIECES_P
(tree_low_cst (TYPE_SIZE_UNIT (type), 1), (tree_low_cst (TYPE_SIZE_UNIT (type), 1),
TYPE_ALIGN (type))) TYPE_ALIGN (type)))
@ -9633,7 +9633,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
HOST_WIDE_INT offset = mem_ref_offset (exp).low; HOST_WIDE_INT offset = mem_ref_offset (exp).low;
base = TREE_OPERAND (base, 0); base = TREE_OPERAND (base, 0);
if (offset == 0 if (offset == 0
&& host_integerp (TYPE_SIZE (type), 1) && tree_fits_uhwi_p (TYPE_SIZE (type))
&& (GET_MODE_BITSIZE (DECL_MODE (base)) && (GET_MODE_BITSIZE (DECL_MODE (base))
== TREE_INT_CST_LOW (TYPE_SIZE (type)))) == TREE_INT_CST_LOW (TYPE_SIZE (type))))
return expand_expr (build1 (VIEW_CONVERT_EXPR, type, base), return expand_expr (build1 (VIEW_CONVERT_EXPR, type, base),
@ -10558,7 +10558,7 @@ is_aligning_offset (const_tree offset, const_tree exp)
/* We must now have a BIT_AND_EXPR with a constant that is one less than /* We must now have a BIT_AND_EXPR with a constant that is one less than
power of 2 and which is larger than BIGGEST_ALIGNMENT. */ power of 2 and which is larger than BIGGEST_ALIGNMENT. */
if (TREE_CODE (offset) != BIT_AND_EXPR if (TREE_CODE (offset) != BIT_AND_EXPR
|| !host_integerp (TREE_OPERAND (offset, 1), 1) || !tree_fits_uhwi_p (TREE_OPERAND (offset, 1))
|| compare_tree_int (TREE_OPERAND (offset, 1), || compare_tree_int (TREE_OPERAND (offset, 1),
BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0 BIGGEST_ALIGNMENT / BITS_PER_UNIT) <= 0
|| !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0) || !exact_log2 (tree_low_cst (TREE_OPERAND (offset, 1), 1) + 1) < 0)
@ -10696,7 +10696,7 @@ string_constant (tree arg, tree *ptr_offset)
and inside of the bounds of the string literal. */ and inside of the bounds of the string literal. */
offset = fold_convert (sizetype, offset); offset = fold_convert (sizetype, offset);
if (compare_tree_int (DECL_SIZE_UNIT (array), length) > 0 if (compare_tree_int (DECL_SIZE_UNIT (array), length) > 0
&& (! host_integerp (offset, 1) && (! tree_fits_uhwi_p (offset)
|| compare_tree_int (offset, length) >= 0)) || compare_tree_int (offset, length) >= 0))
return 0; return 0;

View File

@ -1430,7 +1430,7 @@ const_binop (enum tree_code code, tree arg1, tree arg2)
if (code == VEC_LSHIFT_EXPR if (code == VEC_LSHIFT_EXPR
|| code == VEC_RSHIFT_EXPR) || code == VEC_RSHIFT_EXPR)
{ {
if (!host_integerp (arg2, 1)) if (!tree_fits_uhwi_p (arg2))
return NULL_TREE; return NULL_TREE;
unsigned HOST_WIDE_INT shiftc = tree_low_cst (arg2, 1); unsigned HOST_WIDE_INT shiftc = tree_low_cst (arg2, 1);
@ -6643,7 +6643,7 @@ fold_single_bit_test (location_t loc, enum tree_code code,
not overflow, adjust BITNUM and INNER. */ not overflow, adjust BITNUM and INNER. */
if (TREE_CODE (inner) == RSHIFT_EXPR if (TREE_CODE (inner) == RSHIFT_EXPR
&& TREE_CODE (TREE_OPERAND (inner, 1)) == INTEGER_CST && TREE_CODE (TREE_OPERAND (inner, 1)) == INTEGER_CST
&& host_integerp (TREE_OPERAND (inner, 1), 1) && tree_fits_uhwi_p (TREE_OPERAND (inner, 1))
&& bitnum < TYPE_PRECISION (type) && bitnum < TYPE_PRECISION (type)
&& (TREE_INT_CST_LOW (TREE_OPERAND (inner, 1)) && (TREE_INT_CST_LOW (TREE_OPERAND (inner, 1))
< (unsigned) (TYPE_PRECISION (type) - bitnum))) < (unsigned) (TYPE_PRECISION (type) - bitnum)))
@ -8098,7 +8098,7 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
change = 1; change = 1;
else if (TYPE_PRECISION (TREE_TYPE (and1)) else if (TYPE_PRECISION (TREE_TYPE (and1))
<= HOST_BITS_PER_WIDE_INT <= HOST_BITS_PER_WIDE_INT
&& host_integerp (and1, 1)) && tree_fits_uhwi_p (and1))
{ {
unsigned HOST_WIDE_INT cst; unsigned HOST_WIDE_INT cst;
@ -11864,7 +11864,7 @@ fold_binary_loc (location_t loc,
and for - instead of + (or unary - instead of +) and for - instead of + (or unary - instead of +)
and/or ^ instead of |. and/or ^ instead of |.
If B is constant and (B & M) == 0, fold into A & M. */ If B is constant and (B & M) == 0, fold into A & M. */
if (host_integerp (arg1, 1)) if (tree_fits_uhwi_p (arg1))
{ {
unsigned HOST_WIDE_INT cst1 = tree_low_cst (arg1, 1); unsigned HOST_WIDE_INT cst1 = tree_low_cst (arg1, 1);
if (~cst1 && (cst1 & (cst1 + 1)) == 0 if (~cst1 && (cst1 & (cst1 + 1)) == 0
@ -11890,7 +11890,7 @@ fold_binary_loc (location_t loc,
which = 1; which = 1;
} }
if (!host_integerp (TYPE_MAX_VALUE (TREE_TYPE (arg0)), 1) if (!tree_fits_uhwi_p (TYPE_MAX_VALUE (TREE_TYPE (arg0)))
|| (tree_low_cst (TYPE_MAX_VALUE (TREE_TYPE (arg0)), 1) || (tree_low_cst (TYPE_MAX_VALUE (TREE_TYPE (arg0)), 1)
& cst1) != cst1) & cst1) != cst1)
which = -1; which = -1;
@ -12013,7 +12013,7 @@ fold_binary_loc (location_t loc,
/* If arg0 is derived from the address of an object or function, we may /* If arg0 is derived from the address of an object or function, we may
be able to fold this expression using the object or function's be able to fold this expression using the object or function's
alignment. */ alignment. */
if (POINTER_TYPE_P (TREE_TYPE (arg0)) && host_integerp (arg1, 1)) if (POINTER_TYPE_P (TREE_TYPE (arg0)) && tree_fits_uhwi_p (arg1))
{ {
unsigned HOST_WIDE_INT modulus, residue; unsigned HOST_WIDE_INT modulus, residue;
unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (arg1); unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (arg1);
@ -12035,7 +12035,7 @@ fold_binary_loc (location_t loc,
|| TREE_CODE (arg0) == RSHIFT_EXPR) || TREE_CODE (arg0) == RSHIFT_EXPR)
&& TYPE_PRECISION (TREE_TYPE (arg0)) <= HOST_BITS_PER_WIDE_INT && TYPE_PRECISION (TREE_TYPE (arg0)) <= HOST_BITS_PER_WIDE_INT
&& TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST
&& host_integerp (TREE_OPERAND (arg0, 1), 1) && tree_fits_uhwi_p (TREE_OPERAND (arg0, 1))
&& tree_low_cst (TREE_OPERAND (arg0, 1), 1) > 0 && tree_low_cst (TREE_OPERAND (arg0, 1), 1) > 0
&& (tree_low_cst (TREE_OPERAND (arg0, 1), 1) && (tree_low_cst (TREE_OPERAND (arg0, 1), 1)
< TYPE_PRECISION (TREE_TYPE (arg0)))) < TYPE_PRECISION (TREE_TYPE (arg0))))
@ -12646,9 +12646,9 @@ fold_binary_loc (location_t loc,
prec = element_precision (type); prec = element_precision (type);
/* Turn (a OP c1) OP c2 into a OP (c1+c2). */ /* Turn (a OP c1) OP c2 into a OP (c1+c2). */
if (TREE_CODE (op0) == code && host_integerp (arg1, true) if (TREE_CODE (op0) == code && tree_fits_uhwi_p (arg1)
&& TREE_INT_CST_LOW (arg1) < prec && TREE_INT_CST_LOW (arg1) < prec
&& host_integerp (TREE_OPERAND (arg0, 1), true) && tree_fits_uhwi_p (TREE_OPERAND (arg0, 1))
&& TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) < prec) && TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) < prec)
{ {
unsigned int low = (TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) unsigned int low = (TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1))
@ -14584,7 +14584,7 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type,
fold (nearly) all BIT_FIELD_REFs. */ fold (nearly) all BIT_FIELD_REFs. */
if (CONSTANT_CLASS_P (arg0) if (CONSTANT_CLASS_P (arg0)
&& can_native_interpret_type_p (type) && can_native_interpret_type_p (type)
&& host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (arg0)), 1) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (TREE_TYPE (arg0)))
/* This limitation should not be necessary, we just need to /* This limitation should not be necessary, we just need to
round this up to mode size. */ round this up to mode size. */
&& tree_low_cst (op1, 1) % BITS_PER_UNIT == 0 && tree_low_cst (op1, 1) % BITS_PER_UNIT == 0

View File

@ -3813,7 +3813,7 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
{ {
tree s2 = sizetree; tree s2 = sizetree;
if (where_pad != none if (where_pad != none
&& (!host_integerp (sizetree, 1) && (!tree_fits_uhwi_p (sizetree)
|| (tree_low_cst (sizetree, 1) * BITS_PER_UNIT) % round_boundary)) || (tree_low_cst (sizetree, 1) * BITS_PER_UNIT) % round_boundary))
s2 = round_up (s2, round_boundary / BITS_PER_UNIT); s2 = round_up (s2, round_boundary / BITS_PER_UNIT);
SUB_PARM_SIZE (locate->slot_offset, s2); SUB_PARM_SIZE (locate->slot_offset, s2);
@ -3858,7 +3858,7 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
pad_below (&locate->offset, passed_mode, sizetree); pad_below (&locate->offset, passed_mode, sizetree);
if (where_pad != none if (where_pad != none
&& (!host_integerp (sizetree, 1) && (!tree_fits_uhwi_p (sizetree)
|| (tree_low_cst (sizetree, 1) * BITS_PER_UNIT) % round_boundary)) || (tree_low_cst (sizetree, 1) * BITS_PER_UNIT) % round_boundary))
sizetree = round_up (sizetree, round_boundary / BITS_PER_UNIT); sizetree = round_up (sizetree, round_boundary / BITS_PER_UNIT);

View File

@ -3057,7 +3057,7 @@ fold_const_aggregate_ref_1 (tree t, tree (*valueize) (tree))
if ((low_bound = array_ref_low_bound (t), if ((low_bound = array_ref_low_bound (t),
TREE_CODE (low_bound) == INTEGER_CST) TREE_CODE (low_bound) == INTEGER_CST)
&& (unit_size = array_ref_element_size (t), && (unit_size = array_ref_element_size (t),
host_integerp (unit_size, 1)) tree_fits_uhwi_p (unit_size))
&& (doffset = (TREE_INT_CST (idx) - TREE_INT_CST (low_bound)) && (doffset = (TREE_INT_CST (idx) - TREE_INT_CST (low_bound))
.sext (TYPE_PRECISION (TREE_TYPE (idx))), .sext (TYPE_PRECISION (TREE_TYPE (idx))),
doffset.fits_shwi ())) doffset.fits_shwi ()))
@ -3401,7 +3401,7 @@ gimple_fold_indirect_ref (tree t)
if (TREE_CODE (addr) == ADDR_EXPR if (TREE_CODE (addr) == ADDR_EXPR
&& TREE_CODE (TREE_TYPE (addrtype)) == VECTOR_TYPE && TREE_CODE (TREE_TYPE (addrtype)) == VECTOR_TYPE
&& useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (addrtype))) && useless_type_conversion_p (type, TREE_TYPE (TREE_TYPE (addrtype)))
&& host_integerp (off, 1)) && tree_fits_uhwi_p (off))
{ {
unsigned HOST_WIDE_INT offset = tree_low_cst (off, 1); unsigned HOST_WIDE_INT offset = tree_low_cst (off, 1);
tree part_width = TYPE_SIZE (type); tree part_width = TYPE_SIZE (type);

View File

@ -538,7 +538,7 @@ gimple_add_tmp_var (tree tmp)
/* Later processing assumes that the object size is constant, which might /* Later processing assumes that the object size is constant, which might
not be true at this point. Force the use of a constant upper bound in not be true at this point. Force the use of a constant upper bound in
this case. */ this case. */
if (!host_integerp (DECL_SIZE_UNIT (tmp), 1)) if (!tree_fits_uhwi_p (DECL_SIZE_UNIT (tmp)))
force_constant_size (tmp); force_constant_size (tmp);
DECL_CONTEXT (tmp) = current_function_decl; DECL_CONTEXT (tmp) = current_function_decl;

View File

@ -984,7 +984,7 @@ go_output_typedef (struct godump_container *container, tree decl)
if (tree_fits_shwi_p (TREE_VALUE (element))) if (tree_fits_shwi_p (TREE_VALUE (element)))
snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DEC, snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DEC,
tree_low_cst (TREE_VALUE (element), 0)); tree_low_cst (TREE_VALUE (element), 0));
else if (host_integerp (TREE_VALUE (element), 1)) else if (tree_fits_uhwi_p (TREE_VALUE (element)))
snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_UNSIGNED, snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_UNSIGNED,
((unsigned HOST_WIDE_INT) ((unsigned HOST_WIDE_INT)
tree_low_cst (TREE_VALUE (element), 1))); tree_low_cst (TREE_VALUE (element), 1)));

View File

@ -1264,7 +1264,7 @@ type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta)
fld = TYPE_FIELDS (type); fld = TYPE_FIELDS (type);
if (!fld || !POINTER_TYPE_P (TREE_TYPE (fld)) if (!fld || !POINTER_TYPE_P (TREE_TYPE (fld))
|| TREE_CODE (TREE_TYPE (TREE_TYPE (fld))) != METHOD_TYPE || TREE_CODE (TREE_TYPE (TREE_TYPE (fld))) != METHOD_TYPE
|| !host_integerp (DECL_FIELD_OFFSET (fld), 1)) || !tree_fits_uhwi_p (DECL_FIELD_OFFSET (fld)))
return false; return false;
if (method_ptr) if (method_ptr)
@ -1272,7 +1272,7 @@ type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta)
fld = DECL_CHAIN (fld); fld = DECL_CHAIN (fld);
if (!fld || INTEGRAL_TYPE_P (fld) if (!fld || INTEGRAL_TYPE_P (fld)
|| !host_integerp (DECL_FIELD_OFFSET (fld), 1)) || !tree_fits_uhwi_p (DECL_FIELD_OFFSET (fld)))
return false; return false;
if (delta) if (delta)
*delta = fld; *delta = fld;
@ -1342,7 +1342,7 @@ determine_known_aggregate_parts (gimple call, tree arg,
if (TREE_CODE (arg) == SSA_NAME) if (TREE_CODE (arg) == SSA_NAME)
{ {
tree type_size; tree type_size;
if (!host_integerp (TYPE_SIZE (TREE_TYPE (TREE_TYPE (arg))), 1)) if (!tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (TREE_TYPE (arg)))))
return; return;
check_ref = true; check_ref = true;
arg_base = arg; arg_base = arg;

View File

@ -6769,7 +6769,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
else else
{ {
safelen = OMP_CLAUSE_SAFELEN_EXPR (safelen); safelen = OMP_CLAUSE_SAFELEN_EXPR (safelen);
if (!host_integerp (safelen, 1) if (!tree_fits_uhwi_p (safelen)
|| (unsigned HOST_WIDE_INT) tree_low_cst (safelen, 1) || (unsigned HOST_WIDE_INT) tree_low_cst (safelen, 1)
> INT_MAX) > INT_MAX)
loop->safelen = INT_MAX; loop->safelen = INT_MAX;

View File

@ -1557,7 +1557,7 @@ predict_loops (void)
if (TREE_CODE (niter) == INTEGER_CST) if (TREE_CODE (niter) == INTEGER_CST)
{ {
if (host_integerp (niter, 1) if (tree_fits_uhwi_p (niter)
&& max && max
&& compare_tree_int (niter, max - 1) == -1) && compare_tree_int (niter, max - 1) == -1)
nitercst = tree_low_cst (niter, 1) + 1; nitercst = tree_low_cst (niter, 1) + 1;

View File

@ -994,7 +994,7 @@ sdbout_field_types (tree type)
if (TREE_CODE (tail) == FIELD_DECL if (TREE_CODE (tail) == FIELD_DECL
&& DECL_NAME (tail) && DECL_NAME (tail)
&& DECL_SIZE (tail) && DECL_SIZE (tail)
&& host_integerp (DECL_SIZE (tail), 1) && tree_fits_uhwi_p (DECL_SIZE (tail))
&& tree_fits_shwi_p (bit_position (tail))) && tree_fits_shwi_p (bit_position (tail)))
{ {
if (POINTER_TYPE_P (TREE_TYPE (tail))) if (POINTER_TYPE_P (TREE_TYPE (tail)))
@ -1173,7 +1173,7 @@ sdbout_one_type (tree type)
if (TREE_CODE (tem) == FIELD_DECL if (TREE_CODE (tem) == FIELD_DECL
&& DECL_NAME (tem) && DECL_NAME (tem)
&& DECL_SIZE (tem) && DECL_SIZE (tem)
&& host_integerp (DECL_SIZE (tem), 1) && tree_fits_uhwi_p (DECL_SIZE (tem))
&& tree_fits_shwi_p (bit_position (tem))) && tree_fits_shwi_p (bit_position (tem)))
{ {
const char *name; const char *name;

View File

@ -854,7 +854,7 @@ expand_switch_as_decision_tree_p (tree range,
who knows... */ who knows... */
max_ratio = optimize_insn_for_size_p () ? 3 : 10; max_ratio = optimize_insn_for_size_p () ? 3 : 10;
if (count < case_values_threshold () if (count < case_values_threshold ()
|| ! host_integerp (range, /*pos=*/1) || ! tree_fits_uhwi_p (range)
|| compare_tree_int (range, max_ratio * count) > 0) || compare_tree_int (range, max_ratio * count) > 0)
return true; return true;

View File

@ -332,7 +332,7 @@ mode_for_size_tree (const_tree size, enum mode_class mclass, int limit)
unsigned HOST_WIDE_INT uhwi; unsigned HOST_WIDE_INT uhwi;
unsigned int ui; unsigned int ui;
if (!host_integerp (size, 1)) if (!tree_fits_uhwi_p (size))
return BLKmode; return BLKmode;
uhwi = tree_low_cst (size, 1); uhwi = tree_low_cst (size, 1);
ui = uhwi; ui = uhwi;
@ -483,7 +483,7 @@ mode_for_array (tree elem_type, tree size)
return TYPE_MODE (elem_type); return TYPE_MODE (elem_type);
limit_p = true; limit_p = true;
if (host_integerp (size, 1) && host_integerp (elem_size, 1)) if (tree_fits_uhwi_p (size) && tree_fits_uhwi_p (elem_size))
{ {
int_size = tree_low_cst (size, 1); int_size = tree_low_cst (size, 1);
int_elem_size = tree_low_cst (elem_size, 1); int_elem_size = tree_low_cst (elem_size, 1);
@ -1117,7 +1117,7 @@ place_field (record_layout_info rli, tree field)
& - tree_low_cst (rli->bitpos, 1)); & - tree_low_cst (rli->bitpos, 1));
else if (integer_zerop (rli->offset)) else if (integer_zerop (rli->offset))
known_align = 0; known_align = 0;
else if (host_integerp (rli->offset, 1)) else if (tree_fits_uhwi_p (rli->offset))
known_align = (BITS_PER_UNIT known_align = (BITS_PER_UNIT
* (tree_low_cst (rli->offset, 1) * (tree_low_cst (rli->offset, 1)
& - tree_low_cst (rli->offset, 1))); & - tree_low_cst (rli->offset, 1)));
@ -1194,9 +1194,9 @@ place_field (record_layout_info rli, tree field)
|| TYPE_ALIGN (type) <= BITS_PER_UNIT) || TYPE_ALIGN (type) <= BITS_PER_UNIT)
&& maximum_field_alignment == 0 && maximum_field_alignment == 0
&& ! integer_zerop (DECL_SIZE (field)) && ! integer_zerop (DECL_SIZE (field))
&& host_integerp (DECL_SIZE (field), 1) && tree_fits_uhwi_p (DECL_SIZE (field))
&& host_integerp (rli->offset, 1) && tree_fits_uhwi_p (rli->offset)
&& host_integerp (TYPE_SIZE (type), 1)) && tree_fits_uhwi_p (TYPE_SIZE (type)))
{ {
unsigned int type_align = TYPE_ALIGN (type); unsigned int type_align = TYPE_ALIGN (type);
tree dsize = DECL_SIZE (field); tree dsize = DECL_SIZE (field);
@ -1238,9 +1238,9 @@ place_field (record_layout_info rli, tree field)
&& DECL_BIT_FIELD_TYPE (field) && DECL_BIT_FIELD_TYPE (field)
&& ! DECL_PACKED (field) && ! DECL_PACKED (field)
&& ! integer_zerop (DECL_SIZE (field)) && ! integer_zerop (DECL_SIZE (field))
&& host_integerp (DECL_SIZE (field), 1) && tree_fits_uhwi_p (DECL_SIZE (field))
&& host_integerp (rli->offset, 1) && tree_fits_uhwi_p (rli->offset)
&& host_integerp (TYPE_SIZE (type), 1)) && tree_fits_uhwi_p (TYPE_SIZE (type)))
{ {
unsigned int type_align = TYPE_ALIGN (type); unsigned int type_align = TYPE_ALIGN (type);
tree dsize = DECL_SIZE (field); tree dsize = DECL_SIZE (field);
@ -1383,8 +1383,8 @@ place_field (record_layout_info rli, tree field)
until we see a bitfield (and come by here again) we just skip until we see a bitfield (and come by here again) we just skip
calculating it. */ calculating it. */
if (DECL_SIZE (field) != NULL if (DECL_SIZE (field) != NULL
&& host_integerp (TYPE_SIZE (TREE_TYPE (field)), 1) && tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (field)))
&& host_integerp (DECL_SIZE (field), 1)) && tree_fits_uhwi_p (DECL_SIZE (field)))
{ {
unsigned HOST_WIDE_INT bitsize unsigned HOST_WIDE_INT bitsize
= tree_low_cst (DECL_SIZE (field), 1); = tree_low_cst (DECL_SIZE (field), 1);
@ -1425,7 +1425,7 @@ place_field (record_layout_info rli, tree field)
& - tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1)); & - tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1));
else if (integer_zerop (DECL_FIELD_OFFSET (field))) else if (integer_zerop (DECL_FIELD_OFFSET (field)))
actual_align = MAX (BIGGEST_ALIGNMENT, rli->record_align); actual_align = MAX (BIGGEST_ALIGNMENT, rli->record_align);
else if (host_integerp (DECL_FIELD_OFFSET (field), 1)) else if (tree_fits_uhwi_p (DECL_FIELD_OFFSET (field)))
actual_align = (BITS_PER_UNIT actual_align = (BITS_PER_UNIT
* (tree_low_cst (DECL_FIELD_OFFSET (field), 1) * (tree_low_cst (DECL_FIELD_OFFSET (field), 1)
& - tree_low_cst (DECL_FIELD_OFFSET (field), 1))); & - tree_low_cst (DECL_FIELD_OFFSET (field), 1)));
@ -1584,7 +1584,7 @@ compute_record_mode (tree type)
line. */ line. */
SET_TYPE_MODE (type, BLKmode); SET_TYPE_MODE (type, BLKmode);
if (! host_integerp (TYPE_SIZE (type), 1)) if (! tree_fits_uhwi_p (TYPE_SIZE (type)))
return; return;
/* A record which has any BLKmode members must itself be /* A record which has any BLKmode members must itself be
@ -1600,9 +1600,9 @@ compute_record_mode (tree type)
&& ! TYPE_NO_FORCE_BLK (TREE_TYPE (field)) && ! TYPE_NO_FORCE_BLK (TREE_TYPE (field))
&& !(TYPE_SIZE (TREE_TYPE (field)) != 0 && !(TYPE_SIZE (TREE_TYPE (field)) != 0
&& integer_zerop (TYPE_SIZE (TREE_TYPE (field))))) && integer_zerop (TYPE_SIZE (TREE_TYPE (field)))))
|| ! host_integerp (bit_position (field), 1) || ! tree_fits_uhwi_p (bit_position (field))
|| DECL_SIZE (field) == 0 || DECL_SIZE (field) == 0
|| ! host_integerp (DECL_SIZE (field), 1)) || ! tree_fits_uhwi_p (DECL_SIZE (field)))
return; return;
/* If this field is the whole struct, remember its mode so /* If this field is the whole struct, remember its mode so
@ -1621,7 +1621,7 @@ compute_record_mode (tree type)
matches the type's size. This only applies to RECORD_TYPE. This matches the type's size. This only applies to RECORD_TYPE. This
does not apply to unions. */ does not apply to unions. */
if (TREE_CODE (type) == RECORD_TYPE && mode != VOIDmode if (TREE_CODE (type) == RECORD_TYPE && mode != VOIDmode
&& host_integerp (TYPE_SIZE (type), 1) && tree_fits_uhwi_p (TYPE_SIZE (type))
&& GET_MODE_BITSIZE (mode) == TREE_INT_CST_LOW (TYPE_SIZE (type))) && GET_MODE_BITSIZE (mode) == TREE_INT_CST_LOW (TYPE_SIZE (type)))
SET_TYPE_MODE (type, mode); SET_TYPE_MODE (type, mode);
else else
@ -1763,7 +1763,7 @@ finish_bitfield_representative (tree repr, tree field)
size = size_diffop (DECL_FIELD_OFFSET (field), size = size_diffop (DECL_FIELD_OFFSET (field),
DECL_FIELD_OFFSET (repr)); DECL_FIELD_OFFSET (repr));
gcc_assert (host_integerp (size, 1)); gcc_assert (tree_fits_uhwi_p (size));
bitsize = (tree_low_cst (size, 1) * BITS_PER_UNIT bitsize = (tree_low_cst (size, 1) * BITS_PER_UNIT
+ tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1) + tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 1)
- tree_low_cst (DECL_FIELD_BIT_OFFSET (repr), 1) - tree_low_cst (DECL_FIELD_BIT_OFFSET (repr), 1)
@ -1785,7 +1785,7 @@ finish_bitfield_representative (tree repr, tree field)
return; return;
maxsize = size_diffop (DECL_FIELD_OFFSET (nextf), maxsize = size_diffop (DECL_FIELD_OFFSET (nextf),
DECL_FIELD_OFFSET (repr)); DECL_FIELD_OFFSET (repr));
if (host_integerp (maxsize, 1)) if (tree_fits_uhwi_p (maxsize))
{ {
maxbitsize = (tree_low_cst (maxsize, 1) * BITS_PER_UNIT maxbitsize = (tree_low_cst (maxsize, 1) * BITS_PER_UNIT
+ tree_low_cst (DECL_FIELD_BIT_OFFSET (nextf), 1) + tree_low_cst (DECL_FIELD_BIT_OFFSET (nextf), 1)
@ -1806,7 +1806,7 @@ finish_bitfield_representative (tree repr, tree field)
use bitsize as fallback for this case. */ use bitsize as fallback for this case. */
tree maxsize = size_diffop (TYPE_SIZE_UNIT (DECL_CONTEXT (field)), tree maxsize = size_diffop (TYPE_SIZE_UNIT (DECL_CONTEXT (field)),
DECL_FIELD_OFFSET (repr)); DECL_FIELD_OFFSET (repr));
if (host_integerp (maxsize, 1)) if (tree_fits_uhwi_p (maxsize))
maxbitsize = (tree_low_cst (maxsize, 1) * BITS_PER_UNIT maxbitsize = (tree_low_cst (maxsize, 1) * BITS_PER_UNIT
- tree_low_cst (DECL_FIELD_BIT_OFFSET (repr), 1)); - tree_low_cst (DECL_FIELD_BIT_OFFSET (repr), 1));
else else
@ -1919,8 +1919,8 @@ finish_bitfield_layout (record_layout_info rli)
representative to be generated. That will at most representative to be generated. That will at most
generate worse code but still maintain correctness with generate worse code but still maintain correctness with
respect to the C++ memory model. */ respect to the C++ memory model. */
else if (!((host_integerp (DECL_FIELD_OFFSET (repr), 1) else if (!((tree_fits_uhwi_p (DECL_FIELD_OFFSET (repr))
&& host_integerp (DECL_FIELD_OFFSET (field), 1)) && tree_fits_uhwi_p (DECL_FIELD_OFFSET (field)))
|| operand_equal_p (DECL_FIELD_OFFSET (repr), || operand_equal_p (DECL_FIELD_OFFSET (repr),
DECL_FIELD_OFFSET (field), 0))) DECL_FIELD_OFFSET (field), 0)))
{ {

View File

@ -1103,7 +1103,7 @@ tm_log_add (basic_block entry_block, tree addr, gimple stmt)
if (entry_block if (entry_block
&& transaction_invariant_address_p (lp->addr, entry_block) && transaction_invariant_address_p (lp->addr, entry_block)
&& TYPE_SIZE_UNIT (type) != NULL && TYPE_SIZE_UNIT (type) != NULL
&& host_integerp (TYPE_SIZE_UNIT (type), 1) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
&& (tree_low_cst (TYPE_SIZE_UNIT (type), 1) && (tree_low_cst (TYPE_SIZE_UNIT (type), 1)
< PARAM_VALUE (PARAM_TM_MAX_AGGREGATE_SIZE)) < PARAM_VALUE (PARAM_TM_MAX_AGGREGATE_SIZE))
/* We must be able to copy this type normally. I.e., no /* We must be able to copy this type normally. I.e., no
@ -1187,7 +1187,7 @@ tm_log_emit_stmt (tree addr, gimple stmt)
code = BUILT_IN_TM_LOG_DOUBLE; code = BUILT_IN_TM_LOG_DOUBLE;
else if (type == long_double_type_node) else if (type == long_double_type_node)
code = BUILT_IN_TM_LOG_LDOUBLE; code = BUILT_IN_TM_LOG_LDOUBLE;
else if (host_integerp (size, 1)) else if (tree_fits_uhwi_p (size))
{ {
unsigned int n = tree_low_cst (size, 1); unsigned int n = tree_low_cst (size, 1);
switch (n) switch (n)
@ -2105,7 +2105,7 @@ build_tm_load (location_t loc, tree lhs, tree rhs, gimple_stmt_iterator *gsi)
else if (type == long_double_type_node) else if (type == long_double_type_node)
code = BUILT_IN_TM_LOAD_LDOUBLE; code = BUILT_IN_TM_LOAD_LDOUBLE;
else if (TYPE_SIZE_UNIT (type) != NULL else if (TYPE_SIZE_UNIT (type) != NULL
&& host_integerp (TYPE_SIZE_UNIT (type), 1)) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (type)))
{ {
switch (tree_low_cst (TYPE_SIZE_UNIT (type), 1)) switch (tree_low_cst (TYPE_SIZE_UNIT (type), 1))
{ {
@ -2177,7 +2177,7 @@ build_tm_store (location_t loc, tree lhs, tree rhs, gimple_stmt_iterator *gsi)
else if (type == long_double_type_node) else if (type == long_double_type_node)
code = BUILT_IN_TM_STORE_LDOUBLE; code = BUILT_IN_TM_STORE_LDOUBLE;
else if (TYPE_SIZE_UNIT (type) != NULL else if (TYPE_SIZE_UNIT (type) != NULL
&& host_integerp (TYPE_SIZE_UNIT (type), 1)) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (type)))
{ {
switch (tree_low_cst (TYPE_SIZE_UNIT (type), 1)) switch (tree_low_cst (TYPE_SIZE_UNIT (type), 1))
{ {

View File

@ -2701,8 +2701,8 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
if (TREE_CODE (t) == BIT_FIELD_REF) if (TREE_CODE (t) == BIT_FIELD_REF)
{ {
if (!host_integerp (TREE_OPERAND (t, 1), 1) if (!tree_fits_uhwi_p (TREE_OPERAND (t, 1))
|| !host_integerp (TREE_OPERAND (t, 2), 1)) || !tree_fits_uhwi_p (TREE_OPERAND (t, 2)))
{ {
error ("invalid position or size operand to BIT_FIELD_REF"); error ("invalid position or size operand to BIT_FIELD_REF");
return t; return t;

View File

@ -407,7 +407,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
} }
if (size_tree != NULL_TREE) if (size_tree != NULL_TREE)
{ {
if (! host_integerp (size_tree, 1)) if (! tree_fits_uhwi_p (size_tree))
bitsize = -1; bitsize = -1;
else else
bitsize = TREE_INT_CST_LOW (size_tree); bitsize = TREE_INT_CST_LOW (size_tree);
@ -475,7 +475,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
because that would get us out of the structure otherwise. */ because that would get us out of the structure otherwise. */
if (maxsize != -1 if (maxsize != -1
&& csize && csize
&& host_integerp (csize, 1) && tree_fits_uhwi_p (csize)
&& bit_offset.fits_shwi ()) && bit_offset.fits_shwi ())
maxsize = TREE_INT_CST_LOW (csize) maxsize = TREE_INT_CST_LOW (csize)
- bit_offset.to_shwi (); - bit_offset.to_shwi ();
@ -519,7 +519,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
because that would get us outside of the array otherwise. */ because that would get us outside of the array otherwise. */
if (maxsize != -1 if (maxsize != -1
&& asize && asize
&& host_integerp (asize, 1) && tree_fits_uhwi_p (asize)
&& bit_offset.fits_shwi ()) && bit_offset.fits_shwi ())
maxsize = TREE_INT_CST_LOW (asize) maxsize = TREE_INT_CST_LOW (asize)
- bit_offset.to_shwi (); - bit_offset.to_shwi ();
@ -569,7 +569,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
if (seen_variable_array_ref if (seen_variable_array_ref
&& maxsize != -1 && maxsize != -1
&& (!bit_offset.fits_shwi () && (!bit_offset.fits_shwi ()
|| !host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1) || !tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (exp)))
|| (bit_offset.to_shwi () + maxsize || (bit_offset.to_shwi () + maxsize
== (HOST_WIDE_INT) TREE_INT_CST_LOW == (HOST_WIDE_INT) TREE_INT_CST_LOW
(TYPE_SIZE (TREE_TYPE (exp)))))) (TYPE_SIZE (TREE_TYPE (exp))))))
@ -606,7 +606,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
if (seen_variable_array_ref if (seen_variable_array_ref
&& maxsize != -1 && maxsize != -1
&& (!bit_offset.fits_shwi () && (!bit_offset.fits_shwi ()
|| !host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1) || !tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (exp)))
|| (bit_offset.to_shwi () + maxsize || (bit_offset.to_shwi () + maxsize
== (HOST_WIDE_INT) TREE_INT_CST_LOW == (HOST_WIDE_INT) TREE_INT_CST_LOW
(TYPE_SIZE (TREE_TYPE (exp)))))) (TYPE_SIZE (TREE_TYPE (exp))))))
@ -631,7 +631,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
/* If maxsize is unknown adjust it according to the size of the /* If maxsize is unknown adjust it according to the size of the
base decl. */ base decl. */
if (maxsize == -1 if (maxsize == -1
&& host_integerp (DECL_SIZE (exp), 1)) && tree_fits_uhwi_p (DECL_SIZE (exp)))
maxsize = TREE_INT_CST_LOW (DECL_SIZE (exp)) - hbit_offset; maxsize = TREE_INT_CST_LOW (DECL_SIZE (exp)) - hbit_offset;
} }
else if (CONSTANT_CLASS_P (exp)) else if (CONSTANT_CLASS_P (exp))
@ -639,7 +639,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
/* If maxsize is unknown adjust it according to the size of the /* If maxsize is unknown adjust it according to the size of the
base type constant. */ base type constant. */
if (maxsize == -1 if (maxsize == -1
&& host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)) && tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (exp))))
maxsize = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))) - hbit_offset; maxsize = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))) - hbit_offset;
} }

View File

@ -81,7 +81,7 @@ static unsigned HOST_WIDE_INT offset_limit;
static void static void
init_offset_limit (void) init_offset_limit (void)
{ {
if (host_integerp (TYPE_MAX_VALUE (sizetype), 1)) if (tree_fits_uhwi_p (TYPE_MAX_VALUE (sizetype)))
offset_limit = tree_low_cst (TYPE_MAX_VALUE (sizetype), 1); offset_limit = tree_low_cst (TYPE_MAX_VALUE (sizetype), 1);
else else
offset_limit = -1; offset_limit = -1;
@ -209,14 +209,14 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
} }
else if (pt_var else if (pt_var
&& DECL_P (pt_var) && DECL_P (pt_var)
&& host_integerp (DECL_SIZE_UNIT (pt_var), 1) && tree_fits_uhwi_p (DECL_SIZE_UNIT (pt_var))
&& (unsigned HOST_WIDE_INT) && (unsigned HOST_WIDE_INT)
tree_low_cst (DECL_SIZE_UNIT (pt_var), 1) < offset_limit) tree_low_cst (DECL_SIZE_UNIT (pt_var), 1) < offset_limit)
pt_var_size = DECL_SIZE_UNIT (pt_var); pt_var_size = DECL_SIZE_UNIT (pt_var);
else if (pt_var else if (pt_var
&& TREE_CODE (pt_var) == STRING_CST && TREE_CODE (pt_var) == STRING_CST
&& TYPE_SIZE_UNIT (TREE_TYPE (pt_var)) && TYPE_SIZE_UNIT (TREE_TYPE (pt_var))
&& host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (pt_var)), 1) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (TREE_TYPE (pt_var)))
&& (unsigned HOST_WIDE_INT) && (unsigned HOST_WIDE_INT)
tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (pt_var)), 1) tree_low_cst (TYPE_SIZE_UNIT (TREE_TYPE (pt_var)), 1)
< offset_limit) < offset_limit)
@ -243,7 +243,7 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
if (var != pt_var && TREE_CODE (var) == ARRAY_REF) if (var != pt_var && TREE_CODE (var) == ARRAY_REF)
var = TREE_OPERAND (var, 0); var = TREE_OPERAND (var, 0);
if (! TYPE_SIZE_UNIT (TREE_TYPE (var)) if (! TYPE_SIZE_UNIT (TREE_TYPE (var))
|| ! host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (var)), 1) || ! tree_fits_uhwi_p (TYPE_SIZE_UNIT (TREE_TYPE (var)))
|| (pt_var_size || (pt_var_size
&& tree_int_cst_lt (pt_var_size, && tree_int_cst_lt (pt_var_size,
TYPE_SIZE_UNIT (TREE_TYPE (var))))) TYPE_SIZE_UNIT (TREE_TYPE (var)))))
@ -371,7 +371,7 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
else else
bytes = pt_var_size; bytes = pt_var_size;
if (host_integerp (bytes, 1)) if (tree_fits_uhwi_p (bytes))
return tree_low_cst (bytes, 1); return tree_low_cst (bytes, 1);
return unknown[object_size_type]; return unknown[object_size_type];
@ -435,7 +435,7 @@ alloc_object_size (const_gimple call, int object_size_type)
else if (arg1 >= 0) else if (arg1 >= 0)
bytes = fold_convert (sizetype, gimple_call_arg (call, arg1)); bytes = fold_convert (sizetype, gimple_call_arg (call, arg1));
if (bytes && host_integerp (bytes, 1)) if (bytes && tree_fits_uhwi_p (bytes))
return tree_low_cst (bytes, 1); return tree_low_cst (bytes, 1);
return unknown[object_size_type]; return unknown[object_size_type];
@ -796,7 +796,7 @@ plus_stmt_object_size (struct object_size_info *osi, tree var, gimple stmt)
&& (TREE_CODE (op0) == SSA_NAME && (TREE_CODE (op0) == SSA_NAME
|| TREE_CODE (op0) == ADDR_EXPR)) || TREE_CODE (op0) == ADDR_EXPR))
{ {
if (! host_integerp (op1, 1)) if (! tree_fits_uhwi_p (op1))
bytes = unknown[object_size_type]; bytes = unknown[object_size_type];
else if (TREE_CODE (op0) == SSA_NAME) else if (TREE_CODE (op0) == SSA_NAME)
return merge_object_sizes (osi, var, op0, tree_low_cst (op1, 1)); return merge_object_sizes (osi, var, op0, tree_low_cst (op1, 1));
@ -1228,7 +1228,7 @@ compute_object_sizes (void)
{ {
tree ost = gimple_call_arg (call, 1); tree ost = gimple_call_arg (call, 1);
if (host_integerp (ost, 1)) if (tree_fits_uhwi_p (ost))
{ {
unsigned HOST_WIDE_INT object_size_type unsigned HOST_WIDE_INT object_size_type
= tree_low_cst (ost, 1); = tree_low_cst (ost, 1);

View File

@ -742,12 +742,12 @@ type_internals_preclude_sra_p (tree type, const char **msg)
*msg = "zero structure field size"; *msg = "zero structure field size";
return true; return true;
} }
if (!host_integerp (DECL_FIELD_OFFSET (fld), 1)) if (!tree_fits_uhwi_p (DECL_FIELD_OFFSET (fld)))
{ {
*msg = "structure field offset not fixed"; *msg = "structure field offset not fixed";
return true; return true;
} }
if (!host_integerp (DECL_SIZE (fld), 1)) if (!tree_fits_uhwi_p (DECL_SIZE (fld)))
{ {
*msg = "structure field size not fixed"; *msg = "structure field size not fixed";
return true; return true;
@ -1651,12 +1651,12 @@ build_user_friendly_ref_for_offset (tree *res, tree type, HOST_WIDE_INT offset,
continue; continue;
tr_pos = bit_position (fld); tr_pos = bit_position (fld);
if (!tr_pos || !host_integerp (tr_pos, 1)) if (!tr_pos || !tree_fits_uhwi_p (tr_pos))
continue; continue;
pos = TREE_INT_CST_LOW (tr_pos); pos = TREE_INT_CST_LOW (tr_pos);
gcc_assert (TREE_CODE (type) == RECORD_TYPE || pos == 0); gcc_assert (TREE_CODE (type) == RECORD_TYPE || pos == 0);
tr_size = DECL_SIZE (fld); tr_size = DECL_SIZE (fld);
if (!tr_size || !host_integerp (tr_size, 1)) if (!tr_size || !tree_fits_uhwi_p (tr_size))
continue; continue;
size = TREE_INT_CST_LOW (tr_size); size = TREE_INT_CST_LOW (tr_size);
if (size == 0) if (size == 0)
@ -1681,7 +1681,7 @@ build_user_friendly_ref_for_offset (tree *res, tree type, HOST_WIDE_INT offset,
case ARRAY_TYPE: case ARRAY_TYPE:
tr_size = TYPE_SIZE (TREE_TYPE (type)); tr_size = TYPE_SIZE (TREE_TYPE (type));
if (!tr_size || !host_integerp (tr_size, 1)) if (!tr_size || !tree_fits_uhwi_p (tr_size))
return false; return false;
el_size = tree_low_cst (tr_size, 1); el_size = tree_low_cst (tr_size, 1);
@ -1759,7 +1759,7 @@ maybe_add_sra_candidate (tree var)
reject (var, "has incomplete type"); reject (var, "has incomplete type");
return false; return false;
} }
if (!host_integerp (TYPE_SIZE (type), 1)) if (!tree_fits_uhwi_p (TYPE_SIZE (type)))
{ {
reject (var, "type size not fixed"); reject (var, "type size not fixed");
return false; return false;
@ -2799,8 +2799,8 @@ sra_modify_expr (tree *expr, gimple_stmt_iterator *gsi, bool write)
{ {
HOST_WIDE_INT start_offset, chunk_size; HOST_WIDE_INT start_offset, chunk_size;
if (bfr if (bfr
&& host_integerp (TREE_OPERAND (bfr, 1), 1) && tree_fits_uhwi_p (TREE_OPERAND (bfr, 1))
&& host_integerp (TREE_OPERAND (bfr, 2), 1)) && tree_fits_uhwi_p (TREE_OPERAND (bfr, 2)))
{ {
chunk_size = tree_low_cst (TREE_OPERAND (bfr, 1), 1); chunk_size = tree_low_cst (TREE_OPERAND (bfr, 1), 1);
start_offset = access->offset start_offset = access->offset
@ -3693,7 +3693,7 @@ find_param_candidates (void)
continue; continue;
if (!COMPLETE_TYPE_P (type) if (!COMPLETE_TYPE_P (type)
|| !host_integerp (TYPE_SIZE (type), 1) || !tree_fits_uhwi_p (TYPE_SIZE (type))
|| tree_low_cst (TYPE_SIZE (type), 1) == 0 || tree_low_cst (TYPE_SIZE (type), 1) == 0
|| (AGGREGATE_TYPE_P (type) || (AGGREGATE_TYPE_P (type)
&& type_internals_preclude_sra_p (type, &msg))) && type_internals_preclude_sra_p (type, &msg)))

View File

@ -1487,7 +1487,7 @@ bit_value_assume_aligned (gimple stmt)
&& TREE_CODE (ptrval.value) == INTEGER_CST) && TREE_CODE (ptrval.value) == INTEGER_CST)
|| ptrval.mask.is_minus_one ()); || ptrval.mask.is_minus_one ());
align = gimple_call_arg (stmt, 1); align = gimple_call_arg (stmt, 1);
if (!host_integerp (align, 1)) if (!tree_fits_uhwi_p (align))
return ptrval; return ptrval;
aligni = tree_low_cst (align, 1); aligni = tree_low_cst (align, 1);
if (aligni <= 1 if (aligni <= 1
@ -1496,7 +1496,7 @@ bit_value_assume_aligned (gimple stmt)
if (gimple_call_num_args (stmt) > 2) if (gimple_call_num_args (stmt) > 2)
{ {
misalign = gimple_call_arg (stmt, 2); misalign = gimple_call_arg (stmt, 2);
if (!host_integerp (misalign, 1)) if (!tree_fits_uhwi_p (misalign))
return ptrval; return ptrval;
misaligni = tree_low_cst (misalign, 1); misaligni = tree_low_cst (misalign, 1);
if (misaligni >= aligni) if (misaligni >= aligni)
@ -1881,7 +1881,7 @@ fold_builtin_alloca_with_align (gimple stmt)
arg = get_constant_value (gimple_call_arg (stmt, 0)); arg = get_constant_value (gimple_call_arg (stmt, 0));
if (arg == NULL_TREE if (arg == NULL_TREE
|| TREE_CODE (arg) != INTEGER_CST || TREE_CODE (arg) != INTEGER_CST
|| !host_integerp (arg, 1)) || !tree_fits_uhwi_p (arg))
return NULL_TREE; return NULL_TREE;
size = TREE_INT_CST_LOW (arg); size = TREE_INT_CST_LOW (arg);

View File

@ -1528,7 +1528,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
use_operand_p use_p; use_operand_p use_p;
if (!tree_fits_shwi_p (val2) if (!tree_fits_shwi_p (val2)
|| !host_integerp (len2, 1)) || !tree_fits_uhwi_p (len2))
break; break;
if (is_gimple_call (stmt1)) if (is_gimple_call (stmt1))
{ {
@ -1547,12 +1547,12 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
src1 = gimple_call_arg (stmt1, 1); src1 = gimple_call_arg (stmt1, 1);
len1 = gimple_call_arg (stmt1, 2); len1 = gimple_call_arg (stmt1, 2);
lhs1 = gimple_call_lhs (stmt1); lhs1 = gimple_call_lhs (stmt1);
if (!host_integerp (len1, 1)) if (!tree_fits_uhwi_p (len1))
break; break;
str1 = string_constant (src1, &off1); str1 = string_constant (src1, &off1);
if (str1 == NULL_TREE) if (str1 == NULL_TREE)
break; break;
if (!host_integerp (off1, 1) if (!tree_fits_uhwi_p (off1)
|| compare_tree_int (off1, TREE_STRING_LENGTH (str1) - 1) > 0 || compare_tree_int (off1, TREE_STRING_LENGTH (str1) - 1) > 0
|| compare_tree_int (len1, TREE_STRING_LENGTH (str1) || compare_tree_int (len1, TREE_STRING_LENGTH (str1)
- tree_low_cst (off1, 1)) > 0 - tree_low_cst (off1, 1)) > 0
@ -1593,7 +1593,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
/* If the difference between the second and first destination pointer /* If the difference between the second and first destination pointer
is not constant, or is bigger than memcpy length, bail out. */ is not constant, or is bigger than memcpy length, bail out. */
if (diff == NULL if (diff == NULL
|| !host_integerp (diff, 1) || !tree_fits_uhwi_p (diff)
|| tree_int_cst_lt (len1, diff)) || tree_int_cst_lt (len1, diff))
break; break;
@ -2317,8 +2317,8 @@ simplify_rotate (gimple_stmt_iterator *gsi)
return false; return false;
/* CNT1 + CNT2 == B case above. */ /* CNT1 + CNT2 == B case above. */
if (host_integerp (def_arg2[0], 1) if (tree_fits_uhwi_p (def_arg2[0])
&& host_integerp (def_arg2[1], 1) && tree_fits_uhwi_p (def_arg2[1])
&& (unsigned HOST_WIDE_INT) tree_low_cst (def_arg2[0], 1) && (unsigned HOST_WIDE_INT) tree_low_cst (def_arg2[0], 1)
+ tree_low_cst (def_arg2[1], 1) == TYPE_PRECISION (rtype)) + tree_low_cst (def_arg2[1], 1) == TYPE_PRECISION (rtype))
rotcnt = def_arg2[0]; rotcnt = def_arg2[0];

View File

@ -667,7 +667,7 @@ try_unroll_loop_completely (struct loop *loop,
If the number of execution of loop is determined by standard induction If the number of execution of loop is determined by standard induction
variable test, then EXIT and EDGE_TO_CANCEL are the two edges leaving variable test, then EXIT and EDGE_TO_CANCEL are the two edges leaving
from the iv test. */ from the iv test. */
if (host_integerp (niter, 1)) if (tree_fits_uhwi_p (niter))
{ {
n_unroll = tree_low_cst (niter, 1); n_unroll = tree_low_cst (niter, 1);
n_unroll_found = true; n_unroll_found = true;

View File

@ -1508,7 +1508,7 @@ self_reuse_distance (data_reference_p dr, unsigned *loop_sizes, unsigned n,
if (TREE_CODE (ref) == ARRAY_REF) if (TREE_CODE (ref) == ARRAY_REF)
{ {
stride = TYPE_SIZE_UNIT (TREE_TYPE (ref)); stride = TYPE_SIZE_UNIT (TREE_TYPE (ref));
if (host_integerp (stride, 1)) if (tree_fits_uhwi_p (stride))
astride = tree_low_cst (stride, 1); astride = tree_low_cst (stride, 1);
else else
astride = L1_CACHE_LINE_SIZE; astride = L1_CACHE_LINE_SIZE;

View File

@ -1975,9 +1975,9 @@ hoist_adjacent_loads (basic_block bb0, basic_block bb1,
tree_offset2 = bit_position (field2); tree_offset2 = bit_position (field2);
tree_size2 = DECL_SIZE (field2); tree_size2 = DECL_SIZE (field2);
if (!host_integerp (tree_offset1, 1) if (!tree_fits_uhwi_p (tree_offset1)
|| !host_integerp (tree_offset2, 1) || !tree_fits_uhwi_p (tree_offset2)
|| !host_integerp (tree_size2, 1)) || !tree_fits_uhwi_p (tree_size2))
continue; continue;
offset1 = TREE_INT_CST_LOW (tree_offset1); offset1 = TREE_INT_CST_LOW (tree_offset1);

View File

@ -936,7 +936,7 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
} }
if (size_tree != NULL_TREE) if (size_tree != NULL_TREE)
{ {
if (!host_integerp (size_tree, 1)) if (!tree_fits_uhwi_p (size_tree))
size = -1; size = -1;
else else
size = TREE_INT_CST_LOW (size_tree); size = TREE_INT_CST_LOW (size_tree);
@ -1006,7 +1006,7 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
parts manually. */ parts manually. */
if (op->op1 if (op->op1
|| !host_integerp (DECL_FIELD_OFFSET (field), 1)) || !tree_fits_uhwi_p (DECL_FIELD_OFFSET (field)))
max_size = -1; max_size = -1;
else else
{ {
@ -1586,7 +1586,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
if (is_gimple_reg_type (vr->type) if (is_gimple_reg_type (vr->type)
&& gimple_call_builtin_p (def_stmt, BUILT_IN_MEMSET) && gimple_call_builtin_p (def_stmt, BUILT_IN_MEMSET)
&& integer_zerop (gimple_call_arg (def_stmt, 1)) && integer_zerop (gimple_call_arg (def_stmt, 1))
&& host_integerp (gimple_call_arg (def_stmt, 2), 1) && tree_fits_uhwi_p (gimple_call_arg (def_stmt, 2))
&& TREE_CODE (gimple_call_arg (def_stmt, 0)) == ADDR_EXPR) && TREE_CODE (gimple_call_arg (def_stmt, 0)) == ADDR_EXPR)
{ {
tree ref2 = TREE_OPERAND (gimple_call_arg (def_stmt, 0), 0); tree ref2 = TREE_OPERAND (gimple_call_arg (def_stmt, 0), 0);
@ -1835,7 +1835,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
|| TREE_CODE (gimple_call_arg (def_stmt, 0)) == SSA_NAME) || TREE_CODE (gimple_call_arg (def_stmt, 0)) == SSA_NAME)
&& (TREE_CODE (gimple_call_arg (def_stmt, 1)) == ADDR_EXPR && (TREE_CODE (gimple_call_arg (def_stmt, 1)) == ADDR_EXPR
|| TREE_CODE (gimple_call_arg (def_stmt, 1)) == SSA_NAME) || TREE_CODE (gimple_call_arg (def_stmt, 1)) == SSA_NAME)
&& host_integerp (gimple_call_arg (def_stmt, 2), 1)) && tree_fits_uhwi_p (gimple_call_arg (def_stmt, 2)))
{ {
tree lhs, rhs; tree lhs, rhs;
ao_ref r; ao_ref r;
@ -1862,7 +1862,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
if (!tem) if (!tem)
return (void *)-1; return (void *)-1;
if (TREE_CODE (tem) == MEM_REF if (TREE_CODE (tem) == MEM_REF
&& host_integerp (TREE_OPERAND (tem, 1), 1)) && tree_fits_uhwi_p (TREE_OPERAND (tem, 1)))
{ {
lhs = TREE_OPERAND (tem, 0); lhs = TREE_OPERAND (tem, 0);
lhs_offset += TREE_INT_CST_LOW (TREE_OPERAND (tem, 1)); lhs_offset += TREE_INT_CST_LOW (TREE_OPERAND (tem, 1));
@ -1888,7 +1888,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
if (!tem) if (!tem)
return (void *)-1; return (void *)-1;
if (TREE_CODE (tem) == MEM_REF if (TREE_CODE (tem) == MEM_REF
&& host_integerp (TREE_OPERAND (tem, 1), 1)) && tree_fits_uhwi_p (TREE_OPERAND (tem, 1)))
{ {
rhs = TREE_OPERAND (tem, 0); rhs = TREE_OPERAND (tem, 0);
rhs_offset += TREE_INT_CST_LOW (TREE_OPERAND (tem, 1)); rhs_offset += TREE_INT_CST_LOW (TREE_OPERAND (tem, 1));
@ -1909,7 +1909,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
&& !DECL_P (base)) && !DECL_P (base))
|| (TREE_CODE (base) == MEM_REF || (TREE_CODE (base) == MEM_REF
&& (TREE_OPERAND (base, 0) != lhs && (TREE_OPERAND (base, 0) != lhs
|| !host_integerp (TREE_OPERAND (base, 1), 1))) || !tree_fits_uhwi_p (TREE_OPERAND (base, 1))))
|| (DECL_P (base) || (DECL_P (base)
&& (TREE_CODE (lhs) != ADDR_EXPR && (TREE_CODE (lhs) != ADDR_EXPR
|| TREE_OPERAND (lhs, 0) != base))) || TREE_OPERAND (lhs, 0) != base)))
@ -3221,7 +3221,7 @@ simplify_binary_expression (gimple stmt)
/* Pointer plus constant can be represented as invariant address. /* Pointer plus constant can be represented as invariant address.
Do so to allow further propatation, see also tree forwprop. */ Do so to allow further propatation, see also tree forwprop. */
if (code == POINTER_PLUS_EXPR if (code == POINTER_PLUS_EXPR
&& host_integerp (op1, 1) && tree_fits_uhwi_p (op1)
&& TREE_CODE (op0) == ADDR_EXPR && TREE_CODE (op0) == ADDR_EXPR
&& is_gimple_min_invariant (op0)) && is_gimple_min_invariant (op0))
return build_invariant_address (TREE_TYPE (op0), return build_invariant_address (TREE_TYPE (op0),

View File

@ -846,9 +846,9 @@ adjust_last_stmt (strinfo si, gimple stmt, bool is_strcat)
} }
len = gimple_call_arg (last.stmt, 2); len = gimple_call_arg (last.stmt, 2);
if (host_integerp (len, 1)) if (tree_fits_uhwi_p (len))
{ {
if (!host_integerp (last.len, 1) if (!tree_fits_uhwi_p (last.len)
|| integer_zerop (len) || integer_zerop (len)
|| (unsigned HOST_WIDE_INT) tree_low_cst (len, 1) || (unsigned HOST_WIDE_INT) tree_low_cst (len, 1)
!= (unsigned HOST_WIDE_INT) tree_low_cst (last.len, 1) + 1) != (unsigned HOST_WIDE_INT) tree_low_cst (last.len, 1) + 1)
@ -1310,7 +1310,7 @@ handle_builtin_memcpy (enum built_in_function bcode, gimple_stmt_iterator *gsi)
return; return;
if (olddsi != NULL if (olddsi != NULL
&& host_integerp (len, 1) && tree_fits_uhwi_p (len)
&& !integer_zerop (len)) && !integer_zerop (len))
adjust_last_stmt (olddsi, stmt, false); adjust_last_stmt (olddsi, stmt, false);
@ -1336,7 +1336,7 @@ handle_builtin_memcpy (enum built_in_function bcode, gimple_stmt_iterator *gsi)
si = NULL; si = NULL;
/* Handle memcpy (x, "abcd", 5) or /* Handle memcpy (x, "abcd", 5) or
memcpy (x, "abc\0uvw", 7). */ memcpy (x, "abc\0uvw", 7). */
if (!host_integerp (len, 1) if (!tree_fits_uhwi_p (len)
|| (unsigned HOST_WIDE_INT) tree_low_cst (len, 1) || (unsigned HOST_WIDE_INT) tree_low_cst (len, 1)
<= (unsigned HOST_WIDE_INT) ~idx) <= (unsigned HOST_WIDE_INT) ~idx)
return; return;
@ -1626,7 +1626,7 @@ handle_pointer_plus (gimple_stmt_iterator *gsi)
if (idx < 0) if (idx < 0)
{ {
tree off = gimple_assign_rhs2 (stmt); tree off = gimple_assign_rhs2 (stmt);
if (host_integerp (off, 1) if (tree_fits_uhwi_p (off)
&& (unsigned HOST_WIDE_INT) tree_low_cst (off, 1) && (unsigned HOST_WIDE_INT) tree_low_cst (off, 1)
<= (unsigned HOST_WIDE_INT) ~idx) <= (unsigned HOST_WIDE_INT) ~idx)
ssa_ver_to_stridx[SSA_NAME_VERSION (lhs)] ssa_ver_to_stridx[SSA_NAME_VERSION (lhs)]

View File

@ -3429,7 +3429,7 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p,
&& curr) && curr)
{ {
unsigned HOST_WIDE_INT size; unsigned HOST_WIDE_INT size;
if (host_integerp (TYPE_SIZE (TREE_TYPE (t)), 1)) if (tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (t))))
size = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (t))); size = TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (t)));
else else
size = -1; size = -1;
@ -5348,7 +5348,7 @@ push_fields_onto_fieldstack (tree type, vec<fieldoff_s> *fieldstack,
} }
if (!DECL_SIZE (field) if (!DECL_SIZE (field)
|| !host_integerp (DECL_SIZE (field), 1)) || !tree_fits_uhwi_p (DECL_SIZE (field)))
has_unknown_size = true; has_unknown_size = true;
/* If adjacent fields do not contain pointers merge them. */ /* If adjacent fields do not contain pointers merge them. */
@ -5624,7 +5624,7 @@ create_variable_info_for_1 (tree decl, const char *name)
unsigned int i; unsigned int i;
if (!declsize if (!declsize
|| !host_integerp (declsize, 1)) || !tree_fits_uhwi_p (declsize))
{ {
vi = new_var_info (decl, name); vi = new_var_info (decl, name);
vi->offset = 0; vi->offset = 0;

View File

@ -172,7 +172,7 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
if ((rhs_code == POINTER_PLUS_EXPR if ((rhs_code == POINTER_PLUS_EXPR
|| rhs_code == PLUS_EXPR) || rhs_code == PLUS_EXPR)
&& TREE_CODE (rhs1) == SSA_NAME && TREE_CODE (rhs1) == SSA_NAME
&& host_integerp (gimple_assign_rhs2 (stmt), 1)) && tree_fits_uhwi_p (gimple_assign_rhs2 (stmt)))
{ {
ret += tree_low_cst (gimple_assign_rhs2 (stmt), 1); ret += tree_low_cst (gimple_assign_rhs2 (stmt), 1);
lhs = rhs1; lhs = rhs1;
@ -182,7 +182,7 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
if (rhs_code == ADDR_EXPR if (rhs_code == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (rhs1, 0)) == MEM_REF && TREE_CODE (TREE_OPERAND (rhs1, 0)) == MEM_REF
&& TREE_CODE (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 0)) == SSA_NAME && TREE_CODE (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 0)) == SSA_NAME
&& host_integerp (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 1), 1)) && tree_fits_uhwi_p (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 1)))
{ {
ret += tree_low_cst (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 1), 1); ret += tree_low_cst (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 1), 1);
lhs = TREE_OPERAND (TREE_OPERAND (rhs1, 0), 0); lhs = TREE_OPERAND (TREE_OPERAND (rhs1, 0), 0);
@ -239,7 +239,7 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
if ((rhs_code == POINTER_PLUS_EXPR if ((rhs_code == POINTER_PLUS_EXPR
|| rhs_code == PLUS_EXPR) || rhs_code == PLUS_EXPR)
&& TREE_CODE (rhs1) == SSA_NAME && TREE_CODE (rhs1) == SSA_NAME
&& host_integerp (gimple_assign_rhs2 (stmt), 1)) && tree_fits_uhwi_p (gimple_assign_rhs2 (stmt)))
{ {
val -= tree_low_cst (gimple_assign_rhs2 (stmt), 1); val -= tree_low_cst (gimple_assign_rhs2 (stmt), 1);
lhs = rhs1; lhs = rhs1;
@ -249,7 +249,7 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
if (rhs_code == ADDR_EXPR if (rhs_code == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (rhs1, 0)) == MEM_REF && TREE_CODE (TREE_OPERAND (rhs1, 0)) == MEM_REF
&& TREE_CODE (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 0)) == SSA_NAME && TREE_CODE (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 0)) == SSA_NAME
&& host_integerp (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 1), 1)) && tree_fits_uhwi_p (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 1)))
{ {
val -= tree_low_cst (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 1), 1); val -= tree_low_cst (TREE_OPERAND (TREE_OPERAND (rhs1, 0), 1), 1);
lhs = TREE_OPERAND (TREE_OPERAND (rhs1, 0), 0); lhs = TREE_OPERAND (TREE_OPERAND (rhs1, 0), 0);
@ -589,7 +589,7 @@ check_all_va_list_escapes (struct stdarg_info *si)
if (rhs_code == MEM_REF if (rhs_code == MEM_REF
&& TREE_OPERAND (rhs, 0) == use && TREE_OPERAND (rhs, 0) == use
&& TYPE_SIZE_UNIT (TREE_TYPE (rhs)) && TYPE_SIZE_UNIT (TREE_TYPE (rhs))
&& host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (rhs)), 1) && tree_fits_uhwi_p (TYPE_SIZE_UNIT (TREE_TYPE (rhs)))
&& si->offsets[SSA_NAME_VERSION (use)] != -1) && si->offsets[SSA_NAME_VERSION (use)] != -1)
{ {
unsigned HOST_WIDE_INT gpr_size; unsigned HOST_WIDE_INT gpr_size;

View File

@ -697,7 +697,7 @@ static bool
check_range (struct switch_conv_info *info) check_range (struct switch_conv_info *info)
{ {
gcc_assert (info->range_size); gcc_assert (info->range_size);
if (!host_integerp (info->range_size, 1)) if (!tree_fits_uhwi_p (info->range_size))
{ {
info->reason = "index range way too large or otherwise unusable"; info->reason = "index range way too large or otherwise unusable";
return false; return false;

View File

@ -772,7 +772,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
/* Modulo alignment. */ /* Modulo alignment. */
misalign = size_binop (FLOOR_MOD_EXPR, misalign, alignment); misalign = size_binop (FLOOR_MOD_EXPR, misalign, alignment);
if (!host_integerp (misalign, 1)) if (!tree_fits_uhwi_p (misalign))
{ {
/* Negative or overflowed misalignment value. */ /* Negative or overflowed misalignment value. */
if (dump_enabled_p ()) if (dump_enabled_p ())
@ -960,7 +960,7 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
static bool static bool
not_size_aligned (tree exp) not_size_aligned (tree exp)
{ {
if (!host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)) if (!tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (exp))))
return true; return true;
return (TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))) return (TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp)))
@ -2544,8 +2544,8 @@ vect_analyze_data_ref_accesses (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
/* Check that the data-refs have the same constant size and step. */ /* Check that the data-refs have the same constant size and step. */
tree sza = TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dra))); tree sza = TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (dra)));
tree szb = TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb))); tree szb = TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb)));
if (!host_integerp (sza, 1) if (!tree_fits_uhwi_p (sza)
|| !host_integerp (szb, 1) || !tree_fits_uhwi_p (szb)
|| !tree_int_cst_equal (sza, szb) || !tree_int_cst_equal (sza, szb)
|| !tree_fits_shwi_p (DR_STEP (dra)) || !tree_fits_shwi_p (DR_STEP (dra))
|| !tree_fits_shwi_p (DR_STEP (drb)) || !tree_fits_shwi_p (DR_STEP (drb))
@ -3268,7 +3268,7 @@ again:
STRIP_NOPS (off); STRIP_NOPS (off);
if (TREE_CODE (DR_INIT (newdr)) == INTEGER_CST if (TREE_CODE (DR_INIT (newdr)) == INTEGER_CST
&& TREE_CODE (off) == MULT_EXPR && TREE_CODE (off) == MULT_EXPR
&& host_integerp (TREE_OPERAND (off, 1), 1)) && tree_fits_uhwi_p (TREE_OPERAND (off, 1)))
{ {
tree step = TREE_OPERAND (off, 1); tree step = TREE_OPERAND (off, 1);
off = TREE_OPERAND (off, 0); off = TREE_OPERAND (off, 0);

View File

@ -485,7 +485,7 @@ expand_vector_divmod (gimple_stmt_iterator *gsi, tree type, tree op0,
unsigned HOST_WIDE_INT d2; unsigned HOST_WIDE_INT d2;
int this_pre_shift; int this_pre_shift;
if (!host_integerp (cst2, 1)) if (!tree_fits_uhwi_p (cst2))
return NULL_TREE; return NULL_TREE;
d2 = tree_low_cst (cst2, 1) & mask; d2 = tree_low_cst (cst2, 1) & mask;
if (d2 == 0) if (d2 == 0)
@ -1054,7 +1054,7 @@ vector_element (gimple_stmt_iterator *gsi, tree vect, tree idx, tree *ptmpvec)
/* Given that we're about to compute a binary modulus, /* Given that we're about to compute a binary modulus,
we don't care about the high bits of the value. */ we don't care about the high bits of the value. */
index = TREE_INT_CST_LOW (idx); index = TREE_INT_CST_LOW (idx);
if (!host_integerp (idx, 1) || index >= elements) if (!tree_fits_uhwi_p (idx) || index >= elements)
{ {
index &= elements - 1; index &= elements - 1;
idx = build_int_cst (TREE_TYPE (idx), index); idx = build_int_cst (TREE_TYPE (idx), index);
@ -1186,7 +1186,7 @@ lower_vec_perm (gimple_stmt_iterator *gsi)
unsigned HOST_WIDE_INT index; unsigned HOST_WIDE_INT index;
index = TREE_INT_CST_LOW (i_val); index = TREE_INT_CST_LOW (i_val);
if (!host_integerp (i_val, 1) || index >= elements) if (!tree_fits_uhwi_p (i_val) || index >= elements)
i_val = build_int_cst (mask_elt_type, index & (elements - 1)); i_val = build_int_cst (mask_elt_type, index & (elements - 1));
if (two_operand_p && (index & elements) != 0) if (two_operand_p && (index & elements) != 0)

View File

@ -1635,7 +1635,7 @@ vect_recog_rotate_pattern (vec<gimple> *stmts, tree *type_in, tree *type_out)
if (TREE_CODE (def) == INTEGER_CST) if (TREE_CODE (def) == INTEGER_CST)
{ {
if (!host_integerp (def, 1) if (!tree_fits_uhwi_p (def)
|| (unsigned HOST_WIDE_INT) tree_low_cst (def, 1) || (unsigned HOST_WIDE_INT) tree_low_cst (def, 1)
>= GET_MODE_PRECISION (TYPE_MODE (type)) >= GET_MODE_PRECISION (TYPE_MODE (type))
|| integer_zerop (def)) || integer_zerop (def))

View File

@ -5015,7 +5015,7 @@ register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
name2 = gimple_assign_rhs1 (def_stmt); name2 = gimple_assign_rhs1 (def_stmt);
cst2 = gimple_assign_rhs2 (def_stmt); cst2 = gimple_assign_rhs2 (def_stmt);
if (TREE_CODE (name2) == SSA_NAME if (TREE_CODE (name2) == SSA_NAME
&& host_integerp (cst2, 1) && tree_fits_uhwi_p (cst2)
&& INTEGRAL_TYPE_P (TREE_TYPE (name2)) && INTEGRAL_TYPE_P (TREE_TYPE (name2))
&& IN_RANGE (tree_low_cst (cst2, 1), 1, prec - 1) && IN_RANGE (tree_low_cst (cst2, 1), 1, prec - 1)
&& prec <= HOST_BITS_PER_DOUBLE_INT && prec <= HOST_BITS_PER_DOUBLE_INT

View File

@ -2210,7 +2210,7 @@ tree_ctz (const_tree expr)
return MIN (ret1 + ret2, prec); return MIN (ret1 + ret2, prec);
case LSHIFT_EXPR: case LSHIFT_EXPR:
ret1 = tree_ctz (TREE_OPERAND (expr, 0)); ret1 = tree_ctz (TREE_OPERAND (expr, 0));
if (host_integerp (TREE_OPERAND (expr, 1), 1) if (tree_fits_uhwi_p (TREE_OPERAND (expr, 1))
&& ((unsigned HOST_WIDE_INT) tree_low_cst (TREE_OPERAND (expr, 1), 1) && ((unsigned HOST_WIDE_INT) tree_low_cst (TREE_OPERAND (expr, 1), 1)
< (unsigned HOST_WIDE_INT) prec)) < (unsigned HOST_WIDE_INT) prec))
{ {
@ -2219,7 +2219,7 @@ tree_ctz (const_tree expr)
} }
return ret1; return ret1;
case RSHIFT_EXPR: case RSHIFT_EXPR:
if (host_integerp (TREE_OPERAND (expr, 1), 1) if (tree_fits_uhwi_p (TREE_OPERAND (expr, 1))
&& ((unsigned HOST_WIDE_INT) tree_low_cst (TREE_OPERAND (expr, 1), 1) && ((unsigned HOST_WIDE_INT) tree_low_cst (TREE_OPERAND (expr, 1), 1)
< (unsigned HOST_WIDE_INT) prec)) < (unsigned HOST_WIDE_INT) prec))
{ {
@ -2674,7 +2674,7 @@ max_int_size_in_bytes (const_tree type)
{ {
size_tree = TYPE_ARRAY_MAX_SIZE (type); size_tree = TYPE_ARRAY_MAX_SIZE (type);
if (size_tree && host_integerp (size_tree, 1)) if (size_tree && tree_fits_uhwi_p (size_tree))
size = tree_low_cst (size_tree, 1); size = tree_low_cst (size_tree, 1);
} }
@ -2685,7 +2685,7 @@ max_int_size_in_bytes (const_tree type)
{ {
size_tree = lang_hooks.types.max_size (type); size_tree = lang_hooks.types.max_size (type);
if (size_tree && host_integerp (size_tree, 1)) if (size_tree && tree_fits_uhwi_p (size_tree))
size = tree_low_cst (size_tree, 1); size = tree_low_cst (size_tree, 1);
} }
@ -7282,7 +7282,7 @@ compare_tree_int (const_tree t, unsigned HOST_WIDE_INT u)
bool bool
valid_constant_size_p (const_tree size) valid_constant_size_p (const_tree size)
{ {
if (! host_integerp (size, 1) if (! tree_fits_uhwi_p (size)
|| TREE_OVERFLOW (size) || TREE_OVERFLOW (size)
|| tree_int_cst_sign_bit (size) != 0) || tree_int_cst_sign_bit (size) != 0)
return false; return false;
@ -7686,7 +7686,7 @@ build_nonstandard_integer_type (unsigned HOST_WIDE_INT precision,
fixup_signed_type (itype); fixup_signed_type (itype);
ret = itype; ret = itype;
if (host_integerp (TYPE_MAX_VALUE (itype), 1)) if (tree_fits_uhwi_p (TYPE_MAX_VALUE (itype)))
ret = type_hash_canon (tree_low_cst (TYPE_MAX_VALUE (itype), 1), itype); ret = type_hash_canon (tree_low_cst (TYPE_MAX_VALUE (itype), 1), itype);
if (precision <= MAX_INT_CACHED_PREC) if (precision <= MAX_INT_CACHED_PREC)
nonstandard_integer_type_cache[precision + unsignedp] = ret; nonstandard_integer_type_cache[precision + unsignedp] = ret;
@ -8523,7 +8523,7 @@ get_narrower (tree op, int *unsignedp_ptr)
&& TREE_CODE (TREE_TYPE (op)) != FIXED_POINT_TYPE && TREE_CODE (TREE_TYPE (op)) != FIXED_POINT_TYPE
/* Ensure field is laid out already. */ /* Ensure field is laid out already. */
&& DECL_SIZE (TREE_OPERAND (op, 1)) != 0 && DECL_SIZE (TREE_OPERAND (op, 1)) != 0
&& host_integerp (DECL_SIZE (TREE_OPERAND (op, 1)), 1)) && tree_fits_uhwi_p (DECL_SIZE (TREE_OPERAND (op, 1))))
{ {
unsigned HOST_WIDE_INT innerprec unsigned HOST_WIDE_INT innerprec
= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1); = tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);

View File

@ -447,7 +447,7 @@ instrument_builtin_call (gimple_stmt_iterator *gsi)
case check_last: case check_last:
case fetch_op: case fetch_op:
last_arg = gimple_call_arg (stmt, num - 1); last_arg = gimple_call_arg (stmt, num - 1);
if (!host_integerp (last_arg, 1) if (!tree_fits_uhwi_p (last_arg)
|| (unsigned HOST_WIDE_INT) tree_low_cst (last_arg, 1) || (unsigned HOST_WIDE_INT) tree_low_cst (last_arg, 1)
> MEMMODEL_SEQ_CST) > MEMMODEL_SEQ_CST)
return; return;
@ -519,11 +519,11 @@ instrument_builtin_call (gimple_stmt_iterator *gsi)
gcc_assert (num == 6); gcc_assert (num == 6);
for (j = 0; j < 6; j++) for (j = 0; j < 6; j++)
args[j] = gimple_call_arg (stmt, j); args[j] = gimple_call_arg (stmt, j);
if (!host_integerp (args[4], 1) if (!tree_fits_uhwi_p (args[4])
|| (unsigned HOST_WIDE_INT) tree_low_cst (args[4], 1) || (unsigned HOST_WIDE_INT) tree_low_cst (args[4], 1)
> MEMMODEL_SEQ_CST) > MEMMODEL_SEQ_CST)
return; return;
if (!host_integerp (args[5], 1) if (!tree_fits_uhwi_p (args[5])
|| (unsigned HOST_WIDE_INT) tree_low_cst (args[5], 1) || (unsigned HOST_WIDE_INT) tree_low_cst (args[5], 1)
> MEMMODEL_SEQ_CST) > MEMMODEL_SEQ_CST)
return; return;

View File

@ -233,7 +233,7 @@ ubsan_source_location (location_t loc)
static unsigned short static unsigned short
get_ubsan_type_info_for_type (tree type) get_ubsan_type_info_for_type (tree type)
{ {
gcc_assert (TYPE_SIZE (type) && host_integerp (TYPE_SIZE (type), 1)); gcc_assert (TYPE_SIZE (type) && tree_fits_uhwi_p (TYPE_SIZE (type)));
int prec = exact_log2 (tree_low_cst (TYPE_SIZE (type), 1)); int prec = exact_log2 (tree_low_cst (TYPE_SIZE (type), 1));
gcc_assert (prec != -1); gcc_assert (prec != -1);
return (prec << 1) | !TYPE_UNSIGNED (type); return (prec << 1) | !TYPE_UNSIGNED (type);

View File

@ -1136,7 +1136,7 @@ get_block_for_decl (tree decl)
constant size. */ constant size. */
if (DECL_SIZE_UNIT (decl) == NULL) if (DECL_SIZE_UNIT (decl) == NULL)
return NULL; return NULL;
if (!host_integerp (DECL_SIZE_UNIT (decl), 1)) if (!tree_fits_uhwi_p (DECL_SIZE_UNIT (decl)))
return NULL; return NULL;
/* Find out which section should contain DECL. We cannot put it into /* Find out which section should contain DECL. We cannot put it into