]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove unhelpful special case for renamed bodies in GNATprove mode
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 20 Dec 2022 15:27:30 +0000 (16:27 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 5 Jan 2023 14:30:02 +0000 (15:30 +0100)
This patch reverts a special-case related to inlining of renamed bodies
in GNATprove mode. Its idea was that inlining is decided in routine
Cannot_Inline, which is called much later. This didn't quite work,
because in the meantime the renamed body was prepared to inlining in
Build_Body_To_Inline, which was not designed to handle renamed bodies.

gcc/ada/

* freeze.adb (Build_Renamed_Body): Revert a special case for
GNATprove; remove unnecessary initialization of a local variable.

gcc/ada/freeze.adb

index 97a25d1083505fb7940657ca6656256447066d6a..a3ab685f5fc617d16725d29c7fc198ac55dbd860 100644 (file)
@@ -398,7 +398,7 @@ package body Freeze is
       Nam        : constant Node_Id := Name (N);
       Old_S      : Entity_Id;
       Spec       : constant Node_Id := New_Copy_Tree (Specification (Decl));
-      Actuals    : List_Id := No_List;
+      Actuals    : List_Id;
       Call_Node  : Node_Id;
       Call_Name  : Node_Id;
       Body_Node  : Node_Id;
@@ -477,14 +477,11 @@ package body Freeze is
       --  calls to the renamed entity. The body must be generated in any case
       --  for calls that may appear elsewhere. This is not done in the case
       --  where the subprogram is an instantiation because the actual proper
-      --  body has not been built yet. This is also not done in GNATprove mode
-      --  as we need to check other conditions for creating a body to inline
-      --  in that case, which are controlled in Analyze_Subprogram_Body_Helper.
+      --  body has not been built yet.
 
       if Ekind (Old_S) in E_Function | E_Procedure
         and then Nkind (Decl) = N_Subprogram_Declaration
         and then not Is_Generic_Instance (Old_S)
-        and then not GNATprove_Mode
       then
          Set_Body_To_Inline (Decl, Old_S);
       end if;