From: Hristian Kirtchev Date: Thu, 19 Jan 2017 12:01:01 +0000 (+0000) Subject: exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the representation-to-position... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=138fc6f10fc6b0b66123a75dfe88b1641cba5e9d;p=gcc.git exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the representation-to-position function as inlined. 2017-01-19 Hristian Kirtchev * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the representation-to-position function as inlined. * sem_cat.adb (Set_Categorization_From_Scope): Do not modify the purity of an internally generated entity if it has been explicitly marked as pure for optimization purposes. * exp_aggr.adb: Minor reformatting. From-SVN: r244624 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 4782ab70910..29fdcfdaf11 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,12 @@ +2017-01-19 Hristian Kirtchev + + * exp_ch3.adb (Expand_Freeze_Enumeration_Type): Mark the + representation-to-position function as inlined. + * sem_cat.adb (Set_Categorization_From_Scope): Do not modify + the purity of an internally generated entity if it has been + explicitly marked as pure for optimization purposes. + * exp_aggr.adb: Minor reformatting. + 2017-01-19 Javier Miranda * exp_ch6.adb (Expand_Call): Remove side effects on diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb index 81134024993..96853395095 100644 --- a/gcc/ada/exp_aggr.adb +++ b/gcc/ada/exp_aggr.adb @@ -6756,9 +6756,9 @@ package body Exp_Aggr is elsif Is_Derived_Type (Typ) then - -- For untagged types, non-stored discriminants are replaced - -- with stored discriminants, which are the ones that gigi uses - -- to describe the type and its components. + -- For untagged types, non-stored discriminants are replaced with + -- stored discriminants, which are the ones that gigi uses to + -- describe the type and its components. Generate_Aggregate_For_Derived_Type : declare Constraints : constant List_Id := New_List; @@ -6782,9 +6782,8 @@ package body Exp_Aggr is while Present (Discriminant) loop New_Comp := Make_Component_Association (Loc, - Choices => - New_List (New_Occurrence_Of (Discriminant, Loc)), - + Choices => New_List ( + New_Occurrence_Of (Discriminant, Loc)), Expression => New_Copy_Tree (Get_Discriminant_Value @@ -6853,6 +6852,7 @@ package body Exp_Aggr is (Discriminant, Typ, Discriminant_Constraint (Typ))); + Append (New_Comp, Constraints); Next_Stored_Discriminant (Discriminant); end loop; @@ -6949,7 +6949,6 @@ package body Exp_Aggr is -- all the inherited components. if Is_Derived_Type (Typ) then - declare First_Comp : Node_Id; Parent_Comps : List_Id; @@ -7014,10 +7013,11 @@ package body Exp_Aggr is elsif Tagged_Type_Expansion then declare Tag_Name : constant Node_Id := - New_Occurrence_Of (First_Tag_Component (Typ), Loc); + New_Occurrence_Of + (First_Tag_Component (Typ), Loc); Typ_Tag : constant Entity_Id := RTE (RE_Tag); Conv_Node : constant Node_Id := - Unchecked_Convert_To (Typ_Tag, Tag_Value); + Unchecked_Convert_To (Typ_Tag, Tag_Value); begin Set_Etype (Conv_Node, Typ_Tag); @@ -7040,8 +7040,8 @@ package body Exp_Aggr is begin Aggr := N; while Present (Parent (Aggr)) - and then Nkind_In (Parent (Aggr), N_Component_Association, - N_Aggregate) + and then Nkind_In (Parent (Aggr), N_Aggregate, + N_Component_Association) loop Aggr := Parent (Aggr); end loop; @@ -7081,8 +7081,8 @@ package body Exp_Aggr is -- aggregates for C++ imported types must be expanded. if Ada_Version >= Ada_2005 and then Is_Limited_View (Typ) then - if not Nkind_In (Parent (N), N_Object_Declaration, - N_Component_Association) + if not Nkind_In (Parent (N), N_Component_Association, + N_Object_Declaration) then Convert_To_Assignments (N, Typ); diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index bae35be45fe..0acd94f1ab9 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -4590,7 +4590,7 @@ package body Exp_Ch3 is Discrete_Subtype_Definitions => New_List ( Make_Subtype_Indication (Loc, Subtype_Mark => New_Occurrence_Of (Standard_Natural, Loc), - Constraint => + Constraint => Make_Range_Constraint (Loc, Range_Expression => Make_Range (Loc, @@ -4810,6 +4810,8 @@ package body Exp_Ch3 is Set_Debug_Info_Off (Fent); end if; + Set_Is_Inlined (Fent); + exception when RE_Not_Available => return; diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb index 7bc75b1e6d8..a84c0ea475f 100644 --- a/gcc/ada/sem_cat.adb +++ b/gcc/ada/sem_cat.adb @@ -777,8 +777,13 @@ package body Sem_Cat is Specification : Node_Id := Empty; begin - Set_Is_Pure - (E, Is_Pure (Scop) and then Is_Library_Level_Entity (E)); + -- Do not modify the purity of an internally generated entity if it has + -- been explicitly marked as pure for optimization purposes. + + if not Has_Pragma_Pure_Function (E) then + Set_Is_Pure + (E, Is_Pure (Scop) and then Is_Library_Level_Entity (E)); + end if; if not Is_Remote_Call_Interface (E) then if Ekind (E) in Subprogram_Kind then