]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Elide the copy for bit-packed aggregates in allocators
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 20 Nov 2024 15:37:30 +0000 (16:37 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 12 Dec 2024 09:57:59 +0000 (10:57 +0100)
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.

gcc/ada/exp_aggr.adb

index 37c21ac57629ed1e578d95d25b23584bb8710cda..364af22835920774439debd6960d02998282d9dc 100644 (file)
@@ -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