Cleanup related to preanalysis in GNATprove mode; behaviour is
unaffected.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_res.adb (Preanalyze_And_Resolve): Only call
        Set_Must_Not_Freeze when it is necessary to restore the previous
        value.
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -1886,9 +1886,9 @@ package body Sem_Res is
 
       Expander_Mode_Restore;
       Full_Analysis := Save_Full_Analysis;
-      Set_Must_Not_Freeze (N, Save_Must_Not_Freeze);
 
       if not With_Freezing then
+         Set_Must_Not_Freeze (N, Save_Must_Not_Freeze);
          Inside_Preanalysis_Without_Freezing :=
            Inside_Preanalysis_Without_Freezing - 1;
       end if;


Reply via email to