From 95c9c1c0dcbe4b9bfd9ff8fcdf44d799ffcf6275 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 23 Jun 2020 17:17:50 +0200 Subject: [PATCH] Minor adjustment in assignment case gcc/ada/ChangeLog: * gcc-interface/trans.c (gnat_to_gnu) : Do not test Is_Bit_Packed_Array in the memset path. --- gcc/ada/gcc-interface/trans.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 313a2fbcbaf..a64b6d00d00 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -7282,10 +7282,8 @@ gnat_to_gnu (Node_Id gnat_node) : gnat_expr; const Entity_Id gnat_type = Underlying_Type (Etype (Name (gnat_node))); - const bool regular_array_type_p - = Is_Array_Type (gnat_type) && !Is_Bit_Packed_Array (gnat_type); const bool use_memset_p - = regular_array_type_p + = Is_Array_Type (gnat_type) && Nkind (gnat_inner) == N_Aggregate && Is_Single_Aggregate (gnat_inner); @@ -7356,7 +7354,8 @@ gnat_to_gnu (Node_Id gnat_node) 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 - && regular_array_type_p + && Is_Array_Type (gnat_type) + && !Is_Bit_Packed_Array (gnat_type) && !(Forwards_OK (gnat_node) && Backwards_OK (gnat_node))) { tree to = TREE_OPERAND (gnu_result, 0); -- 2.30.2