diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2017-12-14 17:03:16 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-12-14 17:03:16 +0000 |
commit | 9df60a5d915668f6b25fae0b76996e6bfd79e38c (patch) | |
tree | c9c67232537cb4573931da8efbab3fe4fc445a49 /gcc/ada | |
parent | 636f605cbf67b82baf3726d2e92607cd39004d37 (diff) | |
download | gcc-9df60a5d915668f6b25fae0b76996e6bfd79e38c.zip gcc-9df60a5d915668f6b25fae0b76996e6bfd79e38c.tar.gz gcc-9df60a5d915668f6b25fae0b76996e6bfd79e38c.tar.bz2 |
decl.c (gnat_to_gnu_field): Do not set the alignment of the enclosing record type if it is not already set.
* gcc-interface/decl.c (gnat_to_gnu_field): Do not set the alignment
of the enclosing record type if it is not already set.
From-SVN: r255645
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3ac3bfb..c87f4a2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2017-12-14 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (gnat_to_gnu_field): Do not set the alignment + of the enclosing record type if it is not already set. + +2017-12-14 Eric Botcazou <ebotcazou@adacore.com> + * 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. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index f2da070..b014e68 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -6890,7 +6890,8 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, { const unsigned int type_align = TYPE_ALIGN (gnu_field_type); - if (TYPE_ALIGN (gnu_record_type) < type_align) + if (TYPE_ALIGN (gnu_record_type) + && TYPE_ALIGN (gnu_record_type) < type_align) SET_TYPE_ALIGN (gnu_record_type, type_align); /* If the position is not a multiple of the alignment of the type, |