From: Yannick Moy Date: Mon, 12 Oct 2020 15:32:45 +0000 (+0200) Subject: [Ada] Fix internal compilation error on circular type in SPARK code X-Git-Tag: basepoints/gcc-12~2916 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8c229e14c4d6c5c6e2d1ff18741e89d7149d81d;p=thirdparty%2Fgcc.git [Ada] Fix internal compilation error on circular type in SPARK code gcc/ada/ * sem_ch3.adb (Access_Type_Declaration): Set Etype before checking for volatility compatibility. --- diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index f5c780819884..8085867dee69 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -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.