diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-10-12 14:47:34 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-10-12 14:47:34 +0000 |
commit | 9aa357c75358a51f038e50f7c8d9207b58c157e0 (patch) | |
tree | c848d422a4d6c884a4a4a2c644ada53d6ad6ebc4 /gcc/ada/sem_elab.adb | |
parent | 853ce7c073eedfba1adfb63530a8bd2baa767137 (diff) | |
download | gcc-9aa357c75358a51f038e50f7c8d9207b58c157e0.zip gcc-9aa357c75358a51f038e50f7c8d9207b58c157e0.tar.gz gcc-9aa357c75358a51f038e50f7c8d9207b58c157e0.tar.bz2 |
re PR ada/91995 (gnat miscompilation and bootstrap failure on m68k-linux)
PR ada/91995
* sem_ch8.adb (Chain_Use_Clause): Remove second argument in calls
to Defining_Entity.
* sem_elab.adb (Find_Unit_Entity): Likewise. Deal with N_Subunit
here in lieu of in Defining_Entity.
* sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
* sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
and adjust accordingly. Deal with N_Compilation_Unit.
From-SVN: r276916
Diffstat (limited to 'gcc/ada/sem_elab.adb')
-rw-r--r-- | gcc/ada/sem_elab.adb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 2dbf54d..0c71f59 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -9103,13 +9103,23 @@ package body Sem_Elab is N_Procedure_Instantiation) and then Nkind (Context) = N_Compilation_Unit then - return - Related_Instance (Defining_Entity (N, Concurrent_Subunit => True)); + return Related_Instance (Defining_Entity (N)); + + -- The unit denotes a concurrent body acting as a subunit. Such bodies + -- are generally rewritten into null statements. The proper entity is + -- that of the "original node". + + elsif Nkind (N) = N_Subunit + and then Nkind (Proper_Body (N)) = N_Null_Statement + and then Nkind_In (Original_Node (Proper_Body (N)), N_Protected_Body, + N_Task_Body) + then + return Defining_Entity (Original_Node (Proper_Body (N))); -- Otherwise the proper entity is the defining entity else - return Defining_Entity (N, Concurrent_Subunit => True); + return Defining_Entity (N); end if; end Find_Unit_Entity; |