diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-10-11 09:09:40 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-10-11 09:09:40 +0000 |
commit | 75a582cd9f98b4cdea2eb8e961d53dc8d30fd462 (patch) | |
tree | 0652b424a034b022a2124d283bc526b85c44ee01 /gcc/ada | |
parent | 76dcb70dab490c5dbabaf1b982a1650da2a341cf (diff) | |
download | gcc-75a582cd9f98b4cdea2eb8e961d53dc8d30fd462.zip gcc-75a582cd9f98b4cdea2eb8e961d53dc8d30fd462.tar.gz gcc-75a582cd9f98b4cdea2eb8e961d53dc8d30fd462.tar.bz2 |
decl.c (gnat_to_gnu_field): Adjust again the packing for a field without strict alignment and with an...
* gcc-interface/decl.c (gnat_to_gnu_field): Adjust again the packing
for a field without strict alignment and with an oversized clause.
From-SVN: r276873
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 792db56..ae9fd4c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2019-10-11 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (gnat_to_gnu_field): Adjust again the packing + for a field without strict alignment and with an oversized clause. + +2019-10-11 Eric Botcazou <ebotcazou@adacore.com> + * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the sign of the value when deciding to build a NEGATE_EXPR. <PLUS_EXPR>: Remove redundant line. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 2c5f573..b3f8d58 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -7229,10 +7229,17 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, && INTEGRAL_TYPE_P (TREE_TYPE (TYPE_FIELDS (gnu_field_type)))) gnu_field_type = TREE_TYPE (TYPE_FIELDS (gnu_field_type)); + orig_field_type = gnu_field_type; gnu_field_type = make_type_from_size (gnu_field_type, gnu_size, Has_Biased_Representation (gnat_field)); + /* If the type has been extended, we may need to cap the alignment. */ + if (!needs_strict_alignment + && gnu_field_type != orig_field_type + && tree_int_cst_lt (TYPE_SIZE (orig_field_type), gnu_size)) + packed = adjust_packed (gnu_field_type, gnu_record_type, packed); + orig_field_type = gnu_field_type; gnu_field_type = maybe_pad_type (gnu_field_type, gnu_size, 0, gnat_field, false, false, definition, true); |