[Ada] Don't look for aliases for generic subprograms
authorRichard Kenner <kenner@adacore.com>
Sun, 28 Feb 2021 16:00:33 +0000 (11:00 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 16 Jun 2021 08:43:00 +0000 (04:43 -0400)
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

index 52d6142f20dc5f60950925b29ad28638381cd6fd..8204fdc9bb64b8c7a5a18459b9bf2852d3d77d59 100644 (file)
@@ -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;