diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b187ef1d04b..b849645a49d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2016-04-20 Ed Schonberg + + * sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute): + New predicate to determine that in a context with full run-time, + a function call is an expansion of a reference to attribute + Priority. + * sem_ch5.adb (Analyze_Function_Call): use it. + * exp_ch5.adb (Expand_N_Subprogram_Call): use it. + 2016-04-20 Hristian Kirtchev * einfo.adb Flag286 is now used as Is_Exception_Handler. diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb index d7a0d9ed6f2..9f9c832ac47 100644 --- a/gcc/ada/exp_ch5.adb +++ b/gcc/ada/exp_ch5.adb @@ -1695,12 +1695,8 @@ package body Exp_Ch5 is -- previously expanded into a call to the Get_Ceiling run-time -- subprogram. In restricted profiles this is not available. - if Nkind (Ent) = N_Function_Call - and then not Configurable_Run_Time_Mode - and then (Entity (Name (Ent)) = RTE (RE_Get_Ceiling) - or else - Entity (Name (Ent)) = RTE (RO_PE_Get_Ceiling)) - then + if Is_Expanded_Priority_Attribute (Ent) then + -- Look for the enclosing concurrent type Conctyp := Current_Scope; diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 1a9692cbdb6..71ab4d0f26e 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -41,7 +41,6 @@ with Nmake; use Nmake; with Opt; use Opt; with Restrict; use Restrict; with Rident; use Rident; -with Rtsfind; use Rtsfind; with Sem; use Sem; with Sem_Aux; use Sem_Aux; with Sem_Case; use Sem_Case; @@ -440,11 +439,7 @@ package body Sem_Ch5 is -- objects have been previously expanded into calls to the -- Get_Ceiling run-time subprogram. - or else - (Nkind (Ent) = N_Function_Call - and then (Entity (Name (Ent)) = RTE (RE_Get_Ceiling) - or else - Entity (Name (Ent)) = RTE (RO_PE_Get_Ceiling))) + or else Is_Expanded_Priority_Attribute (Ent) then -- The enclosing subprogram cannot be a protected function diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 5f2722d06df..eaa2429c174 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -12123,6 +12123,19 @@ package body Sem_Util is and then Nkind (Unit_Declaration_Node (Id)) = N_Entry_Declaration; end Is_Entry_Declaration; + ------------------------------------ + -- Is_Expanded_Priority_Attribute -- + ------------------------------------ + + function Is_Expanded_Priority_Attribute (E : Entity_Id) return Boolean is + begin + return + Nkind (E) = N_Function_Call + and then not Configurable_Run_Time_Mode + and then (Entity (Name (E)) = RTE (RE_Get_Ceiling) + or else Entity (Name (E)) = RTE (RO_PE_Get_Ceiling)); + end Is_Expanded_Priority_Attribute; + ---------------------------- -- Is_Expression_Function -- ---------------------------- diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 36cae436f04..93fadaacab4 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -1376,6 +1376,11 @@ package Sem_Util is function Is_Entry_Declaration (Id : Entity_Id) return Boolean; -- Determine whether entity Id is the spec entity of an entry [family] + function Is_Expanded_Priority_Attribute (E : Entity_Id) return Boolean; + -- Check whether a function in a call is an expanded priority attribute, + -- which is transformed into an Rtsfind call to Get_Ceiling. This expansion + -- does not take place in a configurable runtime. + function Is_Expression_Function (Subp : Entity_Id) return Boolean; -- Determine whether subprogram [body] Subp denotes an expression function