From a8c229e14c4d6c5c6e2d1ff18741e89d7149d81d Mon Sep 17 00:00:00 2001 From: Yannick Moy Date: Mon, 12 Oct 2020 17:32:45 +0200 Subject: [PATCH] [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. --- gcc/ada/sem_ch3.adb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index f5c78081988..8085867dee6 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. -- 2.30.2