diff options
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 16 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/misc.c | 4 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/utils.c | 30 |
3 files changed, 25 insertions, 25 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index d3cc546..3ad53c4 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -837,7 +837,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) 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) align = 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 && gnu_expr && TREE_CONSTANT (gnu_expr) && 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) && !host_integerp (TYPE_SIZE_UNIT (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); if (RECORD_OR_UNION_TYPE_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 = 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 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) post_error_ne ("?suspiciously large alignment specified for&", 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 - && host_integerp (TYPE_SIZE (gnu_type), 1) + && tree_fits_uhwi_p (TYPE_SIZE (gnu_type)) && integer_pow2p (TYPE_SIZE (gnu_type))) align = MIN (BIGGEST_ALIGNMENT, tree_low_cst (TYPE_SIZE (gnu_type), 1)); else if (Is_Atomic (gnat_entity) && gnu_size - && host_integerp (gnu_size, 1) + && tree_fits_uhwi_p (gnu_size) && integer_pow2p (gnu_size)) 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) && RECORD_OR_UNION_TYPE_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); 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 && RECORD_OR_UNION_TYPE_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 || (gnu_size && (tree_int_cst_lt (gnu_size, TYPE_SIZE (gnu_field_type)) diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 3abe57b..a82f6fd8 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -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, which should stay untouched. */ - if (!host_integerp (max_unitsize, 1) + if (!tree_fits_uhwi_p (max_unitsize) && RECORD_OR_UNION_TYPE_P (gnu_type) && !TYPE_FAT_POINTER_P (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 type's alignment and return the result in units. */ - if (host_integerp (max_adasize, 1)) + if (tree_fits_uhwi_p (max_adasize)) max_unitsize = size_binop (CEIL_DIV_EXPR, round_up (max_adasize, TYPE_ALIGN (gnu_type)), diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c index 01a6028..4588c52 100644 --- a/gcc/ada/gcc-interface/utils.c +++ b/gcc/ada/gcc-interface/utils.c @@ -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. */ if (TYPE_CONTAINS_TEMPLATE_P (type) - || !host_integerp (TYPE_ADA_SIZE (type), 1)) + || !tree_fits_uhwi_p (TYPE_ADA_SIZE (type))) return type; /* 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) && !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); /* 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 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; size = tree_low_cst (size_tree, 1); @@ -1741,7 +1741,7 @@ rest_of_record_type_compilation (tree record_type) if (!pos && 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); align = tree_low_cst (TREE_OPERAND (curpos, 1), 1); @@ -1751,7 +1751,7 @@ rest_of_record_type_compilation (tree record_type) } else if (!pos && 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 && host_integerp (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. */ 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); else 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); SET_DECL_OFFSET_ALIGN (field_decl, - host_integerp (pos, 1) ? BIGGEST_ALIGNMENT + tree_fits_uhwi_p (pos) ? BIGGEST_ALIGNMENT : BITS_PER_UNIT); pos_from_bit (&DECL_FIELD_OFFSET (field_decl), &DECL_FIELD_BIT_OFFSET (field_decl), @@ -2548,7 +2548,7 @@ invalidate_global_renaming_pointers (void) bool 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; 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 curr_field is constant, then there is a gap if the value of this constant is not null. */ - if (offset && host_integerp (offset, 1)) + if (offset && tree_fits_uhwi_p (offset)) return !integer_zerop (offset); /* 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 iff it is not multiple of the current field alignment. */ - if (host_integerp (DECL_SIZE (prev_field), 1) - && host_integerp (bit_position (prev_field), 1)) + if (tree_fits_uhwi_p (DECL_SIZE (prev_field)) + && tree_fits_uhwi_p (bit_position (prev_field))) return ((tree_low_cst (bit_position (prev_field), 1) + tree_low_cst (DECL_SIZE (prev_field), 1)) % DECL_ALIGN (curr_field) != 0); @@ -6302,7 +6302,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args, size = TREE_VALUE (args); - if (!host_integerp (size, 1)) + if (!tree_fits_uhwi_p (size)) { warning (OPT_Wattributes, "%qs attribute ignored", IDENTIFIER_POINTER (name)); @@ -6334,7 +6334,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args, || (!SCALAR_FLOAT_MODE_P (orig_mode) && GET_MODE_CLASS (orig_mode) != MODE_INT && !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) { 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 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; /* 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) && GET_MODE_CLASS (elem_mode) != MODE_INT && !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", IDENTIFIER_POINTER (name)); |