aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-12-14 11:47:24 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-12-14 11:47:24 +0000
commit4d39941ea9e6fe059084be9f5dea7e29e055db91 (patch)
treecb51425855d3854723367fc3c5edb23fca63211e /gcc/ada/gcc-interface/trans.c
parent02aee327674dae6359d7b1e1a7434f039ba0c3d3 (diff)
downloadgcc-4d39941ea9e6fe059084be9f5dea7e29e055db91.zip
gcc-4d39941ea9e6fe059084be9f5dea7e29e055db91.tar.gz
gcc-4d39941ea9e6fe059084be9f5dea7e29e055db91.tar.bz2
gigi.h (pad_type_has_rm_size): Declare.
* gcc-interface/gigi.h (pad_type_has_rm_size): Declare. * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Do not build a padding type for the alignment before validating the size. Flip conditional construct and add a comment. * gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Make sure to apply the exception for padded objects to the type of the object. * gcc-interface/utils.c (hash_pad_type): New static function. (lookup_and_insert_pad_type): Rename into... (canonicalize_pad_type): ...this. Call hash_pad_type, do only one lookup with insertion and always return the canonical type. (maybe_pad_type): Adjust to above changes. Set debug type later. (pad_type_has_rm_size): New predicate. (set_reverse_storage_order_on_pad_type): Adjust to above changes. From-SVN: r255631
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 0cf37f1..cae156f 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -1850,7 +1850,8 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
This is in keeping with the object case of gnat_to_gnu_entity. */
else if ((TREE_CODE (gnu_prefix) != TYPE_DECL
&& !(TYPE_IS_PADDING_P (gnu_type)
- && TREE_CODE (gnu_expr) == COMPONENT_REF))
+ && TREE_CODE (gnu_expr) == COMPONENT_REF
+ && pad_type_has_rm_size (gnu_type)))
|| attribute == Attr_Object_Size
|| attribute == Attr_Max_Size_In_Storage_Elements)
{