From: Hristian Kirtchev Date: Tue, 17 Jul 2018 08:11:32 +0000 (+0000) Subject: [Ada] Faulty ignored Ghost code removal X-Git-Tag: upstream/12.2.0~30312 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ffb58afe1ad318ccf289325e802d913bd8e0e15;p=platform%2Fupstream%2Fgcc.git [Ada] Faulty ignored Ghost code removal This patch ensures that removal of ignored Ghost code is the absolute last operation performed on the tree. Previously the removal was performed prior to issuing delayed warnings, however the warning mechanism may see a heavily modified tree and fail. No small reproducer available. 2018-07-17 Hristian Kirtchev gcc/ada/ * frontend.adb (Frontend): The removal of ignored Ghost code must be the last semantic operation performed on the tree. From-SVN: r262795 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9fe7a3b..1b8da21 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2018-07-17 Hristian Kirtchev + * frontend.adb (Frontend): The removal of ignored Ghost code must be + the last semantic operation performed on the tree. + +2018-07-17 Hristian Kirtchev + * frontend.adb (Frontend): Update the call to Register_Config_Switches. * inline.ads: Add new component Config_Switches to record Pending_Body_Info which captures the configuration state of the pending diff --git a/gcc/ada/frontend.adb b/gcc/ada/frontend.adb index 1af5587..1da6f9a 100644 --- a/gcc/ada/frontend.adb +++ b/gcc/ada/frontend.adb @@ -451,11 +451,6 @@ begin Check_Elaboration_Scenarios; - -- Remove any ignored Ghost code as it must not appear in the - -- executable. - - Remove_Ignored_Ghost_Code; - -- Examine all top level scenarios collected during analysis and -- resolution in order to diagnose conditional ABEs, even in the -- presence of serious errors. @@ -483,6 +478,14 @@ begin Sem_Warn.Output_Unreferenced_Messages; Sem_Warn.Check_Unused_Withs; Sem_Warn.Output_Unused_Warnings_Off_Warnings; + + -- Remove any ignored Ghost code as it must not appear in the + -- executable. This action must be performed last because it + -- heavily alters the tree. + + if Operating_Mode = Generate_Code or else GNATprove_Mode then + Remove_Ignored_Ghost_Code; + end if; end if; end if; end;