+2008-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * decl.c (gnat_to_gnu_entity) <object>: Cap the alignment promotion
+ to that of ptr_mode instead of word_mode.
+
2008-09-26 Eric Botcazou <ebotcazou@adacore.com>
PR ada/5911
&& TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST)
{
/* No point in jumping through all the hoops needed in order
- to support BIGGEST_ALIGNMENT if we don't really have to. */
+ to support BIGGEST_ALIGNMENT if we don't really have to.
+ So we cap to the smallest alignment that corresponds to
+ a known efficient memory access pattern of the target. */
unsigned int align_cap = Is_Atomic (gnat_entity)
? BIGGEST_ALIGNMENT
- : get_mode_alignment (word_mode);
+ : get_mode_alignment (ptr_mode);
if (!host_integerp (TYPE_SIZE (gnu_type), 1)
|| compare_tree_int (TYPE_SIZE (gnu_type), align_cap) >= 0)
+2008-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/static_initializer4.ads: New test.
+ * gnat.dg/specs/static_initializer3.ads: Add missing marker.
+
2008-09-26 Kai Tietz <kai.tietz@onevision.com>
* g++.dg/compat/struct-layout-1_x1.h: Add __SIZE_TYPE__ cast
+-- { dg-do compile }
+
with Unchecked_Conversion;
package Static_Initializer3 is
--- /dev/null
+-- { dg-do compile }
+
+package Static_Initializer4 is
+
+ type R is tagged record
+ b : Boolean;
+ end record;
+
+ type NR is new R with null record;
+
+ C : NR := (b => True);
+
+end Static_Initializer4;