From ff4746bcdefb170e9583b673d29af474b7ca0786 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 28 Feb 2021 11:00:33 -0500 Subject: [PATCH] [Ada] Don't look for aliases for generic subprograms gcc/ada/ * exp_unst.adb (Register_Subprogram): Don't look for aliases for subprograms that are generic. Reorder tests for efficiency. --- gcc/ada/exp_unst.adb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 52d6142..8204fdc 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -883,9 +883,10 @@ package body Exp_Unst is -- within Subp. Calls to Subp itself or to subprograms -- outside the nested structure do not affect us. - if Scope_Within (Ultimate_Alias (Ent), Subp) - and then Is_Subprogram (Ent) + if Is_Subprogram (Ent) + and then not Is_Generic_Subprogram (Ent) and then not Is_Imported (Ent) + and then Scope_Within (Ultimate_Alias (Ent), Subp) then Append_Unique_Call ((N, Current_Subprogram, Ent)); end if; -- 2.7.4