From: Arnaud Charlet Date: Fri, 13 Dec 2019 09:05:38 +0000 (+0000) Subject: [Ada] Unnesting and annex E X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9531aef54f34b65aab0efe92a713d0f825b6cefe;p=gcc.git [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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cfa051ad312..d48a3610e55 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 f016d2f4d49..1747281a00b 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;