From: Eric Botcazou Date: Wed, 20 Nov 2024 15:37:30 +0000 (+0100) Subject: ada: Elide the copy for bit-packed aggregates in allocators X-Git-Tag: basepoints/gcc-16~3403 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8999aba832b3c8789d3bfd5680985bfb77a4df87;p=thirdparty%2Fgcc.git ada: Elide the copy for bit-packed aggregates in allocators The in-place expansion has been historically disabled for them, but there does not seem to be any good reason left for this. gcc/ada/ChangeLog: * exp_aggr.adb (Expand_Array_Aggregate): Do not exclude aggregates of bit-packed array types in allocators from in-place expansion. --- diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 37c21ac57629..364af2283592 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -6150,21 +6150,18 @@ package body Exp_Aggr is or else (Parent_Kind in N_Aggregate | N_Extension_Aggregate and then not Is_Container_Aggregate (Parent_Node)) - -- Allocator (see Convert_Aggr_In_Allocator). Bit-packed array types - -- need specific processing and sliding cannot be done in place for - -- the time being. + -- Allocator (see Convert_Aggr_In_Allocator). Sliding cannot be done + -- in place for the time being. or else (Nkind (Parent_Node) = N_Allocator and then (Aggr_Assignment_OK_For_Backend (N) or else Is_Limited_Type (Typ) or else Needs_Finalization (Typ) - or else (not Is_Bit_Packed_Array (Typ) - and then not - Must_Slide + or else not Must_Slide (N, Designated_Type (Etype (Parent_Node)), - Typ)))) + Typ))) -- Object declaration (see Convert_Aggr_In_Object_Decl). Bit-packed -- array types need specific processing and sliding cannot be done