From: Eric Botcazou Date: Thu, 23 Jan 2020 20:52:19 +0000 (+0100) Subject: [Ada] Set convention and inlined flag on default null procedure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d2f87b22d1e47859166efc90eda830d21a0c31b9;p=gcc.git [Ada] Set convention and inlined flag on default null procedure 2020-06-04 Eric Botcazou gcc/ada/ * sem_attr.adb (Resolve_Attribute) : Do not generate the secondary message about a missing pragma if the convention of the prefix is Intrinsic. * sem_ch12.adb (Instantiate_Formal_Subprogram): Only set the Convention and the Is_Inlined flag on a null procedure. --- diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 07f01178786..005add8c59a 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -10678,6 +10678,7 @@ package body Sem_Attr is if not Is_Itype (Btyp) and then not Has_Convention_Pragma (Btyp) + and then Convention (Entity (P)) /= Convention_Intrinsic then Error_Msg_FE ("\probable missing pragma Convention for &", diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 49a8720b482..10680567ee1 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -10785,7 +10785,13 @@ package body Sem_Ch12 is Make_Handled_Sequence_Of_Statements (Loc, Statements => New_List (Make_Null_Statement (Loc)))); - Set_Is_Intrinsic_Subprogram (Defining_Unit_Name (New_Spec)); + -- RM 12.6 (16 2/2): The procedure has convention Intrinsic + + Set_Convention (Defining_Unit_Name (New_Spec), Convention_Intrinsic); + + -- Eliminate the calls to it when optimization is enabled + + Set_Is_Inlined (Defining_Unit_Name (New_Spec)); return Decl_Node; else