From: Viljar Indus <[email protected]>

gcc/ada/ChangeLog:

        * ghost.adb (Set_Ghost_Mode): Create ignored ghost regions
        for ignored pragamas.
        * sem_prag.adb (Analyze_Pragma): Mark ignored pragmas checks as
        ignored ghost pragmas.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/ghost.adb    | 2 ++
 gcc/ada/sem_prag.adb | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/gcc/ada/ghost.adb b/gcc/ada/ghost.adb
index b356bed9d40..dac1442b663 100644
--- a/gcc/ada/ghost.adb
+++ b/gcc/ada/ghost.adb
@@ -2907,6 +2907,8 @@ package body Ghost is
          else
             if Is_Checked (N) then
                Install_Ghost_Region (Check, N, Level);
+            elsif Is_Ignored (N) then
+               Install_Ghost_Region (Ignore, N, Level);
             else
                Install_Ghost_Region (None, N, Level);
             end if;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index d007c1ed8d1..543ca7f6f93 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -15672,6 +15672,12 @@ package body Sem_Prag is
             --  warning when we delete the if statement.
 
             if Expander_Active and Is_Ignored_In_Codegen (N) then
+
+               --  Mark pragma as ignored ghost to reuse the same removal
+               --  process.
+
+               Mark_Ghost_Pragma (N, Opt.Ignore);
+
                Eloc := Sloc (Arg_Check);
 
                Rewrite (N,
-- 
2.53.0

Reply via email to