+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
&& 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);