[Ada] Use Actions field of freeze nodes for subprograms (continued)
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 2 May 2022 08:57:46 +0000 (10:57 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 1 Jun 2022 08:43:16 +0000 (08:43 +0000)
This case was missed in the previous change.

gcc/ada/

* exp_ch6.adb (Freeze_Subprogram.Register_Predefined_DT_Entry): Put
the actions into the Actions field of the freeze node instead of
inserting them after it.

gcc/ada/exp_ch6.adb

index 7d50727..3b5d59c 100644 (file)
@@ -7839,6 +7839,7 @@ package body Exp_Ch6 is
 
       procedure Register_Predefined_DT_Entry (Prim : Entity_Id) is
          Iface_DT_Ptr : Elmt_Id;
+         L            : List_Id;
          Tagged_Typ   : Entity_Id;
          Thunk_Id     : Entity_Id;
          Thunk_Code   : Node_Id;
@@ -7871,7 +7872,7 @@ package body Exp_Ch6 is
               Iface => Related_Type (Node (Iface_DT_Ptr)));
 
             if Present (Thunk_Code) then
-               Insert_Actions_After (N, New_List (
+               L := New_List (
                  Thunk_Code,
 
                  Build_Set_Predefined_Prim_Op_Address (Loc,
@@ -7894,7 +7895,14 @@ package body Exp_Ch6 is
                      Unchecked_Convert_To (RTE (RE_Prim_Ptr),
                        Make_Attribute_Reference (Loc,
                          Prefix         => New_Occurrence_Of (Prim, Loc),
-                         Attribute_Name => Name_Unrestricted_Access)))));
+                         Attribute_Name => Name_Unrestricted_Access))));
+
+               if No (Actions (N)) then
+                  Set_Actions (N, L);
+
+               else
+                  Append_List (L, Actions (N));
+               end if;
             end if;
 
             --  Skip the tag of the predefined primitives dispatch table