aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-12-20 10:27:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-12-20 10:27:37 +0000
commit80746f5d88a60d13bc63f2f76a9dc547261b9601 (patch)
treeb1b6049a89422cb89eb4659b44f9a0ae9c121903 /gcc
parentafeb246c1bb0b5496dfd133c70fef9d9fff722ac (diff)
downloadgcc-80746f5d88a60d13bc63f2f76a9dc547261b9601.zip
gcc-80746f5d88a60d13bc63f2f76a9dc547261b9601.tar.gz
gcc-80746f5d88a60d13bc63f2f76a9dc547261b9601.tar.bz2
utils.c (maybe_pad_type): In type_annotate_only mode...
* gcc-interface/utils.c (maybe_pad_type): In type_annotate_only mode, retrieve the component type if this is an array and do not issue the warning for concurrent types. From-SVN: r231859
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/utils.c25
2 files changed, 23 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index bdd5341..0de7c0a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2015-12-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/utils.c (maybe_pad_type): In type_annotate_only mode,
+ retrieve the component type if this is an array and do not issue the
+ warning for concurrent types.
+
2015-12-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.h (TYPE_DEBUG_TYPE): Remove duplicate.
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index be3565a..779c376 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1411,19 +1411,28 @@ maybe_pad_type (tree type, tree size, unsigned int align,
rest_of_record_type_compilation (record);
built:
- /* If the size was widened explicitly, maybe give a warning. Take the
- original size as the maximum size of the input if there was an
- unconstrained record involved and round it up to the specified alignment,
- if one was specified. But don't do it if we are just annotating types
- and the type is tagged, since tagged types aren't fully laid out in this
- mode. */
+ /* If a simple size was explicitly given, maybe issue a warning. */
if (!size
|| TREE_CODE (size) == COND_EXPR
|| TREE_CODE (size) == MAX_EXPR
- || No (gnat_entity)
- || (type_annotate_only && Is_Tagged_Type (Etype (gnat_entity))))
+ || No (gnat_entity))
return record;
+ /* But don't do it if we are just annotating types and the type is tagged or
+ concurrent, since these types aren't fully laid out in this mode. */
+ if (type_annotate_only)
+ {
+ Entity_Id gnat_type
+ = is_component_type
+ ? Component_Type (gnat_entity) : Etype (gnat_entity);
+
+ if (Is_Tagged_Type (gnat_type) || Is_Concurrent_Type (gnat_type))
+ return record;
+ }
+
+ /* Take the original size as the maximum size of the input if there was an
+ unconstrained record involved and round it up to the specified alignment,
+ if one was specified, but only for aggregate types. */
if (CONTAINS_PLACEHOLDER_P (orig_size))
orig_size = max_size (orig_size, true);