]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove duplicated code for expansion of packed array assignments
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 3 Oct 2023 17:43:04 +0000 (19:43 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 Nov 2023 09:15:02 +0000 (10:15 +0100)
Expansion of assignments to packed array objects has two cases and
had duplicated code for both these cases.

gcc/ada/

* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Remove code from the
ELSE branch, because it was is identical to code before the IF
statements itself.

gcc/ada/exp_pakd.adb

index 2b92c467187a1310410b341c0e0d6c4379865e16..19d158ffad0381d6f23044fdfc3b1dff7617ef41 100644 (file)
@@ -1432,7 +1432,6 @@ package body Exp_Pakd is
             Bits_nn : constant Entity_Id := RTE (Bits_Id (Csiz));
             Set_nn  : Entity_Id;
             Subscr  : Node_Id;
-            Atyp    : Entity_Id;
             Rev_SSO : Node_Id;
 
          begin
@@ -1454,9 +1453,6 @@ package body Exp_Pakd is
 
             --  Now generate the set reference
 
-            Obj := Relocate_Node (Prefix (Lhs));
-            Convert_To_Actual_Subtype (Obj);
-            Atyp := Etype (Obj);
             Compute_Linear_Subscript (Atyp, Lhs, Subscr);
 
             --  Set indication of whether the packed array has reverse SSO