[Ada] Fix internal compilation error on circular type in SPARK code
authorYannick Moy <moy@adacore.com>
Mon, 12 Oct 2020 15:32:45 +0000 (17:32 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 25 Nov 2020 13:22:28 +0000 (08:22 -0500)
gcc/ada/

* sem_ch3.adb (Access_Type_Declaration): Set Etype before
checking for volatility compatibility.

gcc/ada/sem_ch3.adb

index f5c7808..8085867 100644 (file)
@@ -1411,6 +1411,8 @@ package body Sem_Ch3 is
          Set_Is_Tagged_Type (T, False);
       end if;
 
+      Set_Etype (T, T);
+
       --  For SPARK, check that the designated type is compatible with
       --  respect to volatility with the access type.
 
@@ -1431,8 +1433,6 @@ package body Sem_Ch3 is
             Srcpos_Bearer => T);
       end if;
 
-      Set_Etype (T, T);
-
       --  If the type has appeared already in a with_type clause, it is frozen
       --  and the pointer size is already set. Else, initialize.