From: Viljar Indus <[email protected]>

gcc/ada/ChangeLog:

        * exp_ch7.adb (Processing_Actions): Avoid processing
        ignored ghost declarations.

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

---
 gcc/ada/exp_ch7.adb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index 292327c67c5..f4f30dcc85d 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -2430,6 +2430,14 @@ package body Exp_Ch7 is
             Strict       : Boolean := False)
          is
          begin
+            --  No need to process ignored ghost declarations as they will be
+            --  removed later and therefore do not need finalization
+            --  primitives.
+
+            if Is_Ignored_Ghost_Node (Decl) then
+               return;
+            end if;
+
             --  Library-level tagged type
 
             if Nkind (Decl) = N_Full_Type_Declaration then
-- 
2.53.0

Reply via email to