Commit 7ffb58af by Hristian Kirtchev Committed by Pierre-Marie de Rodat

[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  <kirtchev@adacore.com>

gcc/ada/

	* frontend.adb (Frontend): The removal of ignored Ghost code must be
	the last semantic operation performed on the tree.

From-SVN: r262795
parent 9cc97ad5
2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
* frontend.adb (Frontend): The removal of ignored Ghost code must be
the last semantic operation performed on the tree.
2018-07-17 Hristian Kirtchev <kirtchev@adacore.com>
* 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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment