aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2019-12-19 17:00:27 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-02 04:58:15 -0400
commitd7f696a040a0fd85ea58399836a77f903d6bf039 (patch)
treec8c8bd155acc6946dbf86f887a7e810882c23961 /gcc
parent2f0067f47e5531e555c61f2ea9815fe8b088e877 (diff)
downloadgcc-d7f696a040a0fd85ea58399836a77f903d6bf039.zip
gcc-d7f696a040a0fd85ea58399836a77f903d6bf039.tar.gz
gcc-d7f696a040a0fd85ea58399836a77f903d6bf039.tar.bz2
[Ada] ICE during unnesting when nested subprograms have address taken
2020-06-02 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * exp_unst.adb (Register_Subprogram): Test for Address_Taken (in addition to the existing test for In_Synchonized_Unit) when deciding whether to reset the Reachable flag on all subprograms enclosing the subprogram being registered.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/exp_unst.adb8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb
index 1460b64..b3ded13 100644
--- a/gcc/ada/exp_unst.adb
+++ b/gcc/ada/exp_unst.adb
@@ -841,9 +841,13 @@ package body Exp_Unst is
-- If we marked this reachable because it's in a synchronized
-- unit, we have to mark all enclosing subprograms as reachable
- -- as well.
+ -- as well. We do the same for subprograms with Address_Taken,
+ -- because otherwise we can run into problems with looking at
+ -- enclosing subprograms in Subps.Table due to their being
+ -- unreachable (the Subp_Index of unreachable subps is later
+ -- set to zero and their entry in Subps.Table is removed).
- if In_Synchronized_Unit (E) then
+ if In_Synchronized_Unit (E) or else Address_Taken (E) then
declare
S : Entity_Id := E;