This change makes it so that instantiations of generic subprograms marked as inline are considered for inter-unit inlining. This was not previously the case because of a technical limitation that was too broadly enforced (unlike the associated comment which was more accurate) and excluded instantiations.
The call to Q.Compare must be inlined if the code is compiled with -O -gnatn: with Q; function F (A, B : Integer) return Boolean is begin return Q.Compare (A, B); end; with G; package Q is function Compare is new G (Integer); end Q; generic type T is (<>); function G (Left,Right : T) return Boolean; pragma Inline (G); function G (Left,Right : T) return Boolean is begin return Left /= Right; end; 2014-10-20 Eric Botcazou <ebotca...@adacore.com> * inline.adb (List_Inlining_Info): Minor tweaks. (Add_Inlined_Body): Inline the enclosing package if it is not internally generated, even if it doesn't come from source.
Index: inline.adb =================================================================== --- inline.adb (revision 216469) +++ inline.adb (working copy) @@ -414,7 +414,7 @@ elsif Level = Inline_Package and then not Is_Inlined (Pack) - and then Comes_From_Source (E) + and then not Is_Internal (E) and then not In_Main_Unit_Or_Subunit (Pack) then Set_Is_Inlined (Pack); @@ -3888,7 +3888,7 @@ Count := Count + 1; if Count = 1 then - Write_Str ("Listing of frontend inlined calls"); + Write_Str ("List of calls inlined by the frontend"); Write_Eol; end if; @@ -3917,7 +3917,7 @@ Count := Count + 1; if Count = 1 then - Write_Str ("Listing of inlined calls passed to the backend"); + Write_Str ("List of inlined calls passed to the backend"); Write_Eol; end if; @@ -3947,7 +3947,7 @@ if Count = 1 then Write_Str - ("Listing of inlined subprograms passed to the backend"); + ("List of inlined subprograms passed to the backend"); Write_Eol; end if; @@ -3964,7 +3964,7 @@ end loop; end if; - -- Generate listing of subprogram that cannot be inlined by the backend + -- Generate listing of subprograms that cannot be inlined by the backend if Present (Backend_Not_Inlined_Subps) and then Back_End_Inlining @@ -3979,7 +3979,7 @@ if Count = 1 then Write_Str - ("Listing of subprograms that cannot inline the backend"); + ("List of subprograms that cannot be inlined by the backend"); Write_Eol; end if;