]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove explicit decoration of wrapper created in freezing
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 17 Apr 2023 10:14:28 +0000 (12:14 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 13 Jun 2023 07:31:42 +0000 (09:31 +0200)
We create wrapper functions associated with inherited functions with
controlling results which are not overridden during freezing. We partly
decorated them explicitly, even though they would be fully decorated
later anyway.

This early decoration didn't work as expected, because flag
In_Private_Part that is read by Override_Dispatching_Operation it not
set reliably while freezing (as explained in the comment of
Is_Private_Declaration). In effect, we were getting a circularity
between Alias and Overridden_Operation, which was causing GNATprove to
loop infinitely.

Apparently the cleanest fix is to not decorate the wrapper with an early
call to Override_Dispatching_Operation.

gcc/ada/

* exp_ch3.adb (Make_Controlling_Function_Wrappers): Remove early
decoration.

gcc/ada/exp_ch3.adb

index f8c99470dd7504ea812e1655fc3b87d4f19f7969..91dcfa0f643af62b65421e1d16ea8fca1bbda620 100644 (file)
@@ -11140,8 +11140,6 @@ package body Exp_Ch3 is
             --  is a wrapper's body in order to get check suppression right.
 
             Set_Corresponding_Spec (Func_Body, Func_Id);
-
-            Override_Dispatching_Operation (Tag_Typ, Subp, New_Op => Func_Id);
          end if;
 
       <<Next_Prim>>