diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2013-03-06 18:00:50 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2013-03-06 18:00:50 +0000 |
commit | afb0fadf9d4128d2e7f508535fc070beb161ffc2 (patch) | |
tree | d44c6d26309de6f76195111e553b5bb8f8f2f4e7 /gcc/ada/gcc-interface/decl.c | |
parent | 6f71e355ebcc5e6e3474369ea5dd361d3ee5875d (diff) | |
download | gcc-afb0fadf9d4128d2e7f508535fc070beb161ffc2.zip gcc-afb0fadf9d4128d2e7f508535fc070beb161ffc2.tar.gz gcc-afb0fadf9d4128d2e7f508535fc070beb161ffc2.tar.bz2 |
decl.c (gnat_to_gnu_field): Remove the wrapper around a misaligned integral type if...
* gcc-interface/decl.c (gnat_to_gnu_field): Remove the wrapper around
a misaligned integral type if a size is specified for the field.
From-SVN: r196506
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 56b64a3..7342fa3 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -6619,6 +6619,13 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, <= 0) gnu_field_type = TREE_TYPE (TYPE_FIELDS (gnu_field_type)); + /* Similarly if the field's type is a misaligned integral type, but + there is no restriction on the size as there is no justification. */ + if (!needs_strict_alignment + && TYPE_IS_PADDING_P (gnu_field_type) + && INTEGRAL_TYPE_P (TREE_TYPE (TYPE_FIELDS (gnu_field_type)))) + gnu_field_type = TREE_TYPE (TYPE_FIELDS (gnu_field_type)); + gnu_field_type = make_type_from_size (gnu_field_type, gnu_size, Has_Biased_Representation (gnat_field)); |