+2010-04-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Do not
+ use memmove if the array type is bit-packed.
+
2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/misc.c (gnat_init): Remove second argument in call to
gnu_result
= build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_lhs, gnu_rhs);
- /* If the type being assigned is an array type and the two sides
- are not completely disjoint, play safe and use memmove. */
+ /* If the type being assigned is an array type and the two sides are
+ not completely disjoint, play safe and use memmove. But don't do
+ it for a bit-packed array as it might not be byte-aligned. */
if (TREE_CODE (gnu_result) == MODIFY_EXPR
&& Is_Array_Type (Etype (Name (gnat_node)))
+ && !Is_Bit_Packed_Array (Etype (Name (gnat_node)))
&& !(Forwards_OK (gnat_node) && Backwards_OK (gnat_node)))
{
tree to, from, size, to_ptr, from_ptr, t;
+2010-04-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/pack15.ad[sb]: New test.
+
2010-04-25 Paolo Bonzini <bonzini@gnu.org>
* gcc.target/arm/mla-1.c: New test.
--- /dev/null
+package Pack15 is
+
+ type Flags is array (1..2) of Boolean;
+ for Flags'Component_Size use 1;
+
+ type Messages is record
+ Status_Flags : Flags;
+ end record;
+
+ for Messages use record
+ Status_Flags at 0 range 1 .. 2;
+ end record;
+
+ O : Messages;
+
+ Buffer : Integer;
+ Status_Flags : Flags;
+ for Status_Flags'Address use Buffer'Address;
+
+ procedure Transfer;
+
+end Pack15;