From: Arnaud Charlet Date: Fri, 31 Oct 2014 11:09:39 +0000 (+0100) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2ef051289c77160d87d20f11c27d2ea53bf75861;p=gcc.git [multiple changes] 2014-10-31 Eric Botcazou * inline.adb (Check_And_Split_Unconstrained_Function): Do not test for the presence of nested subprograms. 2014-10-31 Ed Schonberg * aspects.ads, aspects.adb: Add aspect Default_Storage_Pool. * sem_ch13.adb (Analyze_One_Aspect): Generate pragma for aspect Default_Storage_Pool. From-SVN: r216959 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index eb8949ca10a..bb1854628c2 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2014-10-31 Eric Botcazou + + * inline.adb (Check_And_Split_Unconstrained_Function): Do not + test for the presence of nested subprograms. + +2014-10-31 Ed Schonberg + + * aspects.ads, aspects.adb: Add aspect Default_Storage_Pool. + * sem_ch13.adb (Analyze_One_Aspect): Generate pragma for aspect + Default_Storage_Pool. + 2014-10-31 Eric Botcazou * sem_ch6.adb: Remove obsolete comment. diff --git a/gcc/ada/aspects.adb b/gcc/ada/aspects.adb index ee8e8b831c8..6e12c3c80e5 100644 --- a/gcc/ada/aspects.adb +++ b/gcc/ada/aspects.adb @@ -511,6 +511,7 @@ package body Aspects is Aspect_Default_Component_Value => Aspect_Default_Component_Value, Aspect_Default_Initial_Condition => Aspect_Default_Initial_Condition, Aspect_Default_Iterator => Aspect_Default_Iterator, + Aspect_Default_Storage_Pool => Aspect_Default_Storage_Pool, Aspect_Default_Value => Aspect_Default_Value, Aspect_Depends => Aspect_Depends, Aspect_Dimension => Aspect_Dimension, diff --git a/gcc/ada/aspects.ads b/gcc/ada/aspects.ads index 50bada041f0..3ca077c986d 100644 --- a/gcc/ada/aspects.ads +++ b/gcc/ada/aspects.ads @@ -88,6 +88,7 @@ package Aspects is Aspect_Default_Component_Value, Aspect_Default_Initial_Condition, -- GNAT Aspect_Default_Iterator, + Aspect_Default_Storage_Pool, Aspect_Default_Value, Aspect_Depends, -- GNAT Aspect_Dimension, -- GNAT @@ -314,6 +315,7 @@ package Aspects is Aspect_Default_Component_Value => Expression, Aspect_Default_Initial_Condition => Optional_Expression, Aspect_Default_Iterator => Name, + Aspect_Default_Storage_Pool => Expression, Aspect_Default_Value => Expression, Aspect_Depends => Expression, Aspect_Dimension => Expression, @@ -401,6 +403,7 @@ package Aspects is Aspect_Default_Component_Value => Name_Default_Component_Value, Aspect_Default_Initial_Condition => Name_Default_Initial_Condition, Aspect_Default_Iterator => Name_Default_Iterator, + Aspect_Default_Storage_Pool => Name_Default_Storage_Pool, Aspect_Default_Value => Name_Default_Value, Aspect_Depends => Name_Depends, Aspect_Dimension => Name_Dimension, @@ -616,6 +619,7 @@ package Aspects is Aspect_Constant_Indexing => Always_Delay, Aspect_CPU => Always_Delay, Aspect_Default_Iterator => Always_Delay, + Aspect_Default_Storage_Pool => Always_Delay, Aspect_Default_Value => Always_Delay, Aspect_Default_Component_Value => Always_Delay, Aspect_Discard_Names => Always_Delay, diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index c06e5cb429c..7f0d54b7944 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -1894,44 +1894,6 @@ package body Inline is return; end if; - -- Do not inline any subprogram that contains nested subprograms, - -- since the backend inlining circuit seems to generate uninitialized - -- references in this case. We know this happens in the case of front - -- end ZCX support, but it also appears it can happen in other cases - -- as well. The backend often rejects attempts to inline in the case - -- of nested procedures anyway, so little if anything is lost by this. - -- Note that this is test is for the benefit of the back-end. There - -- is a separate test for front-end inlining that also rejects nested - -- subprograms. - - -- Do not do this test if errors have been detected, because in some - -- error cases, this code blows up, and we don't need it anyway if - -- there have been errors, since we won't get to the linker anyway. - - declare - P_Ent : Node_Id; - - begin - P_Ent := Body_Id; - loop - P_Ent := Scope (P_Ent); - exit when No (P_Ent) or else P_Ent = Standard_Standard; - - if Is_Subprogram (P_Ent) then - Set_Is_Inlined (P_Ent, False); - - if Comes_From_Source (P_Ent) - and then (Has_Pragma_Inline (P_Ent)) - then - Cannot_Inline - ("cannot inline& (nested subprogram)?", N, P_Ent, - Is_Serious => True); - return; - end if; - end if; - end loop; - end; - -- No action needed in stubs since the attribute Body_To_Inline -- is not available diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 2546533432c..86f70d01b2f 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -2236,6 +2236,20 @@ package body Sem_Ch13 is Insert_Pragma (Aitem); goto Continue; + -- Default_Storage_Pool + + when Aspect_Default_Storage_Pool => + Make_Aitem_Pragma + (Pragma_Argument_Associations => New_List ( + Make_Pragma_Argument_Association (Loc, + Expression => Relocate_Node (Expr))), + Pragma_Name => + Name_Default_Storage_Pool); + + Decorate (Aspect, Aitem); + Insert_Pragma (Aitem); + goto Continue; + -- Depends -- Aspect Depends is never delayed because it is equivalent to @@ -8693,6 +8707,9 @@ package body Sem_Ch13 is when Aspect_Default_Component_Value => T := Component_Type (Entity (ASN)); + when Aspect_Default_Storage_Pool => + T := Class_Wide_Type (RTE (RE_Root_Storage_Pool)); + -- Default_Value is resolved with the type entity in question when Aspect_Default_Value =>