From 82d6f5327943f851a1c2973055f3e7ed09071dbb Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Sun, 25 Apr 2010 09:22:35 +0000 Subject: trans.c (gnat_to_gnu): Do not use memmove if the array type is bit-packed. * gcc-interface/trans.c (gnat_to_gnu) : Do not use memmove if the array type is bit-packed. From-SVN: r158701 --- gcc/ada/gcc-interface/trans.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/ada/gcc-interface/trans.c') diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 71c9e86..84fa138 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -4797,10 +4797,12 @@ gnat_to_gnu (Node_Id gnat_node) 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; -- cgit v1.1