From 46ba7ae3c6eea45cc03de5fb00c8084cdc760d64 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 31 Aug 2022 14:39:08 +0200 Subject: [PATCH] [Ada] Fix oversight in implementation of unnesting The pass would traverse generic subprogram bodies, which are not expanded, thus stumbling on unexpected nodes. gcc/ada/ * exp_unst.adb (Unnest_Subprograms.Search_Subprograms): Skip the subprogram bodies that are not to be unnested. --- gcc/ada/exp_unst.adb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 1297f289f78..91646447475 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -2592,6 +2592,8 @@ package body Exp_Unst is and then Is_Library_Level_Entity (Spec_Id) then Unnest_Subprogram (Spec_Id, N); + else + return Skip; end if; end; -- 2.47.3