diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9fe36adafe51..ea4f6bc12cf9 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2017-01-13 Gary Dismukes <dismukes@adacore.com> + + * exp_util.adb: Minor reformatting. + +2017-01-13 Yannick Moy <moy@adacore.com> + + * exp_spark.adb: Code cleanup. + * sem_ch9.adb (Analyze_Delay_Until): Resolve + expression so that calls are identified as such inside delay + until. + 2017-01-13 Ed Schonberg <schonberg@adacore.com> * exp_util.adb (Insert_Actions): Handle Iterated_Component_Association. diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb index 10461900321c..6b355aa99c09 100644 --- a/gcc/ada/exp_spark.adb +++ b/gcc/ada/exp_spark.adb @@ -124,36 +124,28 @@ package body Exp_SPARK is Aname : constant Name_Id := Attribute_Name (N); Attr_Id : constant Attribute_Id := Get_Attribute_Id (Aname); Loc : constant Source_Ptr := Sloc (N); - - Call : Node_Id; - Expr : Node_Id; + Typ : constant Entity_Id := Etype (N); + Expr : Node_Id; begin if Attr_Id = Attribute_To_Address then - -- Extract argument to later reanalyze it in the new context + -- Extract and convert argument to expected type for call - Expr := First (Expressions (N)); - Nlists.Remove (Expr); - Set_Etype (Expr, Empty); - Set_Analyzed (Expr, False); + Expr := + Make_Type_Conversion (Loc, + Subtype_Mark => + New_Occurrence_Of (RTE (RE_Integer_Address), Loc), + Expression => Relocate_Node (First (Expressions (N)))); - -- Create the call and insert it in the tree + -- Replace attribute reference with call - Call := + Rewrite (N, Make_Function_Call (Loc, Name => New_Occurrence_Of (RTE (RE_To_Address), Loc), - Parameter_Associations => New_List ( - Expr)); - - Set_Etype (Call, Etype (N)); - Rewrite (N, Call); - - -- Reanalyze argument and call in the new context - - Analyze_And_Resolve (Expr, Rtsfind.RTE (Rtsfind.RE_Integer_Address)); - Analyze_And_Resolve (N, Etype (N)); + Parameter_Associations => New_List (Expr))); + Analyze_And_Resolve (N, Typ); end if; end Expand_SPARK_Attribute_Reference; diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 8ab95d0db5ad..e8654bc09547 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -5709,10 +5709,10 @@ package body Exp_Util is -- an association that will generate a loop, its Loop_Actions -- attribute is already initialized (see exp_aggr.adb). - -- The list of loop_actions can in turn generate additional ones, + -- The list of Loop_Actions can in turn generate additional ones, -- that are inserted before the associated node. If the associated -- node is outside the aggregate, the new actions are collected - -- at the end of the loop actions, to respect the order in which + -- at the end of the Loop_Actions, to respect the order in which -- they are to be elaborated. when N_Component_Association @@ -5731,7 +5731,7 @@ package body Exp_Util is begin -- Check whether these actions were generated by a - -- declaration that is part of the loop_ actions for + -- declaration that is part of the Loop_Actions for -- the component_association. Decl := Assoc_Node; diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 7eae247c1825..1c8145497434 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -1171,7 +1171,7 @@ package body Sem_Ch9 is Check_SPARK_05_Restriction ("delay statement is not allowed", N); Check_Restriction (No_Delay, N); Check_Potentially_Blocking_Operation (N); - Analyze (E); + Analyze_And_Resolve (E); Typ := First_Subtype (Etype (E)); if not Is_RTE (Typ, RO_CA_Time) and then