diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2017-09-09 12:02:57 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-09-09 12:02:57 +0000 |
commit | ea09ecc5c01685aec71da99f8949f8e403e21789 (patch) | |
tree | f179eb786fd436bd2e5e931dfc5deece03859df5 /gcc/ada | |
parent | 5bab4c9631c478b7940e952ea57de680321d5a8e (diff) | |
download | gcc-ea09ecc5c01685aec71da99f8949f8e403e21789.zip gcc-ea09ecc5c01685aec71da99f8949f8e403e21789.tar.gz gcc-ea09ecc5c01685aec71da99f8949f8e403e21789.tar.bz2 |
decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK and TYPE_BY_REFERENCE_P flags on types after various...
* gcc-interface/decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK
and TYPE_BY_REFERENCE_P flags on types after various promotions.
* gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>:
Consider all kinds of entities.
From-SVN: r251927
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 30 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 2 |
3 files changed, 22 insertions, 17 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 65b6833..6015967 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,12 @@ 2017-09-09 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (gnat_to_gnu_entity): Only set the TYPE_ALIGN_OK + and TYPE_BY_REFERENCE_P flags on types after various promotions. + * gcc-interface/trans.c (node_has_volatile_full_access) <N_Identifier>: + Consider all kinds of entities. + +2017-09-09 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/utils.c (convert): When converting to a padding type, reuse an existing CONSTRUCTOR if it has got the right size. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index baa9259..df88ce7 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -4277,18 +4277,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) already defined so we cannot pass true for IN_PLACE here. */ process_attributes (&gnu_type, &attr_list, false, gnat_entity); - /* Tell the middle-end that objects of tagged types are guaranteed to - be properly aligned. This is necessary because conversions to the - class-wide type are translated into conversions to the root type, - which can be less aligned than some of its derived types. */ - if (Is_Tagged_Type (gnat_entity) - || Is_Class_Wide_Equivalent_Type (gnat_entity)) - TYPE_ALIGN_OK (gnu_type) = 1; - - /* Record whether the type is passed by reference. */ - if (!VOID_TYPE_P (gnu_type) && Is_By_Reference_Type (gnat_entity)) - TYPE_BY_REFERENCE_P (gnu_type) = 1; - /* ??? Don't set the size for a String_Literal since it is either confirming or we don't handle it properly (if the low bound is non-constant). */ @@ -4498,17 +4486,29 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* If this is not an unconstrained array type, set some flags. */ if (TREE_CODE (gnu_type) != UNCONSTRAINED_ARRAY_TYPE) { + /* Tell the middle-end that objects of tagged types are guaranteed to + be properly aligned. This is necessary because conversions to the + class-wide type are translated into conversions to the root type, + which can be less aligned than some of its derived types. */ + if (Is_Tagged_Type (gnat_entity) + || Is_Class_Wide_Equivalent_Type (gnat_entity)) + TYPE_ALIGN_OK (gnu_type) = 1; + + /* Record whether the type is passed by reference. */ + if (Is_By_Reference_Type (gnat_entity) && !VOID_TYPE_P (gnu_type)) + TYPE_BY_REFERENCE_P (gnu_type) = 1; + + /* Record whether an alignment clause was specified. */ if (Present (Alignment_Clause (gnat_entity))) TYPE_USER_ALIGN (gnu_type) = 1; + /* Record whether a pragma Universal_Aliasing was specified. */ if (Universal_Aliasing (gnat_entity) && !TYPE_IS_DUMMY_P (gnu_type)) TYPE_UNIVERSAL_ALIASING_P (gnu_type) = 1; /* If it is passed by reference, force BLKmode to ensure that objects of this type will always be put in memory. */ - if (TYPE_MODE (gnu_type) != BLKmode - && AGGREGATE_TYPE_P (gnu_type) - && TYPE_BY_REFERENCE_P (gnu_type)) + if (AGGREGATE_TYPE_P (gnu_type) && TYPE_BY_REFERENCE_P (gnu_type)) SET_TYPE_MODE (gnu_type, BLKmode); } diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 8eff9c3..2f7d497 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -4075,8 +4075,6 @@ node_has_volatile_full_access (Node_Id gnat_node) case N_Identifier: case N_Expanded_Name: gnat_entity = Entity (gnat_node); - if (Ekind (gnat_entity) != E_Variable) - break; return Is_Volatile_Full_Access (gnat_entity) || Is_Volatile_Full_Access (Etype (gnat_entity)); |