summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-30 11:25:24 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-30 11:25:24 +0000
commit4ca76485c7f4588c23588204201754e00a246136 (patch)
treef39c21c5d4e4d43f3da54dd3ba8f3ce53a526182 /gcc/ada/gcc-interface/utils.c
parentc8273d2b3c03255383b0c1c39c0d985d83218419 (diff)
* gcc-interface/ada-tree.h (TYPE_MAX_ALIGN): New macro.
* gcc-interface/decl.c (gnat_to_gnu_entity): Do not set PACKED to -2. Remove obsolete code setting the alignment on some atomic types. When the type has no alignment but needs strict alignment and has a size clause, compute a maximum alignment and set it on the type. (adjust_packed): Remove handling of -2 argument. Deal with TYPE_ALIGN and TYPE_MAX_ALIGN directly. (gnat_to_gnu_field): Do not document -2 as argument. (components_to_record): Likewise. * gcc-interface/utils.c (finish_record_type): Do not bump alignment of the record type beyond TYPE_MAX_ALIGN. Reset the latter on exit. * gcc-interface/Makefile.in (PICFLAG_FOR_TARGET): Move around. (GNATLIBCFLAGS_FOR_C): Reformat. (GCC_CFLAGS): Delete. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 0016a3fa288f..f236907fc2b2 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -1694,7 +1694,8 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
/* The enclosing record type must be sufficiently aligned.
Otherwise, if no alignment was specified for it and it
has been laid out already, bump its alignment to the
- desired one if this is compatible with its size. */
+ desired one if this is compatible with its size and
+ maximum alignment, if any. */
if (TYPE_ALIGN (record_type) >= align)
{
DECL_ALIGN (field) = MAX (DECL_ALIGN (field), align);
@@ -1702,7 +1703,9 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
}
else if (!had_align
&& rep_level == 0
- && value_factor_p (TYPE_SIZE (record_type), align))
+ && value_factor_p (TYPE_SIZE (record_type), align)
+ && (!TYPE_MAX_ALIGN (record_type)
+ || TYPE_MAX_ALIGN (record_type) >= align))
{
TYPE_ALIGN (record_type) = align;
DECL_ALIGN (field) = MAX (DECL_ALIGN (field), align);
@@ -1800,6 +1803,9 @@ finish_record_type (tree record_type, tree field_list, int rep_level,
}
}
+ /* Reset the TYPE_MAX_ALIGN field since it's private to gigi. */
+ TYPE_MAX_ALIGN (record_type) = 0;
+
if (debug_info_p)
rest_of_record_type_compilation (record_type);
}