Commit 315cff15 by Eric Botcazou Committed by Eric Botcazou

ada-tree.h (TYPE_FAT_POINTER_P): Swap with...

	* gcc-interface/ada-tree.h (TYPE_FAT_POINTER_P): Swap with...
	(TYPE_IS_FAT_POINTER_P): ...this.
	(TYPE_THIN_POINTER_P): Rename into...
	(TYPE_IS_THIN_POINTER_P): ...this.
	(TYPE_FAT_OR_THIN_POINTER_P): Rename into...
	(TYPE_IS_FAT_OR_THIN_POINTER_P): ...this.
	(TYPE_IS_PADDING_P): Change definition, move old one to...
	(TYPE_PADDING_P): ...this.
	* gcc-interface/decl.c (gnat_to_gnu_entity): Adjust for above changes.
	(get_unpadded_type): Likewise.
	(gnat_to_gnu_component_type): Likewise.
	(gnat_to_gnu_param): Likewise.
	(relate_alias_sets): Likewise.
	(make_packable_type): Likewise.
	(maybe_pad_type): Likewise.
	(gnat_to_gnu_field): Likewise.
	(is_variable_size): Likewise.
	(annotate_object): Likewise.
	(validate_size): Likewise.
	(set_rm_size): Likewise.
	(make_type_from_size): Likewise.
	(rm_size): Likewise.
	* gcc-interface/misc.c (gnat_print_type): Likewise.
	(gnat_get_alias_set): Likewise.
	* gcc-interface/trans.c (Identifier_to_gnu): Likewise.
	(Attribute_to_gnu): Likewise.
	(call_to_gnu): Likewise.
	(gnat_to_gnu): Likewise.
	(add_decl_expr): Likewise.
	(convert_with_check): Likewise.
	(addressable_p): Likewise.
	(maybe_implicit_deref): Likewise.
	(protect_multiple_eval): Likewise.
	(gnat_stabilize_reference_1): Likewise.
	* gcc-interface/utils.c (gnat_pushdecl): Likewise.
	(finish_record_type): Likewise.
	(rest_of_record_type_compilation): Likewise.
	(create_type_decl): Likewise.
	(gnat_types_compatible_p): Likewise.
	(build_template): Likewise.
	(convert_vms_descriptor64): Likewise.
	(convert_vms_descriptor32): Likewise.
	(build_unc_object_type_from_ptr): Likewise.
	(update_pointer_to): Likewise.
	(convert_to_fat_pointer): Likewise.
	(convert_to_fat_pointer): Likewise.
	(convert): Likewise.
	(remove_conversions): Likewise.
	(maybe_unconstrained_array): Likewise.
	(unchecked_convert): Likewise.
	(handle_vector_type_attribute): Likewise.
	* gcc-interface/utils2.c (build_binary_op): Likewise.
	(build_unary_op): Likewise.
	(build_allocator): Likewise.

From-SVN: r152917
parent afb4afcd
2009-10-16 Eric Botcazou <ebotcazou@adacore.com> 2009-10-16 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.h (TYPE_FAT_POINTER_P): Swap with...
(TYPE_IS_FAT_POINTER_P): ...this.
(TYPE_THIN_POINTER_P): Rename into...
(TYPE_IS_THIN_POINTER_P): ...this.
(TYPE_FAT_OR_THIN_POINTER_P): Rename into...
(TYPE_IS_FAT_OR_THIN_POINTER_P): ...this.
(TYPE_IS_PADDING_P): Change definition, move old one to...
(TYPE_PADDING_P): ...this.
* gcc-interface/decl.c (gnat_to_gnu_entity): Adjust for above changes.
(get_unpadded_type): Likewise.
(gnat_to_gnu_component_type): Likewise.
(gnat_to_gnu_param): Likewise.
(relate_alias_sets): Likewise.
(make_packable_type): Likewise.
(maybe_pad_type): Likewise.
(gnat_to_gnu_field): Likewise.
(is_variable_size): Likewise.
(annotate_object): Likewise.
(validate_size): Likewise.
(set_rm_size): Likewise.
(make_type_from_size): Likewise.
(rm_size): Likewise.
* gcc-interface/misc.c (gnat_print_type): Likewise.
(gnat_get_alias_set): Likewise.
* gcc-interface/trans.c (Identifier_to_gnu): Likewise.
(Attribute_to_gnu): Likewise.
(call_to_gnu): Likewise.
(gnat_to_gnu): Likewise.
(add_decl_expr): Likewise.
(convert_with_check): Likewise.
(addressable_p): Likewise.
(maybe_implicit_deref): Likewise.
(protect_multiple_eval): Likewise.
(gnat_stabilize_reference_1): Likewise.
* gcc-interface/utils.c (gnat_pushdecl): Likewise.
(finish_record_type): Likewise.
(rest_of_record_type_compilation): Likewise.
(create_type_decl): Likewise.
(gnat_types_compatible_p): Likewise.
(build_template): Likewise.
(convert_vms_descriptor64): Likewise.
(convert_vms_descriptor32): Likewise.
(build_unc_object_type_from_ptr): Likewise.
(update_pointer_to): Likewise.
(convert_to_fat_pointer): Likewise.
(convert_to_fat_pointer): Likewise.
(convert): Likewise.
(remove_conversions): Likewise.
(maybe_unconstrained_array): Likewise.
(unchecked_convert): Likewise.
(handle_vector_type_attribute): Likewise.
* gcc-interface/utils2.c (build_binary_op): Likewise.
(build_unary_op): Likewise.
(build_allocator): Likewise.
2009-10-16 Eric Botcazou <ebotcazou@adacore.com>
* exp_dbug.ads: Adjust type names in comments. * exp_dbug.ads: Adjust type names in comments.
* gcc-interface/decl.c (maybe_pad_type): Remove NAME_TRAILER parameter, * gcc-interface/decl.c (maybe_pad_type): Remove NAME_TRAILER parameter,
add new IS_COMPONENT_TYPE parameter. Adjust. Remove dead code. add new IS_COMPONENT_TYPE parameter. Adjust. Remove dead code.
......
...@@ -65,11 +65,11 @@ do { \ ...@@ -65,11 +65,11 @@ do { \
/* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is a /* For RECORD_TYPE, UNION_TYPE, and QUAL_UNION_TYPE, nonzero if this is a
record being used as a fat pointer (only true for RECORD_TYPE). */ record being used as a fat pointer (only true for RECORD_TYPE). */
#define TYPE_IS_FAT_POINTER_P(NODE) \ #define TYPE_FAT_POINTER_P(NODE) \
TYPE_LANG_FLAG_0 (RECORD_OR_UNION_CHECK (NODE)) TYPE_LANG_FLAG_0 (RECORD_OR_UNION_CHECK (NODE))
#define TYPE_FAT_POINTER_P(NODE) \ #define TYPE_IS_FAT_POINTER_P(NODE) \
(TREE_CODE (NODE) == RECORD_TYPE && TYPE_IS_FAT_POINTER_P (NODE)) (TREE_CODE (NODE) == RECORD_TYPE && TYPE_FAT_POINTER_P (NODE))
/* For integral types and array types, nonzero if this is a packed array type /* For integral types and array types, nonzero if this is a packed array type
used for bit-packed types. Such types should not be extended to a larger used for bit-packed types. Such types should not be extended to a larger
...@@ -117,15 +117,15 @@ do { \ ...@@ -117,15 +117,15 @@ do { \
TYPE_LANG_FLAG_3 (INTEGER_TYPE_CHECK (NODE)) TYPE_LANG_FLAG_3 (INTEGER_TYPE_CHECK (NODE))
/* True if NODE is a thin pointer. */ /* True if NODE is a thin pointer. */
#define TYPE_THIN_POINTER_P(NODE) \ #define TYPE_IS_THIN_POINTER_P(NODE) \
(POINTER_TYPE_P (NODE) \ (POINTER_TYPE_P (NODE) \
&& TREE_CODE (TREE_TYPE (NODE)) == RECORD_TYPE \ && TREE_CODE (TREE_TYPE (NODE)) == RECORD_TYPE \
&& TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (NODE))) && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (NODE)))
/* True if TYPE is either a fat or thin pointer to an unconstrained /* True if TYPE is either a fat or thin pointer to an unconstrained
array. */ array. */
#define TYPE_FAT_OR_THIN_POINTER_P(NODE) \ #define TYPE_IS_FAT_OR_THIN_POINTER_P(NODE) \
(TYPE_FAT_POINTER_P (NODE) || TYPE_THIN_POINTER_P (NODE)) (TYPE_IS_FAT_POINTER_P (NODE) || TYPE_IS_THIN_POINTER_P (NODE))
/* For INTEGER_TYPEs, nonzero if the type has a biased representation. */ /* For INTEGER_TYPEs, nonzero if the type has a biased representation. */
#define TYPE_BIASED_REPRESENTATION_P(NODE) \ #define TYPE_BIASED_REPRESENTATION_P(NODE) \
...@@ -143,7 +143,6 @@ do { \ ...@@ -143,7 +143,6 @@ do { \
is a dummy type, made to correspond to a private or incomplete type. */ is a dummy type, made to correspond to a private or incomplete type. */
#define TYPE_DUMMY_P(NODE) TYPE_LANG_FLAG_4 (NODE) #define TYPE_DUMMY_P(NODE) TYPE_LANG_FLAG_4 (NODE)
/* True if TYPE is such a dummy type. */
#define TYPE_IS_DUMMY_P(NODE) \ #define TYPE_IS_DUMMY_P(NODE) \
((TREE_CODE (NODE) == VOID_TYPE || TREE_CODE (NODE) == RECORD_TYPE \ ((TREE_CODE (NODE) == VOID_TYPE || TREE_CODE (NODE) == RECORD_TYPE \
|| TREE_CODE (NODE) == UNION_TYPE || TREE_CODE (NODE) == ENUMERAL_TYPE) \ || TREE_CODE (NODE) == UNION_TYPE || TREE_CODE (NODE) == ENUMERAL_TYPE) \
...@@ -160,7 +159,10 @@ do { \ ...@@ -160,7 +159,10 @@ do { \
/* For a RECORD_TYPE, nonzero if this was made just to supply needed /* For a RECORD_TYPE, nonzero if this was made just to supply needed
padding or alignment. */ padding or alignment. */
#define TYPE_IS_PADDING_P(NODE) TYPE_LANG_FLAG_5 (RECORD_TYPE_CHECK (NODE)) #define TYPE_PADDING_P(NODE) TYPE_LANG_FLAG_5 (RECORD_TYPE_CHECK (NODE))
#define TYPE_IS_PADDING_P(NODE) \
(TREE_CODE (NODE) == RECORD_TYPE && TYPE_PADDING_P (NODE))
/* True if TYPE can alias any other types. */ /* True if TYPE can alias any other types. */
#define TYPE_UNIVERSAL_ALIASING_P(NODE) TYPE_LANG_FLAG_6 (NODE) #define TYPE_UNIVERSAL_ALIASING_P(NODE) TYPE_LANG_FLAG_6 (NODE)
......
...@@ -676,8 +676,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -676,8 +676,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
despite having a nominal type with self-referential despite having a nominal type with self-referential
size, we can get the size directly from it. */ size, we can get the size directly from it. */
if (TREE_CODE (gnu_expr) == COMPONENT_REF if (TREE_CODE (gnu_expr) == COMPONENT_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))
== RECORD_TYPE
&& TYPE_IS_PADDING_P && TYPE_IS_PADDING_P
(TREE_TYPE (TREE_OPERAND (gnu_expr, 0))) (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))
&& TREE_CODE (TREE_OPERAND (gnu_expr, 0)) == VAR_DECL && TREE_CODE (TREE_OPERAND (gnu_expr, 0)) == VAR_DECL
...@@ -852,8 +850,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -852,8 +850,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* If the renamed object had padding, strip off the reference /* If the renamed object had padding, strip off the reference
to the inner object and reset our type. */ to the inner object and reset our type. */
if ((TREE_CODE (gnu_expr) == COMPONENT_REF if ((TREE_CODE (gnu_expr) == COMPONENT_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))
== RECORD_TYPE
&& TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))) && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))
/* Strip useless conversions around the object. */ /* Strip useless conversions around the object. */
|| (TREE_CODE (gnu_expr) == NOP_EXPR || (TREE_CODE (gnu_expr) == NOP_EXPR
...@@ -1018,14 +1014,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1018,14 +1014,14 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& TREE_CODE (gnu_type) == RECORD_TYPE && TREE_CODE (gnu_type) == RECORD_TYPE
&& (TYPE_CONTAINS_TEMPLATE_P (gnu_type) && (TYPE_CONTAINS_TEMPLATE_P (gnu_type)
/* Beware that padding might have been introduced above. */ /* Beware that padding might have been introduced above. */
|| (TYPE_IS_PADDING_P (gnu_type) || (TYPE_PADDING_P (gnu_type)
&& TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type))) && TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type)))
== RECORD_TYPE == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P && TYPE_CONTAINS_TEMPLATE_P
(TREE_TYPE (TYPE_FIELDS (gnu_type)))))) (TREE_TYPE (TYPE_FIELDS (gnu_type))))))
{ {
tree template_field tree template_field
= TYPE_IS_PADDING_P (gnu_type) = TYPE_PADDING_P (gnu_type)
? TYPE_FIELDS (TREE_TYPE (TYPE_FIELDS (gnu_type))) ? TYPE_FIELDS (TREE_TYPE (TYPE_FIELDS (gnu_type)))
: TYPE_FIELDS (gnu_type); : TYPE_FIELDS (gnu_type);
...@@ -1049,17 +1045,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1049,17 +1045,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (gnu_expr if (gnu_expr
&& TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE && TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE
&& !CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_type)) && !CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_type))
&& !(TREE_CODE (gnu_type) == RECORD_TYPE && !(TYPE_IS_PADDING_P (gnu_type)
&& TYPE_IS_PADDING_P (gnu_type) && CONTAINS_PLACEHOLDER_P
&& (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type))))))
(TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type)))))))
gnu_expr = convert (gnu_type, gnu_expr); gnu_expr = convert (gnu_type, gnu_expr);
/* If this is a pointer and it does not have an initializing /* If this is a pointer and it does not have an initializing
expression, initialize it to NULL, unless the object is expression, initialize it to NULL, unless the object is
imported. */ imported. */
if (definition if (definition
&& (POINTER_TYPE_P (gnu_type) || TYPE_FAT_POINTER_P (gnu_type)) && (POINTER_TYPE_P (gnu_type) || TYPE_IS_FAT_POINTER_P (gnu_type))
&& !Is_Imported (gnat_entity) && !gnu_expr) && !Is_Imported (gnat_entity) && !gnu_expr)
gnu_expr = integer_zero_node; gnu_expr = integer_zero_node;
...@@ -1278,10 +1273,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1278,10 +1273,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (gnu_expr if (gnu_expr
&& TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE && TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE
&& !CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_type)) && !CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_type))
&& !(TREE_CODE (gnu_type) == RECORD_TYPE && !(TYPE_IS_PADDING_P (gnu_type)
&& TYPE_IS_PADDING_P (gnu_type) && CONTAINS_PLACEHOLDER_P
&& (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type))))))
(TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type)))))))
gnu_expr = convert (gnu_type, gnu_expr); gnu_expr = convert (gnu_type, gnu_expr);
/* If this name is external or there was a name specified, use it, /* If this name is external or there was a name specified, use it,
...@@ -1303,8 +1297,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1303,8 +1297,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& 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) && host_integerp (TYPE_SIZE_UNIT (gnu_type), 1)
&& !(TREE_CODE (gnu_type) == RECORD_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)))
static_p = true; static_p = true;
...@@ -1686,7 +1679,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1686,7 +1679,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_field_type, gnu_type, 1, 0, 0, 0); gnu_field_type, gnu_type, 1, 0, 0, 0);
finish_record_type (gnu_type, gnu_field, 0, false); finish_record_type (gnu_type, gnu_field, 0, false);
TYPE_IS_PADDING_P (gnu_type) = 1; TYPE_PADDING_P (gnu_type) = 1;
relate_alias_sets (gnu_type, gnu_field_type, ALIAS_SET_COPY); relate_alias_sets (gnu_type, gnu_field_type, ALIAS_SET_COPY);
} }
...@@ -1834,7 +1827,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1834,7 +1827,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Do not finalize this record type since the types of its fields /* Do not finalize this record type since the types of its fields
are still incomplete at this point. */ are still incomplete at this point. */
finish_record_type (gnu_fat_type, tem, 0, true); finish_record_type (gnu_fat_type, tem, 0, true);
TYPE_IS_FAT_POINTER_P (gnu_fat_type) = 1; TYPE_FAT_POINTER_P (gnu_fat_type) = 1;
/* Build a reference to the template from a PLACEHOLDER_EXPR that /* Build a reference to the template from a PLACEHOLDER_EXPR that
is the fat pointer. This will be used to access the individual is the fat pointer. This will be used to access the individual
...@@ -2476,7 +2469,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -2476,7 +2469,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_inner = gnu_type; gnu_inner = gnu_type;
while (TREE_CODE (gnu_inner) == RECORD_TYPE while (TREE_CODE (gnu_inner) == RECORD_TYPE
&& (TYPE_JUSTIFIED_MODULAR_P (gnu_inner) && (TYPE_JUSTIFIED_MODULAR_P (gnu_inner)
|| TYPE_IS_PADDING_P (gnu_inner))) || TYPE_PADDING_P (gnu_inner)))
gnu_inner = TREE_TYPE (TYPE_FIELDS (gnu_inner)); gnu_inner = TREE_TYPE (TYPE_FIELDS (gnu_inner));
/* We need to attach the index type to the type we just made so /* We need to attach the index type to the type we just made so
...@@ -2985,8 +2978,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -2985,8 +2978,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
copy_and_substitute_in_size (gnu_type, gnu_base_type, copy_and_substitute_in_size (gnu_type, gnu_base_type,
gnu_subst_list); gnu_subst_list);
if (TREE_CODE (gnu_base_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (gnu_base_type))
&& TYPE_IS_PADDING_P (gnu_base_type))
gnu_unpad_base_type = TREE_TYPE (TYPE_FIELDS (gnu_base_type)); gnu_unpad_base_type = TREE_TYPE (TYPE_FIELDS (gnu_base_type));
else else
gnu_unpad_base_type = gnu_base_type; gnu_unpad_base_type = gnu_base_type;
...@@ -3096,7 +3088,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -3096,7 +3088,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 (TREE_CODE (gnu_field_type) == RECORD_TYPE if (TREE_CODE (gnu_field_type) == RECORD_TYPE
&& !TYPE_IS_FAT_POINTER_P (gnu_field_type) && !TYPE_FAT_POINTER_P (gnu_field_type)
&& host_integerp (TYPE_SIZE (gnu_field_type), 1)) && host_integerp (TYPE_SIZE (gnu_field_type), 1))
gnu_field_type gnu_field_type
= make_packable_type (gnu_field_type, true); = make_packable_type (gnu_field_type, true);
...@@ -3464,7 +3456,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -3464,7 +3456,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Make sure we can place this into a register. */ /* Make sure we can place this into a register. */
TYPE_ALIGN (gnu_type) TYPE_ALIGN (gnu_type)
= MIN (BIGGEST_ALIGNMENT, 2 * POINTER_SIZE); = MIN (BIGGEST_ALIGNMENT, 2 * POINTER_SIZE);
TYPE_IS_FAT_POINTER_P (gnu_type) = 1; TYPE_FAT_POINTER_P (gnu_type) = 1;
/* Do not finalize this record type since the types of /* Do not finalize this record type since the types of
its fields are incomplete. */ its fields are incomplete. */
...@@ -3598,11 +3590,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -3598,11 +3590,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if ((! in_main_unit || is_from_limited_with) && made_dummy) if ((! in_main_unit || is_from_limited_with) && made_dummy)
{ {
tree gnu_old_type tree gnu_old_type
= TYPE_FAT_POINTER_P (gnu_type) = TYPE_IS_FAT_POINTER_P (gnu_type)
? TYPE_UNCONSTRAINED_ARRAY (gnu_type) : TREE_TYPE (gnu_type); ? TYPE_UNCONSTRAINED_ARRAY (gnu_type) : TREE_TYPE (gnu_type);
if (esize == POINTER_SIZE if (esize == POINTER_SIZE
&& (got_fat_p || TYPE_FAT_POINTER_P (gnu_type))) && (got_fat_p || TYPE_IS_FAT_POINTER_P (gnu_type)))
gnu_type gnu_type
= build_pointer_type = build_pointer_type
(TYPE_OBJECT_RECORD_TYPE (TYPE_OBJECT_RECORD_TYPE
...@@ -3914,8 +3906,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -3914,8 +3906,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* If the type is a padded type and the underlying type would not /* If the type is a padded type and the underlying type would not
be passed by reference or this function has a foreign convention, be passed by reference or this function has a foreign convention,
return the underlying type. */ return the underlying type. */
else if (TREE_CODE (gnu_return_type) == RECORD_TYPE else if (TYPE_IS_PADDING_P (gnu_return_type)
&& TYPE_IS_PADDING_P (gnu_return_type)
&& (!default_pass_by_ref (TREE_TYPE && (!default_pass_by_ref (TREE_TYPE
(TYPE_FIELDS (gnu_return_type))) (TYPE_FIELDS (gnu_return_type)))
|| Has_Foreign_Convention (gnat_entity))) || Has_Foreign_Convention (gnat_entity)))
...@@ -4053,7 +4044,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -4053,7 +4044,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
between two calls, so they can't be CSE'ed. The latter between two calls, so they can't be CSE'ed. The latter
case also handles by-ref parameters. */ case also handles by-ref parameters. */
if (POINTER_TYPE_P (gnu_param_type) if (POINTER_TYPE_P (gnu_param_type)
|| TYPE_FAT_POINTER_P (gnu_param_type)) || TYPE_IS_FAT_POINTER_P (gnu_param_type))
const_flag = false; const_flag = false;
} }
...@@ -4416,7 +4407,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -4416,7 +4407,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
else if ((TREE_CODE (gnu_type) == RECORD_TYPE else if ((TREE_CODE (gnu_type) == RECORD_TYPE
|| TREE_CODE (gnu_type) == UNION_TYPE || TREE_CODE (gnu_type) == UNION_TYPE
|| TREE_CODE (gnu_type) == QUAL_UNION_TYPE) || TREE_CODE (gnu_type) == QUAL_UNION_TYPE)
&& !TYPE_IS_FAT_POINTER_P (gnu_type)) && !TYPE_FAT_POINTER_P (gnu_type))
size = rm_size (gnu_type); size = rm_size (gnu_type);
else else
size = TYPE_SIZE (gnu_type); size = TYPE_SIZE (gnu_type);
...@@ -4447,8 +4438,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -4447,8 +4438,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity, gnu_type = maybe_pad_type (gnu_type, gnu_size, align, gnat_entity,
false, true, definition, false); false, true, definition, false);
if (TREE_CODE (gnu_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (gnu_type))
&& TYPE_IS_PADDING_P (gnu_type))
{ {
gnu_entity_name = TYPE_NAME (gnu_type); gnu_entity_name = TYPE_NAME (gnu_type);
if (TREE_CODE (gnu_entity_name) == TYPE_DECL) if (TREE_CODE (gnu_entity_name) == TYPE_DECL)
...@@ -4704,8 +4694,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -4704,8 +4694,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
tree gnu_low_bound, gnu_high_bound; tree gnu_low_bound, gnu_high_bound;
/* If this is a padded type, we need to use the underlying type. */ /* If this is a padded type, we need to use the underlying type. */
if (TREE_CODE (gnu_scalar_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (gnu_scalar_type))
&& TYPE_IS_PADDING_P (gnu_scalar_type))
gnu_scalar_type = TREE_TYPE (TYPE_FIELDS (gnu_scalar_type)); gnu_scalar_type = TREE_TYPE (TYPE_FIELDS (gnu_scalar_type));
/* If this is a floating point type and we haven't set a floating /* If this is a floating point type and we haven't set a floating
...@@ -4851,7 +4840,7 @@ get_unpadded_type (Entity_Id gnat_entity) ...@@ -4851,7 +4840,7 @@ get_unpadded_type (Entity_Id gnat_entity)
{ {
tree type = gnat_to_gnu_type (gnat_entity); tree type = gnat_to_gnu_type (gnat_entity);
if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type)) if (TYPE_IS_PADDING_P (type))
type = TREE_TYPE (TYPE_FIELDS (type)); type = TREE_TYPE (TYPE_FIELDS (type));
return type; return type;
...@@ -4984,7 +4973,7 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition, ...@@ -4984,7 +4973,7 @@ gnat_to_gnu_component_type (Entity_Id gnat_array, bool definition,
&& !Has_Aliased_Components (gnat_array) && !Has_Aliased_Components (gnat_array)
&& !Strict_Alignment (Component_Type (gnat_array)) && !Strict_Alignment (Component_Type (gnat_array))
&& TREE_CODE (gnu_type) == RECORD_TYPE && TREE_CODE (gnu_type) == RECORD_TYPE
&& !TYPE_IS_FAT_POINTER_P (gnu_type) && !TYPE_FAT_POINTER_P (gnu_type)
&& host_integerp (TYPE_SIZE (gnu_type), 1)) && host_integerp (TYPE_SIZE (gnu_type), 1))
gnu_type = make_packable_type (gnu_type, false); gnu_type = make_packable_type (gnu_type, false);
...@@ -5088,8 +5077,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech, ...@@ -5088,8 +5077,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
/* If this is either a foreign function or if the underlying type won't /* If this is either a foreign function or if the underlying type won't
be passed by reference, strip off possible padding type. */ be passed by reference, strip off possible padding type. */
if (TREE_CODE (gnu_param_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (gnu_param_type))
&& TYPE_IS_PADDING_P (gnu_param_type))
{ {
tree unpadded_type = TREE_TYPE (TYPE_FIELDS (gnu_param_type)); tree unpadded_type = TREE_TYPE (TYPE_FIELDS (gnu_param_type));
...@@ -5161,7 +5149,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech, ...@@ -5161,7 +5149,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
} }
/* Fat pointers are passed as thin pointers for foreign conventions. */ /* Fat pointers are passed as thin pointers for foreign conventions. */
else if (foreign && TYPE_FAT_POINTER_P (gnu_param_type)) else if (foreign && TYPE_IS_FAT_POINTER_P (gnu_param_type))
gnu_param_type gnu_param_type
= make_type_from_size (gnu_param_type, size_int (POINTER_SIZE), 0); = make_type_from_size (gnu_param_type, size_int (POINTER_SIZE), 0);
...@@ -5462,7 +5450,7 @@ relate_alias_sets (tree gnu_new_type, tree gnu_old_type, enum alias_set_op op) ...@@ -5462,7 +5450,7 @@ relate_alias_sets (tree gnu_new_type, tree gnu_old_type, enum alias_set_op op)
see the inner types. */ see the inner types. */
while (TREE_CODE (gnu_old_type) == RECORD_TYPE while (TREE_CODE (gnu_old_type) == RECORD_TYPE
&& (TYPE_JUSTIFIED_MODULAR_P (gnu_old_type) && (TYPE_JUSTIFIED_MODULAR_P (gnu_old_type)
|| TYPE_IS_PADDING_P (gnu_old_type))) || TYPE_PADDING_P (gnu_old_type)))
gnu_old_type = TREE_TYPE (TYPE_FIELDS (gnu_old_type)); gnu_old_type = TREE_TYPE (TYPE_FIELDS (gnu_old_type));
/* Unconstrained array types are deemed incomplete and would thus be given /* Unconstrained array types are deemed incomplete and would thus be given
...@@ -5928,7 +5916,7 @@ make_packable_type (tree type, bool in_record) ...@@ -5928,7 +5916,7 @@ make_packable_type (tree type, bool in_record)
TYPE_JUSTIFIED_MODULAR_P (new_type) = TYPE_JUSTIFIED_MODULAR_P (type); TYPE_JUSTIFIED_MODULAR_P (new_type) = TYPE_JUSTIFIED_MODULAR_P (type);
TYPE_CONTAINS_TEMPLATE_P (new_type) = TYPE_CONTAINS_TEMPLATE_P (type); TYPE_CONTAINS_TEMPLATE_P (new_type) = TYPE_CONTAINS_TEMPLATE_P (type);
if (TREE_CODE (type) == RECORD_TYPE) if (TREE_CODE (type) == RECORD_TYPE)
TYPE_IS_PADDING_P (new_type) = TYPE_IS_PADDING_P (type); TYPE_PADDING_P (new_type) = TYPE_PADDING_P (type);
/* If we are in a record and have a small size, set the alignment to /* If we are in a record and have a small size, set the alignment to
try for an integral mode. Otherwise set it to try for a smaller try for an integral mode. Otherwise set it to try for a smaller
...@@ -5971,7 +5959,7 @@ make_packable_type (tree type, bool in_record) ...@@ -5971,7 +5959,7 @@ make_packable_type (tree type, bool in_record)
if ((TREE_CODE (new_field_type) == RECORD_TYPE if ((TREE_CODE (new_field_type) == RECORD_TYPE
|| TREE_CODE (new_field_type) == UNION_TYPE || TREE_CODE (new_field_type) == UNION_TYPE
|| TREE_CODE (new_field_type) == QUAL_UNION_TYPE) || TREE_CODE (new_field_type) == QUAL_UNION_TYPE)
&& !TYPE_IS_FAT_POINTER_P (new_field_type) && !TYPE_FAT_POINTER_P (new_field_type)
&& host_integerp (TYPE_SIZE (new_field_type), 1)) && host_integerp (TYPE_SIZE (new_field_type), 1))
new_field_type = make_packable_type (new_field_type, true); new_field_type = make_packable_type (new_field_type, true);
...@@ -5983,7 +5971,7 @@ make_packable_type (tree type, bool in_record) ...@@ -5983,7 +5971,7 @@ make_packable_type (tree type, bool in_record)
&& (TREE_CODE (new_field_type) == RECORD_TYPE && (TREE_CODE (new_field_type) == RECORD_TYPE
|| TREE_CODE (new_field_type) == UNION_TYPE || TREE_CODE (new_field_type) == UNION_TYPE
|| TREE_CODE (new_field_type) == QUAL_UNION_TYPE) || TREE_CODE (new_field_type) == QUAL_UNION_TYPE)
&& !TYPE_IS_FAT_POINTER_P (new_field_type) && !TYPE_FAT_POINTER_P (new_field_type)
&& !TYPE_CONTAINS_TEMPLATE_P (new_field_type) && !TYPE_CONTAINS_TEMPLATE_P (new_field_type)
&& TYPE_ADA_SIZE (new_field_type)) && TYPE_ADA_SIZE (new_field_type))
new_size = TYPE_ADA_SIZE (new_field_type); new_size = TYPE_ADA_SIZE (new_field_type);
...@@ -6012,8 +6000,7 @@ make_packable_type (tree type, bool in_record) ...@@ -6012,8 +6000,7 @@ make_packable_type (tree type, bool in_record)
/* If this is a padding record, we never want to make the size smaller /* If this is a padding record, we never want to make the size smaller
than what was specified. For QUAL_UNION_TYPE, also copy the size. */ than what was specified. For QUAL_UNION_TYPE, also copy the size. */
if ((TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type)) if (TYPE_IS_PADDING_P (type) || TREE_CODE (type) == QUAL_UNION_TYPE)
|| TREE_CODE (type) == QUAL_UNION_TYPE)
{ {
TYPE_SIZE (new_type) = TYPE_SIZE (type); TYPE_SIZE (new_type) = TYPE_SIZE (type);
TYPE_SIZE_UNIT (new_type) = TYPE_SIZE_UNIT (type); TYPE_SIZE_UNIT (new_type) = TYPE_SIZE_UNIT (type);
...@@ -6066,7 +6053,7 @@ maybe_pad_type (tree type, tree size, unsigned int align, ...@@ -6066,7 +6053,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
off the padding, since we will either be returning the inner type off the padding, since we will either be returning the inner type
or repadding it. If no size or alignment is specified, use that of or repadding it. If no size or alignment is specified, use that of
the original padded type. */ the original padded type. */
if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type)) if (TYPE_IS_PADDING_P (type))
{ {
if ((!size if ((!size
|| operand_equal_p (round_up (size, || operand_equal_p (round_up (size,
...@@ -6115,7 +6102,7 @@ maybe_pad_type (tree type, tree size, unsigned int align, ...@@ -6115,7 +6102,7 @@ maybe_pad_type (tree type, tree size, unsigned int align,
generate incorrect debugging information. So make a new record generate incorrect debugging information. So make a new record
type and name. */ type and name. */
record = make_node (RECORD_TYPE); record = make_node (RECORD_TYPE);
TYPE_IS_PADDING_P (record) = 1; TYPE_PADDING_P (record) = 1;
if (Present (gnat_entity)) if (Present (gnat_entity))
TYPE_NAME (record) = create_concat_name (gnat_entity, "PAD"); TYPE_NAME (record) = create_concat_name (gnat_entity, "PAD");
...@@ -6438,7 +6425,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, ...@@ -6438,7 +6425,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed,
from a component clause. */ from a component clause. */
if (TREE_CODE (gnu_field_type) == RECORD_TYPE if (TREE_CODE (gnu_field_type) == RECORD_TYPE
&& !TYPE_IS_FAT_POINTER_P (gnu_field_type) && !TYPE_FAT_POINTER_P (gnu_field_type)
&& host_integerp (TYPE_SIZE (gnu_field_type), 1) && host_integerp (TYPE_SIZE (gnu_field_type), 1)
&& (packed == 1 && (packed == 1
|| (gnu_size || (gnu_size
...@@ -6668,8 +6655,7 @@ is_variable_size (tree type) ...@@ -6668,8 +6655,7 @@ is_variable_size (tree type)
if (!TREE_CONSTANT (TYPE_SIZE (type))) if (!TREE_CONSTANT (TYPE_SIZE (type)))
return true; return true;
if (TREE_CODE (type) == RECORD_TYPE if (TYPE_IS_PADDING_P (type)
&& TYPE_IS_PADDING_P (type)
&& !TREE_CONSTANT (DECL_SIZE (TYPE_FIELDS (type)))) && !TREE_CONSTANT (DECL_SIZE (TYPE_FIELDS (type))))
return true; return true;
...@@ -7218,7 +7204,7 @@ annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref) ...@@ -7218,7 +7204,7 @@ annotate_object (Entity_Id gnat_entity, tree gnu_type, tree size, bool by_ref)
{ {
if (by_ref) if (by_ref)
{ {
if (TYPE_FAT_POINTER_P (gnu_type)) if (TYPE_IS_FAT_POINTER_P (gnu_type))
gnu_type = TYPE_UNCONSTRAINED_ARRAY (gnu_type); gnu_type = TYPE_UNCONSTRAINED_ARRAY (gnu_type);
else else
gnu_type = TREE_TYPE (gnu_type); gnu_type = TREE_TYPE (gnu_type);
...@@ -7533,7 +7519,7 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, ...@@ -7533,7 +7519,7 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object,
/* If this is an access type or a fat pointer, the minimum size is that given /* If this is an access type or a fat pointer, the minimum size is that given
by the smallest integral mode that's valid for pointers. */ by the smallest integral mode that's valid for pointers. */
if ((TREE_CODE (gnu_type) == POINTER_TYPE) || TYPE_FAT_POINTER_P (gnu_type)) if (TREE_CODE (gnu_type) == POINTER_TYPE || TYPE_IS_FAT_POINTER_P (gnu_type))
{ {
enum machine_mode p_mode; enum machine_mode p_mode;
...@@ -7627,8 +7613,7 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity) ...@@ -7627,8 +7613,7 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity)
|| (AGGREGATE_TYPE_P (gnu_type) || (AGGREGATE_TYPE_P (gnu_type)
&& !(TREE_CODE (gnu_type) == ARRAY_TYPE && !(TREE_CODE (gnu_type) == ARRAY_TYPE
&& TYPE_PACKED_ARRAY_TYPE_P (gnu_type)) && TYPE_PACKED_ARRAY_TYPE_P (gnu_type))
&& !(TREE_CODE (gnu_type) == RECORD_TYPE && !(TYPE_IS_PADDING_P (gnu_type)
&& TYPE_IS_PADDING_P (gnu_type)
&& TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type))) == ARRAY_TYPE && TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type))) == ARRAY_TYPE
&& TYPE_PACKED_ARRAY_TYPE_P (TREE_TYPE (TYPE_FIELDS (gnu_type)))) && TYPE_PACKED_ARRAY_TYPE_P (TREE_TYPE (TYPE_FIELDS (gnu_type))))
&& tree_int_cst_lt (size, old_size))) && tree_int_cst_lt (size, old_size)))
...@@ -7651,7 +7636,7 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity) ...@@ -7651,7 +7636,7 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity)
else if ((TREE_CODE (gnu_type) == RECORD_TYPE else if ((TREE_CODE (gnu_type) == RECORD_TYPE
|| TREE_CODE (gnu_type) == UNION_TYPE || TREE_CODE (gnu_type) == UNION_TYPE
|| TREE_CODE (gnu_type) == QUAL_UNION_TYPE) || TREE_CODE (gnu_type) == QUAL_UNION_TYPE)
&& !TYPE_IS_FAT_POINTER_P (gnu_type)) && !TYPE_FAT_POINTER_P (gnu_type))
SET_TYPE_ADA_SIZE (gnu_type, size); SET_TYPE_ADA_SIZE (gnu_type, size);
} }
...@@ -7718,7 +7703,7 @@ make_type_from_size (tree type, tree size_tree, bool for_biased) ...@@ -7718,7 +7703,7 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
case RECORD_TYPE: case RECORD_TYPE:
/* Do something if this is a fat pointer, in which case we /* Do something if this is a fat pointer, in which case we
may need to return the thin pointer. */ may need to return the thin pointer. */
if (TYPE_IS_FAT_POINTER_P (type) && size < POINTER_SIZE * 2) if (TYPE_FAT_POINTER_P (type) && size < POINTER_SIZE * 2)
{ {
enum machine_mode p_mode = mode_for_size (size, MODE_INT, 0); enum machine_mode p_mode = mode_for_size (size, MODE_INT, 0);
if (!targetm.valid_pointer_mode (p_mode)) if (!targetm.valid_pointer_mode (p_mode))
...@@ -7733,7 +7718,7 @@ make_type_from_size (tree type, tree size_tree, bool for_biased) ...@@ -7733,7 +7718,7 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
case POINTER_TYPE: case POINTER_TYPE:
/* Only do something if this is a thin pointer, in which case we /* Only do something if this is a thin pointer, in which case we
may need to return the fat pointer. */ may need to return the fat pointer. */
if (TYPE_THIN_POINTER_P (type) && size >= POINTER_SIZE * 2) if (TYPE_IS_THIN_POINTER_P (type) && size >= POINTER_SIZE * 2)
return return
build_pointer_type (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))); build_pointer_type (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type)));
break; break;
...@@ -8384,7 +8369,7 @@ rm_size (tree gnu_type) ...@@ -8384,7 +8369,7 @@ rm_size (tree gnu_type)
if ((TREE_CODE (gnu_type) == RECORD_TYPE if ((TREE_CODE (gnu_type) == RECORD_TYPE
|| TREE_CODE (gnu_type) == UNION_TYPE || TREE_CODE (gnu_type) == UNION_TYPE
|| TREE_CODE (gnu_type) == QUAL_UNION_TYPE) || TREE_CODE (gnu_type) == QUAL_UNION_TYPE)
&& !TYPE_IS_FAT_POINTER_P (gnu_type) && !TYPE_FAT_POINTER_P (gnu_type)
&& TYPE_ADA_SIZE (gnu_type)) && TYPE_ADA_SIZE (gnu_type))
return TYPE_ADA_SIZE (gnu_type); return TYPE_ADA_SIZE (gnu_type);
......
...@@ -527,7 +527,7 @@ gnat_print_type (FILE *file, tree node, int indent) ...@@ -527,7 +527,7 @@ gnat_print_type (FILE *file, tree node, int indent)
break; break;
case RECORD_TYPE: case RECORD_TYPE:
if (TYPE_IS_FAT_POINTER_P (node) || TYPE_CONTAINS_TEMPLATE_P (node)) if (TYPE_FAT_POINTER_P (node) || TYPE_CONTAINS_TEMPLATE_P (node))
print_node (file, "unconstrained array", print_node (file, "unconstrained array",
TYPE_UNCONSTRAINED_ARRAY (node), indent + 4); TYPE_UNCONSTRAINED_ARRAY (node), indent + 4);
else else
...@@ -600,8 +600,7 @@ static alias_set_type ...@@ -600,8 +600,7 @@ static alias_set_type
gnat_get_alias_set (tree type) gnat_get_alias_set (tree type)
{ {
/* If this is a padding type, use the type of the first field. */ /* If this is a padding type, use the type of the first field. */
if (TREE_CODE (type) == RECORD_TYPE if (TYPE_IS_PADDING_P (type))
&& TYPE_IS_PADDING_P (type))
return get_alias_set (TREE_TYPE (TYPE_FIELDS (type))); return get_alias_set (TREE_TYPE (TYPE_FIELDS (type)));
/* If the type is an unconstrained array, use the type of the /* If the type is an unconstrained array, use the type of the
......
...@@ -946,8 +946,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) ...@@ -946,8 +946,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
|| Is_Constr_Subt_For_UN_Aliased (gnat_temp_type)) || Is_Constr_Subt_For_UN_Aliased (gnat_temp_type))
{ {
gnu_result_type = TREE_TYPE (gnu_result); gnu_result_type = TREE_TYPE (gnu_result);
if (TREE_CODE (gnu_result_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (gnu_result_type))
&& TYPE_IS_PADDING_P (gnu_result_type))
gnu_result_type = TREE_TYPE (TYPE_FIELDS (gnu_result_type)); gnu_result_type = TREE_TYPE (TYPE_FIELDS (gnu_result_type));
} }
...@@ -1256,7 +1255,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1256,7 +1255,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* If this is an unconstrained array, we know the object has been /* If this is an unconstrained array, we know the object has been
allocated with the template in front of the object. So compute allocated with the template in front of the object. So compute
the template address. */ the template address. */
if (TYPE_FAT_POINTER_P (TREE_TYPE (gnu_ptr))) if (TYPE_IS_FAT_POINTER_P (TREE_TYPE (gnu_ptr)))
gnu_ptr gnu_ptr
= convert (build_pointer_type = convert (build_pointer_type
(TYPE_OBJECT_RECORD_TYPE (TYPE_OBJECT_RECORD_TYPE
...@@ -1334,8 +1333,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1334,8 +1333,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
of the relevant field. Using the MAX of those two produces the of the relevant field. Using the MAX of those two produces the
right result in all case. Don't use the size of the field if it's right result in all case. Don't use the size of the field if it's
a self-referential type, since that's never what's wanted. */ a self-referential type, since that's never what's wanted. */
if (TREE_CODE (gnu_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (gnu_type)
&& TYPE_IS_PADDING_P (gnu_type)
&& TREE_CODE (gnu_expr) == COMPONENT_REF) && TREE_CODE (gnu_expr) == COMPONENT_REF)
{ {
gnu_result = rm_size (gnu_type); gnu_result = rm_size (gnu_type);
...@@ -1353,7 +1351,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1353,7 +1351,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
tree gnu_ptr_type tree gnu_ptr_type
= TREE_TYPE (gnat_to_gnu (Prefix (gnat_deref))); = TREE_TYPE (gnat_to_gnu (Prefix (gnat_deref)));
if (TYPE_FAT_OR_THIN_POINTER_P (gnu_ptr_type) if (TYPE_IS_FAT_OR_THIN_POINTER_P (gnu_ptr_type)
&& Present (gnat_actual_subtype)) && Present (gnat_actual_subtype))
{ {
tree gnu_actual_obj_type tree gnu_actual_obj_type
...@@ -1403,9 +1401,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1403,9 +1401,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
unsigned int align; unsigned int align;
if (TREE_CODE (gnu_prefix) == COMPONENT_REF if (TREE_CODE (gnu_prefix) == COMPONENT_REF
&& (TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0))) && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0))))
== RECORD_TYPE)
&& (TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0)))))
gnu_prefix = TREE_OPERAND (gnu_prefix, 0); gnu_prefix = TREE_OPERAND (gnu_prefix, 0);
gnu_type = TREE_TYPE (gnu_prefix); gnu_type = TREE_TYPE (gnu_prefix);
...@@ -1742,9 +1738,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1742,9 +1738,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
case Attr_Component_Size: case Attr_Component_Size:
if (TREE_CODE (gnu_prefix) == COMPONENT_REF if (TREE_CODE (gnu_prefix) == COMPONENT_REF
&& (TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0))) && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0))))
== RECORD_TYPE)
&& (TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_prefix, 0)))))
gnu_prefix = TREE_OPERAND (gnu_prefix, 0); gnu_prefix = TREE_OPERAND (gnu_prefix, 0);
gnu_prefix = maybe_implicit_deref (gnu_prefix); gnu_prefix = maybe_implicit_deref (gnu_prefix);
...@@ -2562,10 +2556,8 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) ...@@ -2562,10 +2556,8 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
/* Otherwise remove unpadding from the object and reset the copy. */ /* Otherwise remove unpadding from the object and reset the copy. */
else if (TREE_CODE (gnu_name) == COMPONENT_REF else if (TREE_CODE (gnu_name) == COMPONENT_REF
&& ((TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_name, 0))) && TYPE_IS_PADDING_P
== RECORD_TYPE) (TREE_TYPE (TREE_OPERAND (gnu_name, 0))))
&& (TYPE_IS_PADDING_P
(TREE_TYPE (TREE_OPERAND (gnu_name, 0))))))
gnu_name = gnu_copy = TREE_OPERAND (gnu_name, 0); gnu_name = gnu_copy = TREE_OPERAND (gnu_name, 0);
/* Otherwise convert to the nominal type of the object if it's /* Otherwise convert to the nominal type of the object if it's
...@@ -2604,7 +2596,6 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) ...@@ -2604,7 +2596,6 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
/* If this was a procedure call, we may not have removed any padding. /* If this was a procedure call, we may not have removed any padding.
So do it here for the part we will use as an input, if any. */ So do it here for the part we will use as an input, if any. */
if (Ekind (gnat_formal) != E_Out_Parameter if (Ekind (gnat_formal) != E_Out_Parameter
&& TREE_CODE (TREE_TYPE (gnu_actual)) == RECORD_TYPE
&& TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual))) && TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual)))
gnu_actual = convert (get_unpadded_type (Etype (gnat_actual)), gnu_actual = convert (get_unpadded_type (Etype (gnat_actual)),
gnu_actual); gnu_actual);
...@@ -2674,8 +2665,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) ...@@ -2674,8 +2665,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
gnu_actual = gnu_name; gnu_actual = gnu_name;
/* If we have a padded type, be sure we've removed padding. */ /* If we have a padded type, be sure we've removed padding. */
if (TREE_CODE (TREE_TYPE (gnu_actual)) == RECORD_TYPE if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual))
&& TYPE_IS_PADDING_P (TREE_TYPE (gnu_actual))
&& TREE_CODE (gnu_actual) != SAVE_EXPR) && TREE_CODE (gnu_actual) != SAVE_EXPR)
gnu_actual = convert (get_unpadded_type (Etype (gnat_actual)), gnu_actual = convert (get_unpadded_type (Etype (gnat_actual)),
gnu_actual); gnu_actual);
...@@ -2708,8 +2698,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) ...@@ -2708,8 +2698,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
gnu_actual = maybe_implicit_deref (gnu_actual); gnu_actual = maybe_implicit_deref (gnu_actual);
gnu_actual = maybe_unconstrained_array (gnu_actual); gnu_actual = maybe_unconstrained_array (gnu_actual);
if (TREE_CODE (gnu_formal_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (gnu_formal_type))
&& TYPE_IS_PADDING_P (gnu_formal_type))
{ {
gnu_formal_type = TREE_TYPE (TYPE_FIELDS (gnu_formal_type)); gnu_formal_type = TREE_TYPE (TYPE_FIELDS (gnu_formal_type));
gnu_actual = convert (gnu_formal_type, gnu_actual); gnu_actual = convert (gnu_formal_type, gnu_actual);
...@@ -2901,8 +2890,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target) ...@@ -2901,8 +2890,7 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
= maybe_unconstrained_array (TREE_VALUE (gnu_name_list)); = maybe_unconstrained_array (TREE_VALUE (gnu_name_list));
/* If the result is a padded type, remove the padding. */ /* If the result is a padded type, remove the padding. */
if (TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_result)))
&& TYPE_IS_PADDING_P (TREE_TYPE (gnu_result)))
gnu_result = convert (TREE_TYPE (TYPE_FIELDS gnu_result = convert (TREE_TYPE (TYPE_FIELDS
(TREE_TYPE (gnu_result))), (TREE_TYPE (gnu_result))),
gnu_result); gnu_result);
...@@ -3861,8 +3849,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -3861,8 +3849,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_array_object = maybe_unconstrained_array (gnu_array_object); gnu_array_object = maybe_unconstrained_array (gnu_array_object);
/* If we got a padded type, remove it too. */ /* If we got a padded type, remove it too. */
if (TREE_CODE (TREE_TYPE (gnu_array_object)) == RECORD_TYPE if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_array_object)))
&& TYPE_IS_PADDING_P (TREE_TYPE (gnu_array_object)))
gnu_array_object gnu_array_object
= convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_array_object))), = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_array_object))),
gnu_array_object); gnu_array_object);
...@@ -4718,12 +4705,10 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -4718,12 +4705,10 @@ gnat_to_gnu (Node_Id gnat_node)
type is self-referential since we want to allocate the fixed type is self-referential since we want to allocate the fixed
size in that case. */ size in that case. */
if (TREE_CODE (gnu_ret_val) == COMPONENT_REF if (TREE_CODE (gnu_ret_val) == COMPONENT_REF
&& (TREE_CODE (TREE_TYPE (TREE_OPERAND (gnu_ret_val, 0))) && TYPE_IS_PADDING_P
== RECORD_TYPE) (TREE_TYPE (TREE_OPERAND (gnu_ret_val, 0)))
&& (TYPE_IS_PADDING_P && CONTAINS_PLACEHOLDER_P
(TREE_TYPE (TREE_OPERAND (gnu_ret_val, 0)))) (TYPE_SIZE (TREE_TYPE (gnu_ret_val))))
&& (CONTAINS_PLACEHOLDER_P
(TYPE_SIZE (TREE_TYPE (gnu_ret_val)))))
gnu_ret_val = TREE_OPERAND (gnu_ret_val, 0); gnu_ret_val = TREE_OPERAND (gnu_ret_val, 0);
if (TYPE_RETURNS_BY_REF_P (gnu_subprog_type) if (TYPE_RETURNS_BY_REF_P (gnu_subprog_type)
...@@ -5156,7 +5141,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5156,7 +5141,7 @@ gnat_to_gnu (Node_Id gnat_node)
a fat pointer, then go back below to a thin pointer. The a fat pointer, then go back below to a thin pointer. The
reason for this is that we need a fat pointer someplace in reason for this is that we need a fat pointer someplace in
order to properly compute the size. */ order to properly compute the size. */
if (TYPE_THIN_POINTER_P (TREE_TYPE (gnu_ptr))) if (TYPE_IS_THIN_POINTER_P (TREE_TYPE (gnu_ptr)))
gnu_ptr = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_ptr = build_unary_op (ADDR_EXPR, NULL_TREE,
build_unary_op (INDIRECT_REF, NULL_TREE, build_unary_op (INDIRECT_REF, NULL_TREE,
gnu_ptr)); gnu_ptr));
...@@ -5165,7 +5150,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5165,7 +5150,7 @@ gnat_to_gnu (Node_Id gnat_node)
have been allocated with the template in front of the object. have been allocated with the template in front of the object.
So pass the template address, but get the total size. Do this So pass the template address, but get the total size. Do this
by converting to a thin pointer. */ by converting to a thin pointer. */
if (TYPE_FAT_POINTER_P (TREE_TYPE (gnu_ptr))) if (TYPE_IS_FAT_POINTER_P (TREE_TYPE (gnu_ptr)))
gnu_ptr gnu_ptr
= convert (build_pointer_type = convert (build_pointer_type
(TYPE_OBJECT_RECORD_TYPE (TYPE_OBJECT_RECORD_TYPE
...@@ -5179,7 +5164,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5179,7 +5164,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_actual_obj_type gnu_actual_obj_type
= gnat_to_gnu_type (Actual_Designated_Subtype (gnat_node)); = gnat_to_gnu_type (Actual_Designated_Subtype (gnat_node));
if (TYPE_FAT_OR_THIN_POINTER_P (gnu_ptr_type)) if (TYPE_IS_FAT_OR_THIN_POINTER_P (gnu_ptr_type))
gnu_actual_obj_type gnu_actual_obj_type
= build_unc_object_type_from_ptr (gnu_ptr_type, = build_unc_object_type_from_ptr (gnu_ptr_type,
gnu_actual_obj_type, gnu_actual_obj_type,
...@@ -5291,10 +5276,10 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5291,10 +5276,10 @@ gnat_to_gnu (Node_Id gnat_node)
/* But if the result is a fat pointer type, we have no mechanism to /* But if the result is a fat pointer type, we have no mechanism to
do that, so we unconditionally warn in problematic cases. */ do that, so we unconditionally warn in problematic cases. */
else if (TYPE_FAT_POINTER_P (gnu_target_type)) else if (TYPE_IS_FAT_POINTER_P (gnu_target_type))
{ {
tree gnu_source_array_type tree gnu_source_array_type
= TYPE_FAT_POINTER_P (gnu_source_type) = TYPE_IS_FAT_POINTER_P (gnu_source_type)
? TREE_TYPE (TREE_TYPE (TYPE_FIELDS (gnu_source_type))) ? TREE_TYPE (TREE_TYPE (TYPE_FIELDS (gnu_source_type)))
: NULL_TREE; : NULL_TREE;
tree gnu_target_array_type tree gnu_target_array_type
...@@ -5302,7 +5287,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5302,7 +5287,7 @@ gnat_to_gnu (Node_Id gnat_node)
if ((TYPE_DUMMY_P (gnu_target_array_type) if ((TYPE_DUMMY_P (gnu_target_array_type)
|| get_alias_set (gnu_target_array_type) != 0) || get_alias_set (gnu_target_array_type) != 0)
&& (!TYPE_FAT_POINTER_P (gnu_source_type) && (!TYPE_IS_FAT_POINTER_P (gnu_source_type)
|| (TYPE_DUMMY_P (gnu_source_array_type) || (TYPE_DUMMY_P (gnu_source_array_type)
!= TYPE_DUMMY_P (gnu_target_array_type)) != TYPE_DUMMY_P (gnu_target_array_type))
|| (TYPE_DUMMY_P (gnu_source_array_type) || (TYPE_DUMMY_P (gnu_source_array_type)
...@@ -5443,8 +5428,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5443,8 +5428,7 @@ gnat_to_gnu (Node_Id gnat_node)
size: in that case it must be an object of unconstrained type size: in that case it must be an object of unconstrained type
with a default discriminant and we want to avoid copying too with a default discriminant and we want to avoid copying too
much data. */ much data. */
if (TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_result))
&& TYPE_IS_PADDING_P (TREE_TYPE (gnu_result))
&& CONTAINS_PLACEHOLDER_P (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS && CONTAINS_PLACEHOLDER_P (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS
(TREE_TYPE (gnu_result)))))) (TREE_TYPE (gnu_result))))))
gnu_result = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_result))), gnu_result = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_result))),
...@@ -5464,8 +5448,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -5464,8 +5448,7 @@ gnat_to_gnu (Node_Id gnat_node)
&& TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE)) && TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE))
{ {
/* Remove any padding. */ /* Remove any padding. */
if (TREE_CODE (TREE_TYPE (gnu_result)) == RECORD_TYPE if (TYPE_IS_PADDING_P (TREE_TYPE (gnu_result)))
&& TYPE_IS_PADDING_P (TREE_TYPE (gnu_result)))
gnu_result = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_result))), gnu_result = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_result))),
gnu_result); gnu_result);
} }
...@@ -5607,7 +5590,7 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity) ...@@ -5607,7 +5590,7 @@ add_decl_expr (tree gnu_decl, Entity_Id gnat_entity)
{ {
/* If GNU_DECL has a padded type, convert it to the unpadded /* If GNU_DECL has a padded type, convert it to the unpadded
type so the assignment is done properly. */ type so the assignment is done properly. */
if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type)) if (TYPE_IS_PADDING_P (type))
t = convert (TREE_TYPE (TYPE_FIELDS (type)), gnu_decl); t = convert (TREE_TYPE (TYPE_FIELDS (type)), gnu_decl);
else else
t = gnu_decl; t = gnu_decl;
...@@ -6791,8 +6774,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, ...@@ -6791,8 +6774,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp,
= FP_ARITH_MAY_WIDEN ? longest_float_type_node : gnu_in_basetype; = FP_ARITH_MAY_WIDEN ? longest_float_type_node : gnu_in_basetype;
/* FIXME: Should not have padding in the first place. */ /* FIXME: Should not have padding in the first place. */
if (TREE_CODE (calc_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (calc_type))
&& TYPE_IS_PADDING_P (calc_type))
calc_type = TREE_TYPE (TYPE_FIELDS (calc_type)); calc_type = TREE_TYPE (TYPE_FIELDS (calc_type));
/* Compute the exact value calc_type'Pred (0.5) at compile time. */ /* Compute the exact value calc_type'Pred (0.5) at compile time. */
...@@ -6989,7 +6971,7 @@ addressable_p (tree gnu_expr, tree gnu_type) ...@@ -6989,7 +6971,7 @@ addressable_p (tree gnu_expr, tree gnu_type)
|| DECL_ALIGN (TREE_OPERAND (gnu_expr, 1)) || DECL_ALIGN (TREE_OPERAND (gnu_expr, 1))
>= TYPE_ALIGN (TREE_TYPE (gnu_expr)))) >= TYPE_ALIGN (TREE_TYPE (gnu_expr))))
/* The field of a padding record is always addressable. */ /* The field of a padding record is always addressable. */
|| TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))) || TYPE_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))
&& addressable_p (TREE_OPERAND (gnu_expr, 0), NULL_TREE)); && addressable_p (TREE_OPERAND (gnu_expr, 0), NULL_TREE));
case ARRAY_REF: case ARRAY_RANGE_REF: case ARRAY_REF: case ARRAY_RANGE_REF:
...@@ -7269,13 +7251,12 @@ static tree ...@@ -7269,13 +7251,12 @@ static tree
maybe_implicit_deref (tree exp) maybe_implicit_deref (tree exp)
{ {
/* If the type is a pointer, dereference it. */ /* If the type is a pointer, dereference it. */
if (POINTER_TYPE_P (TREE_TYPE (exp))
if (POINTER_TYPE_P (TREE_TYPE (exp)) || TYPE_FAT_POINTER_P (TREE_TYPE (exp))) || TYPE_IS_FAT_POINTER_P (TREE_TYPE (exp)))
exp = build_unary_op (INDIRECT_REF, NULL_TREE, exp); exp = build_unary_op (INDIRECT_REF, NULL_TREE, exp);
/* If we got a padded type, remove it too. */ /* If we got a padded type, remove it too. */
if (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE if (TYPE_IS_PADDING_P (TREE_TYPE (exp)))
&& TYPE_IS_PADDING_P (TREE_TYPE (exp)))
exp = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp); exp = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
return exp; return exp;
...@@ -7313,7 +7294,7 @@ protect_multiple_eval (tree exp) ...@@ -7313,7 +7294,7 @@ protect_multiple_eval (tree exp)
/* If this is a fat pointer or something that can be placed into a /* If this is a fat pointer or something that can be placed into a
register, just make a SAVE_EXPR. */ register, just make a SAVE_EXPR. */
if (TYPE_FAT_POINTER_P (type) || TYPE_MODE (type) != BLKmode) if (TYPE_IS_FAT_POINTER_P (type) || TYPE_MODE (type) != BLKmode)
return save_expr (exp); return save_expr (exp);
/* Otherwise, reference, protect the address and dereference. */ /* Otherwise, reference, protect the address and dereference. */
...@@ -7498,7 +7479,7 @@ gnat_stabilize_reference_1 (tree e, bool force) ...@@ -7498,7 +7479,7 @@ gnat_stabilize_reference_1 (tree e, bool force)
fat pointer. This may be more efficient, but will also allow fat pointer. This may be more efficient, but will also allow
us to more easily find the match for the PLACEHOLDER_EXPR. */ us to more easily find the match for the PLACEHOLDER_EXPR. */
if (code == COMPONENT_REF if (code == COMPONENT_REF
&& TYPE_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (e, 0)))) && TYPE_IS_FAT_POINTER_P (TREE_TYPE (TREE_OPERAND (e, 0))))
result = build3 (COMPONENT_REF, type, result = build3 (COMPONENT_REF, type,
gnat_stabilize_reference_1 (TREE_OPERAND (e, 0), gnat_stabilize_reference_1 (TREE_OPERAND (e, 0),
force), force),
......
...@@ -490,7 +490,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) ...@@ -490,7 +490,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
if (!(TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL)) if (!(TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL))
; ;
else if (TYPE_FAT_POINTER_P (t)) else if (TYPE_IS_FAT_POINTER_P (t))
{ {
tree tt = build_variant_type_copy (t); tree tt = build_variant_type_copy (t);
TYPE_NAME (tt) = decl; TYPE_NAME (tt) = decl;
...@@ -643,7 +643,7 @@ finish_record_type (tree record_type, tree fieldlist, int rep_level, ...@@ -643,7 +643,7 @@ finish_record_type (tree record_type, tree fieldlist, int rep_level,
if ((TREE_CODE (type) == RECORD_TYPE if ((TREE_CODE (type) == RECORD_TYPE
|| TREE_CODE (type) == UNION_TYPE || TREE_CODE (type) == UNION_TYPE
|| TREE_CODE (type) == QUAL_UNION_TYPE) || TREE_CODE (type) == QUAL_UNION_TYPE)
&& !TYPE_IS_FAT_POINTER_P (type) && !TYPE_FAT_POINTER_P (type)
&& !TYPE_CONTAINS_TEMPLATE_P (type) && !TYPE_CONTAINS_TEMPLATE_P (type)
&& TYPE_ADA_SIZE (type)) && TYPE_ADA_SIZE (type))
this_ada_size = TYPE_ADA_SIZE (type); this_ada_size = TYPE_ADA_SIZE (type);
...@@ -743,12 +743,11 @@ finish_record_type (tree record_type, tree fieldlist, int rep_level, ...@@ -743,12 +743,11 @@ finish_record_type (tree record_type, tree fieldlist, int rep_level,
{ {
/* If this is a padding record, we never want to make the size smaller /* If this is a padding record, we never want to make the size smaller
than what was specified in it, if any. */ than what was specified in it, if any. */
if (TREE_CODE (record_type) == RECORD_TYPE if (TYPE_IS_PADDING_P (record_type) && TYPE_SIZE (record_type))
&& TYPE_IS_PADDING_P (record_type) && TYPE_SIZE (record_type))
size = TYPE_SIZE (record_type); size = TYPE_SIZE (record_type);
/* Now set any of the values we've just computed that apply. */ /* Now set any of the values we've just computed that apply. */
if (!TYPE_IS_FAT_POINTER_P (record_type) if (!TYPE_FAT_POINTER_P (record_type)
&& !TYPE_CONTAINS_TEMPLATE_P (record_type)) && !TYPE_CONTAINS_TEMPLATE_P (record_type))
SET_TYPE_ADA_SIZE (record_type, ada_size); SET_TYPE_ADA_SIZE (record_type, ada_size);
...@@ -810,9 +809,7 @@ rest_of_record_type_compilation (tree record_type) ...@@ -810,9 +809,7 @@ rest_of_record_type_compilation (tree record_type)
that tells the debugger how the record is laid out. See that tells the debugger how the record is laid out. See
exp_dbug.ads. But don't do this for records that are padding exp_dbug.ads. But don't do this for records that are padding
since they confuse GDB. */ since they confuse GDB. */
if (var_size if (var_size && !TYPE_IS_PADDING_P (record_type))
&& !(TREE_CODE (record_type) == RECORD_TYPE
&& TYPE_IS_PADDING_P (record_type)))
{ {
tree new_record_type tree new_record_type
= make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE = make_node (TREE_CODE (record_type) == QUAL_UNION_TYPE
...@@ -1301,7 +1298,7 @@ create_type_decl (tree type_name, tree type, struct attrib *attr_list, ...@@ -1301,7 +1298,7 @@ create_type_decl (tree type_name, tree type, struct attrib *attr_list,
if (code == UNCONSTRAINED_ARRAY_TYPE || !debug_info_p) if (code == UNCONSTRAINED_ARRAY_TYPE || !debug_info_p)
DECL_IGNORED_P (type_decl) = 1; DECL_IGNORED_P (type_decl) = 1;
else if (code != ENUMERAL_TYPE else if (code != ENUMERAL_TYPE
&& (code != RECORD_TYPE || TYPE_IS_FAT_POINTER_P (type)) && (code != RECORD_TYPE || TYPE_FAT_POINTER_P (type))
&& !((code == POINTER_TYPE || code == REFERENCE_TYPE) && !((code == POINTER_TYPE || code == REFERENCE_TYPE)
&& TYPE_IS_DUMMY_P (TREE_TYPE (type))) && TYPE_IS_DUMMY_P (TREE_TYPE (type)))
&& !(code == RECORD_TYPE && !(code == RECORD_TYPE
...@@ -2286,7 +2283,7 @@ gnat_types_compatible_p (tree t1, tree t2) ...@@ -2286,7 +2283,7 @@ gnat_types_compatible_p (tree t1, tree t2)
/* Padding record types are also compatible if they pad the same /* Padding record types are also compatible if they pad the same
type and have the same constant size. */ type and have the same constant size. */
if (code == RECORD_TYPE if (code == RECORD_TYPE
&& TYPE_IS_PADDING_P (t1) && TYPE_IS_PADDING_P (t2) && TYPE_PADDING_P (t1) && TYPE_PADDING_P (t2)
&& TREE_TYPE (TYPE_FIELDS (t1)) == TREE_TYPE (TYPE_FIELDS (t2)) && TREE_TYPE (TYPE_FIELDS (t1)) == TREE_TYPE (TYPE_FIELDS (t2))
&& tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2))) && tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)))
return 1; return 1;
...@@ -2436,7 +2433,7 @@ build_template (tree template_type, tree array_type, tree expr) ...@@ -2436,7 +2433,7 @@ build_template (tree template_type, tree array_type, tree expr)
tree field; tree field;
while (TREE_CODE (array_type) == RECORD_TYPE while (TREE_CODE (array_type) == RECORD_TYPE
&& (TYPE_IS_PADDING_P (array_type) && (TYPE_PADDING_P (array_type)
|| TYPE_JUSTIFIED_MODULAR_P (array_type))) || TYPE_JUSTIFIED_MODULAR_P (array_type)))
array_type = TREE_TYPE (TYPE_FIELDS (array_type)); array_type = TREE_TYPE (TYPE_FIELDS (array_type));
...@@ -3150,7 +3147,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3150,7 +3147,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
if (POINTER_TYPE_P (gnu_type)) if (POINTER_TYPE_P (gnu_type))
return convert (gnu_type, gnu_expr64); return convert (gnu_type, gnu_expr64);
else if (TYPE_FAT_POINTER_P (gnu_type)) else if (TYPE_IS_FAT_POINTER_P (gnu_type))
{ {
tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type)); tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type))); tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)));
...@@ -3299,7 +3296,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3299,7 +3296,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
if (POINTER_TYPE_P (gnu_type)) if (POINTER_TYPE_P (gnu_type))
return convert (gnu_type, gnu_expr32); return convert (gnu_type, gnu_expr32);
else if (TYPE_FAT_POINTER_P (gnu_type)) else if (TYPE_IS_FAT_POINTER_P (gnu_type))
{ {
tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type)); tree p_array_type = TREE_TYPE (TYPE_FIELDS (gnu_type));
tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type))); tree p_bounds_type = TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (gnu_type)));
...@@ -3537,10 +3534,10 @@ build_unc_object_type_from_ptr (tree thin_fat_ptr_type, tree object_type, ...@@ -3537,10 +3534,10 @@ build_unc_object_type_from_ptr (tree thin_fat_ptr_type, tree object_type,
{ {
tree template_type; tree template_type;
gcc_assert (TYPE_FAT_OR_THIN_POINTER_P (thin_fat_ptr_type)); gcc_assert (TYPE_IS_FAT_OR_THIN_POINTER_P (thin_fat_ptr_type));
template_type template_type
= (TYPE_FAT_POINTER_P (thin_fat_ptr_type) = (TYPE_IS_FAT_POINTER_P (thin_fat_ptr_type)
? TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (thin_fat_ptr_type)))) ? TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (thin_fat_ptr_type))))
: TREE_TYPE (TYPE_FIELDS (TREE_TYPE (thin_fat_ptr_type)))); : TREE_TYPE (TYPE_FIELDS (TREE_TYPE (thin_fat_ptr_type))));
return build_unc_object_type (template_type, object_type, name); return build_unc_object_type (template_type, object_type, name);
...@@ -3636,7 +3633,7 @@ update_pointer_to (tree old_type, tree new_type) ...@@ -3636,7 +3633,7 @@ update_pointer_to (tree old_type, tree new_type)
/* Now deal with the unconstrained array case. In this case the "pointer" /* Now deal with the unconstrained array case. In this case the "pointer"
is actually a RECORD_TYPE where both fields are pointers to dummy nodes. is actually a RECORD_TYPE where both fields are pointers to dummy nodes.
Turn them into pointers to the correct types using update_pointer_to. */ Turn them into pointers to the correct types using update_pointer_to. */
else if (!TYPE_FAT_POINTER_P (ptr)) else if (!TYPE_IS_FAT_POINTER_P (ptr))
gcc_unreachable (); gcc_unreachable ();
else else
...@@ -3737,7 +3734,7 @@ convert_to_fat_pointer (tree type, tree expr) ...@@ -3737,7 +3734,7 @@ convert_to_fat_pointer (tree type, tree expr)
NULL_TREE))); NULL_TREE)));
/* If EXPR is a thin pointer, make template and data from the record.. */ /* If EXPR is a thin pointer, make template and data from the record.. */
else if (TYPE_THIN_POINTER_P (etype)) else if (TYPE_IS_THIN_POINTER_P (etype))
{ {
tree fields = TYPE_FIELDS (TREE_TYPE (etype)); tree fields = TYPE_FIELDS (TREE_TYPE (etype));
...@@ -3787,7 +3784,7 @@ convert_to_fat_pointer (tree type, tree expr) ...@@ -3787,7 +3784,7 @@ convert_to_fat_pointer (tree type, tree expr)
static tree static tree
convert_to_thin_pointer (tree type, tree expr) convert_to_thin_pointer (tree type, tree expr)
{ {
if (!TYPE_FAT_POINTER_P (TREE_TYPE (expr))) if (!TYPE_IS_FAT_POINTER_P (TREE_TYPE (expr)))
expr expr
= convert_to_fat_pointer = convert_to_fat_pointer
(TREE_TYPE (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))), expr); (TREE_TYPE (TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))), expr);
...@@ -3822,7 +3819,7 @@ convert (tree type, tree expr) ...@@ -3822,7 +3819,7 @@ convert (tree type, tree expr)
as an unchecked conversion. Likewise if one is a mere variant of the as an unchecked conversion. Likewise if one is a mere variant of the
other, so we avoid a pointless unpad/repad sequence. */ other, so we avoid a pointless unpad/repad sequence. */
else if (code == RECORD_TYPE && ecode == RECORD_TYPE else if (code == RECORD_TYPE && ecode == RECORD_TYPE
&& TYPE_IS_PADDING_P (type) && TYPE_IS_PADDING_P (etype) && TYPE_PADDING_P (type) && TYPE_PADDING_P (etype)
&& (!TREE_CONSTANT (TYPE_SIZE (type)) && (!TREE_CONSTANT (TYPE_SIZE (type))
|| !TREE_CONSTANT (TYPE_SIZE (etype)) || !TREE_CONSTANT (TYPE_SIZE (etype))
|| gnat_types_compatible_p (type, etype) || gnat_types_compatible_p (type, etype)
...@@ -3832,7 +3829,7 @@ convert (tree type, tree expr) ...@@ -3832,7 +3829,7 @@ convert (tree type, tree expr)
/* If the output type has padding, convert to the inner type and make a /* If the output type has padding, convert to the inner type and make a
constructor to build the record, unless a variable size is involved. */ constructor to build the record, unless a variable size is involved. */
else if (code == RECORD_TYPE && TYPE_IS_PADDING_P (type)) else if (code == RECORD_TYPE && TYPE_PADDING_P (type))
{ {
/* If we previously converted from another type and our type is /* If we previously converted from another type and our type is
of variable size, remove the conversion to avoid the need for of variable size, remove the conversion to avoid the need for
...@@ -3850,7 +3847,6 @@ convert (tree type, tree expr) ...@@ -3850,7 +3847,6 @@ convert (tree type, tree expr)
variable-sized temporaries. Likewise if the padding is a variant variable-sized temporaries. Likewise if the padding is a variant
of the other, so we avoid a pointless unpad/repad sequence. */ of the other, so we avoid a pointless unpad/repad sequence. */
if (TREE_CODE (expr) == COMPONENT_REF if (TREE_CODE (expr) == COMPONENT_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) == RECORD_TYPE
&& TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (expr, 0))) && TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (expr, 0)))
&& (!TREE_CONSTANT (TYPE_SIZE (type)) && (!TREE_CONSTANT (TYPE_SIZE (type))
|| gnat_types_compatible_p (type, || gnat_types_compatible_p (type,
...@@ -3893,7 +3889,7 @@ convert (tree type, tree expr) ...@@ -3893,7 +3889,7 @@ convert (tree type, tree expr)
The conditions ordering is arranged to ensure that the output type is not The conditions ordering is arranged to ensure that the output type is not
a padding type here, as it is not clear whether the conversion would a padding type here, as it is not clear whether the conversion would
always be correct if this was to happen. */ always be correct if this was to happen. */
else if (ecode == RECORD_TYPE && TYPE_IS_PADDING_P (etype)) else if (ecode == RECORD_TYPE && TYPE_PADDING_P (etype))
{ {
tree unpadded; tree unpadded;
...@@ -4142,7 +4138,8 @@ convert (tree type, tree expr) ...@@ -4142,7 +4138,8 @@ convert (tree type, tree expr)
/* Otherwise, we may just bypass the input view conversion unless /* Otherwise, we may just bypass the input view conversion unless
one of the types is a fat pointer, which is handled by one of the types is a fat pointer, which is handled by
specialized code below which relies on exact type matching. */ specialized code below which relies on exact type matching. */
else if (!TYPE_FAT_POINTER_P (type) && !TYPE_FAT_POINTER_P (etype)) else if (!TYPE_IS_FAT_POINTER_P (type)
&& !TYPE_IS_FAT_POINTER_P (etype))
return convert (type, op0); return convert (type, op0);
} }
} }
...@@ -4161,7 +4158,7 @@ convert (tree type, tree expr) ...@@ -4161,7 +4158,7 @@ convert (tree type, tree expr)
|| TREE_CODE (type) == UNION_TYPE) || TREE_CODE (type) == UNION_TYPE)
&& (TREE_CODE (etype) == RECORD_TYPE && (TREE_CODE (etype) == RECORD_TYPE
|| TREE_CODE (etype) == UNION_TYPE) || TREE_CODE (etype) == UNION_TYPE)
&& !TYPE_FAT_POINTER_P (type) && !TYPE_FAT_POINTER_P (etype)) && !TYPE_IS_FAT_POINTER_P (type) && !TYPE_IS_FAT_POINTER_P (etype))
return build_unary_op (INDIRECT_REF, NULL_TREE, return build_unary_op (INDIRECT_REF, NULL_TREE,
convert (build_pointer_type (type), convert (build_pointer_type (type),
TREE_OPERAND (expr, 0))); TREE_OPERAND (expr, 0)));
...@@ -4172,7 +4169,7 @@ convert (tree type, tree expr) ...@@ -4172,7 +4169,7 @@ convert (tree type, tree expr)
} }
/* Check for converting to a pointer to an unconstrained array. */ /* Check for converting to a pointer to an unconstrained array. */
if (TYPE_FAT_POINTER_P (type) && !TYPE_FAT_POINTER_P (etype)) if (TYPE_IS_FAT_POINTER_P (type) && !TYPE_IS_FAT_POINTER_P (etype))
return convert_to_fat_pointer (type, expr); return convert_to_fat_pointer (type, expr);
/* If we are converting between two aggregate or vector types that are mere /* If we are converting between two aggregate or vector types that are mere
...@@ -4244,7 +4241,7 @@ convert (tree type, tree expr) ...@@ -4244,7 +4241,7 @@ convert (tree type, tree expr)
/* If converting between two pointers to records denoting /* If converting between two pointers to records denoting
both a template and type, adjust if needed to account both a template and type, adjust if needed to account
for any differing offsets, since one might be negative. */ for any differing offsets, since one might be negative. */
if (TYPE_THIN_POINTER_P (etype) && TYPE_THIN_POINTER_P (type)) if (TYPE_IS_THIN_POINTER_P (etype) && TYPE_IS_THIN_POINTER_P (type))
{ {
tree bit_diff tree bit_diff
= size_diffop (bit_position (TYPE_FIELDS (TREE_TYPE (etype))), = size_diffop (bit_position (TYPE_FIELDS (TREE_TYPE (etype))),
...@@ -4262,13 +4259,13 @@ convert (tree type, tree expr) ...@@ -4262,13 +4259,13 @@ convert (tree type, tree expr)
} }
/* If converting to a thin pointer, handle specially. */ /* If converting to a thin pointer, handle specially. */
if (TYPE_THIN_POINTER_P (type) if (TYPE_IS_THIN_POINTER_P (type)
&& TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))) && TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type)))
return convert_to_thin_pointer (type, expr); return convert_to_thin_pointer (type, expr);
/* If converting fat pointer to normal pointer, get the pointer to the /* If converting fat pointer to normal pointer, get the pointer to the
array and then convert it. */ array and then convert it. */
else if (TYPE_FAT_POINTER_P (etype)) else if (TYPE_IS_FAT_POINTER_P (etype))
expr = build_component_ref (expr, get_identifier ("P_ARRAY"), expr = build_component_ref (expr, get_identifier ("P_ARRAY"),
NULL_TREE, false); NULL_TREE, false);
...@@ -4365,8 +4362,7 @@ remove_conversions (tree exp, bool true_address) ...@@ -4365,8 +4362,7 @@ remove_conversions (tree exp, bool true_address)
break; break;
case COMPONENT_REF: case COMPONENT_REF:
if (TREE_CODE (TREE_TYPE (TREE_OPERAND (exp, 0))) == RECORD_TYPE if (TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
&& TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
return remove_conversions (TREE_OPERAND (exp, 0), true_address); return remove_conversions (TREE_OPERAND (exp, 0), true_address);
break; break;
...@@ -4415,7 +4411,7 @@ maybe_unconstrained_array (tree exp) ...@@ -4415,7 +4411,7 @@ maybe_unconstrained_array (tree exp)
case RECORD_TYPE: case RECORD_TYPE:
/* If this is a padded type, convert to the unpadded type and see if /* If this is a padded type, convert to the unpadded type and see if
it contains a template. */ it contains a template. */
if (TYPE_IS_PADDING_P (TREE_TYPE (exp))) if (TYPE_PADDING_P (TREE_TYPE (exp)))
{ {
new_exp = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp); new_exp = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (exp))), exp);
if (TREE_CODE (TREE_TYPE (new_exp)) == RECORD_TYPE if (TREE_CODE (TREE_TYPE (new_exp)) == RECORD_TYPE
...@@ -4518,13 +4514,13 @@ unchecked_convert (tree type, tree expr, bool notrunc_p) ...@@ -4518,13 +4514,13 @@ unchecked_convert (tree type, tree expr, bool notrunc_p)
if ((((INTEGRAL_TYPE_P (type) if ((((INTEGRAL_TYPE_P (type)
&& !(TREE_CODE (type) == INTEGER_TYPE && !(TREE_CODE (type) == INTEGER_TYPE
&& TYPE_VAX_FLOATING_POINT_P (type))) && TYPE_VAX_FLOATING_POINT_P (type)))
|| (POINTER_TYPE_P (type) && ! TYPE_THIN_POINTER_P (type)) || (POINTER_TYPE_P (type) && ! TYPE_IS_THIN_POINTER_P (type))
|| (TREE_CODE (type) == RECORD_TYPE || (TREE_CODE (type) == RECORD_TYPE
&& TYPE_JUSTIFIED_MODULAR_P (type))) && TYPE_JUSTIFIED_MODULAR_P (type)))
&& ((INTEGRAL_TYPE_P (etype) && ((INTEGRAL_TYPE_P (etype)
&& !(TREE_CODE (etype) == INTEGER_TYPE && !(TREE_CODE (etype) == INTEGER_TYPE
&& TYPE_VAX_FLOATING_POINT_P (etype))) && TYPE_VAX_FLOATING_POINT_P (etype)))
|| (POINTER_TYPE_P (etype) && !TYPE_THIN_POINTER_P (etype)) || (POINTER_TYPE_P (etype) && !TYPE_IS_THIN_POINTER_P (etype))
|| (TREE_CODE (etype) == RECORD_TYPE || (TREE_CODE (etype) == RECORD_TYPE
&& TYPE_JUSTIFIED_MODULAR_P (etype)))) && TYPE_JUSTIFIED_MODULAR_P (etype))))
|| TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE) || TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
...@@ -5504,7 +5500,7 @@ handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -5504,7 +5500,7 @@ handle_vector_type_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* Get the representative array type, possibly nested within a /* Get the representative array type, possibly nested within a
padding record e.g. for alignment purposes. */ padding record e.g. for alignment purposes. */
if (TREE_CODE (rep_type) == RECORD_TYPE && TYPE_IS_PADDING_P (rep_type)) if (TYPE_IS_PADDING_P (rep_type))
rep_type = TREE_TYPE (TYPE_FIELDS (rep_type)); rep_type = TREE_TYPE (TYPE_FIELDS (rep_type));
if (TREE_CODE (rep_type) != ARRAY_TYPE) if (TREE_CODE (rep_type) != ARRAY_TYPE)
......
...@@ -654,12 +654,9 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -654,12 +654,9 @@ build_binary_op (enum tree_code op_code, tree result_type,
can convert the constructor to the inner type, to avoid putting a can convert the constructor to the inner type, to avoid putting a
VIEW_CONVERT_EXPR on the LHS. But don't do so if we wouldn't have VIEW_CONVERT_EXPR on the LHS. But don't do so if we wouldn't have
actually copied anything. */ actually copied anything. */
else if (TREE_CODE (left_type) == RECORD_TYPE else if (TYPE_IS_PADDING_P (left_type)
&& TYPE_IS_PADDING_P (left_type)
&& TREE_CONSTANT (TYPE_SIZE (left_type)) && TREE_CONSTANT (TYPE_SIZE (left_type))
&& ((TREE_CODE (right_operand) == COMPONENT_REF && ((TREE_CODE (right_operand) == COMPONENT_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
== RECORD_TYPE
&& TYPE_IS_PADDING_P && TYPE_IS_PADDING_P
(TREE_TYPE (TREE_OPERAND (right_operand, 0))) (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
&& gnat_types_compatible_p && gnat_types_compatible_p
...@@ -836,8 +833,8 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -836,8 +833,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
convert both operands to that type. */ convert both operands to that type. */
if (left_base_type != right_base_type) if (left_base_type != right_base_type)
{ {
if (TYPE_FAT_POINTER_P (left_base_type) if (TYPE_IS_FAT_POINTER_P (left_base_type)
&& TYPE_FAT_POINTER_P (right_base_type) && TYPE_IS_FAT_POINTER_P (right_base_type)
&& TYPE_MAIN_VARIANT (left_base_type) && TYPE_MAIN_VARIANT (left_base_type)
== TYPE_MAIN_VARIANT (right_base_type)) == TYPE_MAIN_VARIANT (right_base_type))
best_type = left_base_type; best_type = left_base_type;
...@@ -872,7 +869,7 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -872,7 +869,7 @@ build_binary_op (enum tree_code op_code, tree result_type,
/* If we are comparing a fat pointer against zero, we need to /* If we are comparing a fat pointer against zero, we need to
just compare the data pointer. */ just compare the data pointer. */
else if (TYPE_FAT_POINTER_P (left_base_type) else if (TYPE_IS_FAT_POINTER_P (left_base_type)
&& TREE_CODE (right_operand) == CONSTRUCTOR && TREE_CODE (right_operand) == CONSTRUCTOR
&& integer_zerop (VEC_index (constructor_elt, && integer_zerop (VEC_index (constructor_elt,
CONSTRUCTOR_ELTS (right_operand), CONSTRUCTOR_ELTS (right_operand),
...@@ -1117,11 +1114,10 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1117,11 +1114,10 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
/* If INNER is a padding type whose field has a self-referential /* If INNER is a padding type whose field has a self-referential
size, convert to that inner type. We know the offset is zero size, convert to that inner type. We know the offset is zero
and we need to have that type visible. */ and we need to have that type visible. */
if (TREE_CODE (TREE_TYPE (inner)) == RECORD_TYPE if (TYPE_IS_PADDING_P (TREE_TYPE (inner))
&& TYPE_IS_PADDING_P (TREE_TYPE (inner)) && CONTAINS_PLACEHOLDER_P
&& (CONTAINS_PLACEHOLDER_P (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS
(TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (inner))))))
(TREE_TYPE (inner)))))))
inner = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (inner))), inner = convert (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (inner))),
inner); inner);
...@@ -1154,13 +1150,11 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1154,13 +1150,11 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
/* If this is just a constructor for a padded record, we can /* If this is just a constructor for a padded record, we can
just take the address of the single field and convert it to just take the address of the single field and convert it to
a pointer to our type. */ a pointer to our type. */
if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type)) if (TYPE_IS_PADDING_P (type))
{ {
result = (VEC_index (constructor_elt, result = VEC_index (constructor_elt,
CONSTRUCTOR_ELTS (operand), CONSTRUCTOR_ELTS (operand),
0) 0)->value;
->value);
result = convert (build_pointer_type (TREE_TYPE (operand)), result = convert (build_pointer_type (TREE_TYPE (operand)),
build_unary_op (ADDR_EXPR, NULL_TREE, result)); build_unary_op (ADDR_EXPR, NULL_TREE, result));
break; break;
...@@ -1202,8 +1196,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1202,8 +1196,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
/* If we are taking the address of a padded record whose field is /* If we are taking the address of a padded record whose field is
contains a template, take the address of the template. */ contains a template, take the address of the template. */
if (TREE_CODE (type) == RECORD_TYPE if (TYPE_IS_PADDING_P (type)
&& TYPE_IS_PADDING_P (type)
&& TREE_CODE (TREE_TYPE (TYPE_FIELDS (type))) == RECORD_TYPE && TREE_CODE (TREE_TYPE (TYPE_FIELDS (type))) == RECORD_TYPE
&& TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (TYPE_FIELDS (type)))) && TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (TYPE_FIELDS (type))))
{ {
...@@ -1226,7 +1219,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1226,7 +1219,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
make up an expression to do so. This will never survive to make up an expression to do so. This will never survive to
the backend. If TYPE is a thin pointer, first convert the the backend. If TYPE is a thin pointer, first convert the
operand to a fat pointer. */ operand to a fat pointer. */
if (TYPE_THIN_POINTER_P (type) if (TYPE_IS_THIN_POINTER_P (type)
&& TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type))) && TYPE_UNCONSTRAINED_ARRAY (TREE_TYPE (type)))
{ {
operand operand
...@@ -1235,7 +1228,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1235,7 +1228,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
type = TREE_TYPE (operand); type = TREE_TYPE (operand);
} }
if (TYPE_FAT_POINTER_P (type)) if (TYPE_IS_FAT_POINTER_P (type))
{ {
result = build1 (UNCONSTRAINED_ARRAY_REF, result = build1 (UNCONSTRAINED_ARRAY_REF,
TYPE_UNCONSTRAINED_ARRAY (type), operand); TYPE_UNCONSTRAINED_ARRAY (type), operand);
...@@ -1252,7 +1245,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1252,7 +1245,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
} }
side_effects side_effects
= (!TYPE_FAT_POINTER_P (type) && TYPE_VOLATILE (TREE_TYPE (type))); = (!TYPE_IS_FAT_POINTER_P (type) && TYPE_VOLATILE (TREE_TYPE (type)));
break; break;
case NEGATE_EXPR: case NEGATE_EXPR:
...@@ -2027,7 +2020,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, ...@@ -2027,7 +2020,7 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
/* If RESULT_TYPE is a fat or thin pointer, set SIZE to be the sum of the /* If RESULT_TYPE is a fat or thin pointer, set SIZE to be the sum of the
sizes of the object and its template. Allocate the whole thing and sizes of the object and its template. Allocate the whole thing and
fill in the parts that are known. */ fill in the parts that are known. */
else if (TYPE_FAT_OR_THIN_POINTER_P (result_type)) else if (TYPE_IS_FAT_OR_THIN_POINTER_P (result_type))
{ {
tree storage_type tree storage_type
= build_unc_object_type_from_ptr (result_type, type, = build_unc_object_type_from_ptr (result_type, type,
...@@ -2049,10 +2042,9 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, ...@@ -2049,10 +2042,9 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
gnat_proc, gnat_pool, gnat_node); gnat_proc, gnat_pool, gnat_node);
storage = convert (storage_ptr_type, protect_multiple_eval (storage)); storage = convert (storage_ptr_type, protect_multiple_eval (storage));
if (TREE_CODE (type) == RECORD_TYPE && TYPE_IS_PADDING_P (type)) if (TYPE_IS_PADDING_P (type))
{ {
type = TREE_TYPE (TYPE_FIELDS (type)); type = TREE_TYPE (TYPE_FIELDS (type));
if (init) if (init)
init = convert (type, init); init = convert (type, init);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment