diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-04-25 09:22:35 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-04-25 09:22:35 +0000 |
commit | 82d6f5327943f851a1c2973055f3e7ed09071dbb (patch) | |
tree | 34d9cfc1911359c24046c9c69c0604dc047d3083 /gcc/ada/gcc-interface/trans.c | |
parent | 3d416346cfca32e50fc17feea9ba012b3a2730f5 (diff) | |
download | gcc-82d6f5327943f851a1c2973055f3e7ed09071dbb.zip gcc-82d6f5327943f851a1c2973055f3e7ed09071dbb.tar.gz gcc-82d6f5327943f851a1c2973055f3e7ed09071dbb.tar.bz2 |
trans.c (gnat_to_gnu): Do not use memmove if the array type is bit-packed.
* gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Do not
use memmove if the array type is bit-packed.
From-SVN: r158701
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |