-2013-06-03 Eric Botcazou <ebotcazou@adacore.com>
+2013-03-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_field): Remove the wrapper around
+ a misaligned integral type if a size is specified for the field.
+
+2013-03-06 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Raise_Error_to_gnu) <CE_Index_Check_Failed>:
Record the unpadded type of the index type on the RCI stack.
<= 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));
-2013-06-03 Eric Botcazou <ebotcazou@adacore.com>
+2013-03-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/aggr6.ads: New test.
+
+2013-03-06 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/loop_optimization15.ad[sb]: New test.
--- /dev/null
+-- { dg-do compile }\r
+\r
+package Aggr6 is\r
+\r
+ type B15_T is mod 2 ** 15;\r
+ for B15_T'Size use 15;\r
+ for B15_T'Alignment use 1;\r
+\r
+ type B17_T is mod 2 ** 17;\r
+ for B17_T'Size use 17;\r
+ for B17_T'Alignment use 1;\r
+\r
+ type Rec_T is record\r
+ A : B17_T;\r
+ B : B15_T;\r
+ end record;\r
+ for Rec_T use record\r
+ A at 0 range 0 .. 16;\r
+ B at 0 range 17 .. 31;\r
+ end record;\r
+ for Rec_T'Size use 32;\r
+\r
+ C : constant Rec_T := (A => 1, B => 0);\r
+\r
+end Aggr6;\r