From: Eric Botcazou Date: Wed, 5 Aug 2020 13:50:06 +0000 (+0200) Subject: [Ada] Fix problematic placement of freeze node after instantiation X-Git-Tag: basepoints/gcc-12~4083 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd2e6f249e55c810c0414572807face97d88f07;p=thirdparty%2Fgcc.git [Ada] Fix problematic placement of freeze node after instantiation gcc/ada/ * sem_ch12.adb (Freeze_Subprogram_Body): Do not move the freeze node of the package body enclosing the instance when its parent is in the same declarative part as the freeze node of the parent. --- diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 64f10a25dbe8..16b42bd0cc14 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -9106,12 +9106,7 @@ package body Sem_Ch12 is and then Present (Freeze_Node (Par)) and then Present (Enc_I) then - if In_Same_Declarative_Part (Parent (Freeze_Node (Par)), Enc_I) - or else - (Nkind (Enc_I) = N_Package_Body - and then In_Same_Declarative_Part - (Parent (Freeze_Node (Par)), Parent (Enc_I))) - then + if In_Same_Declarative_Part (Parent (Freeze_Node (Par)), Enc_I) then -- The enclosing package may contain several instances. Rather -- than computing the earliest point at which to insert its freeze -- node, we place it at the end of the declarative part of the