From 9531aef54f34b65aab0efe92a713d0f825b6cefe Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 13 Dec 2019 09:05:38 +0000 Subject: [PATCH] [Ada] Unnesting and annex E 2019-12-13 Arnaud Charlet gcc/ada/ * exp_unst.adb (Unnest_Subprogram): Account for trees produced by Annex E constructs. From-SVN: r279367 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/exp_unst.adb | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cfa051ad3124..d48a3610e55b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-12-13 Arnaud Charlet + + * exp_unst.adb (Unnest_Subprogram): Account for trees produced + by Annex E constructs. + 2019-12-13 Ghjuvan Lacambre * doc/gnat_rm/implementation_defined_pragmas.rst: Update diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index f016d2f4d499..1747281a00b3 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -414,11 +414,14 @@ package body Exp_Unst is then return; - -- Only unnest when generating code for the main source unit or if we're - -- unnesting for inline. + -- Only unnest when generating code for the main source unit or if + -- we're unnesting for inline. But in some Annex E cases the Sloc + -- points to a different unit, so also make sure that the Parent + -- isn't in something that we know we're generating code for. elsif not For_Inline and then not In_Extended_Main_Code_Unit (Subp_Body) + and then not In_Extended_Main_Code_Unit (Parent (Subp_Body)) then return; end if; -- 2.47.2