From 4277e5bb8c1537ad7072dfb5bacb6047696ff8af Mon Sep 17 00:00:00 2001 From: pmderodat Date: Thu, 9 Nov 2017 10:24:45 +0000 Subject: 2017-11-09 Jerome Lambourg * sigtramp-qnx.c: Fix obvious typo. 2017-11-09 Doug Rupp * libgnarl/s-taprop__linux.adb (Monotonic_Clock): Minor reformatting. 2017-11-09 Ed Schonberg * sem_res.adb (Resolve): If expression is an entity whose type has implicit dereference, generate reference to it, because no reference is generated for an overloaded entity during analysis, given that its identity may not be known. 2017-11-09 Javier Miranda * exp_disp.adb (Expand_Interface_Thunk): Replace substraction of offset-to-top field by addition. (Make_Secondary_DT): Initialize the offset-to-top field with a negative offset. * exp_ch3.adb (Build_Offset_To_Top_Function): Build functions that return a negative offset-to-top value. (Initialize_Tag): Invoke runtime services Set_Dynamic_Offset_To_Top and Set_Static_Offset_To_Top passing a negative offet-to-top value; initialize also the offset-to-top field with a negative offset. * libgnat/a-tags.adb (Base_Address): Displace the pointer by means of an addition since the offset-to-top field is now a negative value. (Displace): Displace the pointer to the object means of a substraction since it is now a negative value. (Set_Dynamic_Offset_to_top): Displace the pointer to the object by means of a substraction since it is now a negative value. 2017-11-09 Eric Botcazou * gnat1drv.adb (Gnat1drv): Call Errout.Finalize (Last_Call => True) before Errout.Output_Messages also in the case of compilation errors. 2017-11-09 Javier Miranda * doc/gnat_ugn/the_gnat_compilation_model.rst (Interfacing with C++ at the Class Level): Fix error interfacing with C strings. * gnat_ugn.texi: Regenerate. 2017-11-09 Jerome Lambourg * system-qnx-aarch64.ads: Fix the priority constants. * s-osinte__qnx.ads: Fix constants for handling the locking protocols and scheduling. * s-osinte__qnx.adb: New file , prevents the use of priority 0 that corresponds to an idle priority on QNX. 2017-11-09 Piotr Trojanek * sem_prag.adb, sem_util.adb, sem_elab.adb: Fix minor typos in comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254566 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_prag.adb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/ada/sem_prag.adb') diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index eae149805fa..e70ae5400c2 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -28398,8 +28398,8 @@ package body Sem_Prag is end if; end if; - -- When the item appears in the private state space of a packge, it must - -- be a part of some state declared by the said package. + -- When the item appears in the private state space of a package, it + -- must be a part of some state declared by the said package. else pragma Assert (Placement = Private_State_Space); @@ -29290,7 +29290,7 @@ package body Sem_Prag is elsif Present (Corresponding_Aspect (Prag)) then return Parent (Corresponding_Aspect (Prag)); - -- No candidate packge [body] found + -- No candidate package [body] found else return Empty; -- cgit v1.2.1 From 54a4cafdfd9ca8df94c3a49c87f77e466f8c2823 Mon Sep 17 00:00:00 2001 From: pmderodat Date: Thu, 9 Nov 2017 11:13:49 +0000 Subject: gcc/ada/ 2017-11-09 Arnaud Charlet * gnat1drv.adb (Adjust_Global_Switches): Suppress warnings in codepeer mode here unless -gnateC is specified. * switch-c.adb (Scan_Front_End_Switches): Do not suppress warnings with -gnatC here. 2017-11-09 Piotr Trojanek * lib-writ.adb (Write_ALI): Remove processing of the frontend xrefs as part of the ALI writing; they are now processed directly from memory when requested by the backend. * lib-xref.ads (Collect_SPARK_Xrefs): Remove. (Iterate_SPARK_Xrefs): New routine for iterating over frontend xrefs. * lib-xref-spark_specific.adb (Traverse_Compilation_Unit): Remove. (Add_SPARK_File): Remove. (Add_SPARK_Xref): Refactored from removed code; filters xref entries that are trivially uninteresting to the SPARK backend. * spark_xrefs.ads: Remove code that is no longer needed. * spark_xrefs.adb (dspark): Adapt to use Iterate_SPARK_Xrefs. 2017-11-09 Hristian Kirtchev * sem_elab.adb: Update the documentation on adding a new elaboration schenario. Add new hash table Recorded_Top_Level_Scenarios. (Is_Check_Emitting_Scenario): Removed. (Is_Recorded_Top_Level_Scenario): New routine. (Kill_Elaboration_Scenario): Reimplemented. (Record_Elaboration_Scenario): Mark the scenario as recorded. (Set_Is_Recorded_Top_Level_Scenario): New routine. (Update_Elaboration_Scenario): Reimplemented. * sinfo.adb (Is_Recorded_Scenario): Removed. (Set_Is_Recorded_Scenario): Removed. * sinfo.ads: Remove attribute Is_Recorded_Scenario along with occurrences in nodes. (Is_Recorded_Scenario): Removed along with pragma Inline. (Set_Is_Recorded_Scenario): Removed along with pragma Inline. 2017-11-09 Piotr Trojanek * sem_prag.adb (Analyze_Part_Of): Change "designate" to "denote" in error message. 2017-11-09 Justin Squirek * sem_res.adb (Resolve_Allocator): Add warning messages corresponding to the allocation of an anonymous access-to-controlled object. gcc/testsuite/ 2017-11-09 Hristian Kirtchev * gnat.dg/elab3.adb, gnat.dg/elab3.ads, gnat.dg/elab3_pkg.adb, gnat.dg/elab3_pkg.ads: New testcase. 2017-11-09 Pierre-Marie de Rodat * gnat.dg/controlled2.adb, gnat.dg/controlled4.adb, gnat.dg/finalized.adb: Disable the new warning from GNAT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254568 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_prag.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/ada/sem_prag.adb') diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index e70ae5400c2..0f6223e1587 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -3327,7 +3327,7 @@ package body Sem_Prag is elsif Placement = Private_State_Space then if Scope (Encap_Id) /= Pack_Id then SPARK_Msg_NE - ("indicator Part_Of must designate an abstract state of " + ("indicator Part_Of must denote an abstract state of " & "package & (SPARK RM 7.2.6(2))", Indic, Pack_Id); Error_Msg_Name_1 := Chars (Pack_Id); SPARK_Msg_NE -- cgit v1.2.1 From c70806b05a68a2803a00f64c39a9f4eb0dc4db73 Mon Sep 17 00:00:00 2001 From: pmderodat Date: Thu, 9 Nov 2017 11:24:53 +0000 Subject: 2017-11-09 Piotr Trojanek * sem_prag.adb (Analyze_Part_Of): Reword error message. (Get_SPARK_Mode_Type): Do not raise Program_Error in case pragma SPARK_Mode appears with an illegal mode, treat this as a non-existent mode. 2017-11-09 Ed Schonberg * sem_ch4.adb (Analyze_Call): Reject a call to a function that returns a limited view of a type T declared in unit U1, when the function is declared in another unit U2 and the call appears in a procedure within another unit. 2017-11-09 Justin Squirek * sem_ch8.adb (Analyze_Use_Package): Force installation of use_clauses when processing generic instances. 2017-11-09 Bob Duff * namet.ads, namet.adb (Valid_Name_Id): New subtype that excludes Error_Name and No_Name. Use this (versus Name_Id) to indicate which objects can have those special values. Valid_Name_Id could usefully be used all over the compiler front end, but that's too much trouble for now. If we did that, we might want to rename: Name_Id --> Optional_Name_Id, Valid_Name_Id --> Name_Id. For parameters of type Valid_Name_Id, remove some redundant tests, including the ones found by CodePeer. Use Is_Valid_Name instead of membership test when appropriate. (Error_Name_Or_No_Name): Delete this; it's no longer needed. * sem_ch2.adb (Analyze_Identifier): Use "not Is_Valid_Name" instead of "in Error_Name_Or_No_Name". (Check_Parameterless_Call): Use "not Is_Valid_Name" instead of "in Error_Name_Or_No_Name". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254569 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_prag.adb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gcc/ada/sem_prag.adb') diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 0f6223e1587..596f306af3d 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -3287,8 +3287,8 @@ package body Sem_Prag is if not Is_Child_Or_Sibling (Pack_Id, Scope (Encap_Id)) then SPARK_Msg_NE - ("indicator Part_Of must denote abstract state or public " - & "descendant of & (SPARK RM 7.2.6(3))", + ("indicator Part_Of must denote abstract state of & " + & "or of its public descendant (SPARK RM 7.2.6(3))", Indic, Parent_Unit); return; @@ -3301,8 +3301,8 @@ package body Sem_Prag is else SPARK_Msg_NE - ("indicator Part_Of must denote abstract state or public " - & "descendant of & (SPARK RM 7.2.6(3))", + ("indicator Part_Of must denote abstract state of & " + & "or of its public descendant (SPARK RM 7.2.6(3))", Indic, Parent_Unit); return; end if; @@ -29364,10 +29364,11 @@ package body Sem_Prag is elsif N = Name_Off then return Off; - -- Any other argument is illegal + -- Any other argument is illegal. Assume that no SPARK mode applies to + -- avoid potential cascaded errors. else - raise Program_Error; + return None; end if; end Get_SPARK_Mode_Type; -- cgit v1.2.1 From 5bb74b9978a71f56ca61b4a8ded4a4f29b13afae Mon Sep 17 00:00:00 2001 From: pmderodat Date: Thu, 9 Nov 2017 11:33:12 +0000 Subject: 2017-11-09 Yannick Moy * binde.adb (Diagnose_Elaboration_Problem): Mark procedure No_Return. * checks.adb (Apply_Scalar_Range_Check): Rescope variable OK closer to use. Default initialize Hi, Lo. (Selected_Range_Checks): Retype Num_Checks more precisely. (Determine_Range, Determine_Range_R): Default initialize Hi_Right, Lo_Right. * contracts.adb (Process_Contract_Cases): Mark parameter Stmts as Unmodified. (Process_Postconditions): Mark parameter Stmts as Unmodified. * exp_attr.adb (Expand_Loop_Entry_Attribute): Default initialize Blk. * exp_ch4.adb (Expand_N_Allocator): Default initialize Typ. (Expand_Concatenate): Default initialize High_Bound. (Optimize_Length_Comparison): Default initialize Ent, Index. * exp_ch5.adb (Expand_Predicated_Loop): Default initialize L_Hi and L_Lo. * exp_ch6.adb (Expand_N_Extended_Return_Statement): Default initialize Return_Stmt. * exp_ch9.adb (Expand_Entry_Barrier): Default initialize Func_Body and remove pragma Warnings(Off). * exp_imgv.adb (Expand_Image_Attribute): Default initialize Tent. * exp_util.adb (Find_Interface_Tag): Default initialize AI_Tag. * freeze.adb (Check_Component_Storage_Order): Default initialize Comp_Byte_Aligned rather than silencing messages with pragma Warnings(Off), which does not work for CodePeer initialization messages, and given that here the possible read of an unitialized value depends on a proper use of parameters by the caller. * inline.adb (Expand_Inlined_Call): Default initialize Lab_Decl, Targ. * sem_ch12.adb (Build_Operator_Wrapper): Default initialize Expr. * sem_ch3.adb (Build_Derived_Array_Type): Default initialize Implicit_Base. * sem_ch4.adb (List_Operand_Interps): Default initialize Nam and remove pragma Warnings(Off). (Analyze_Case_Expression): Rescope checking block within branch where Others_Present is set by the call to Check_Choices. * sem_ch5.adb (Analyze_Assignment): Default initialize Save_Full_Analysis. * sem_ch6.adb (Analyze_Function_Return): Default initialize Obj_Decl, and restructure code to defend against previous errors, so that, in that case, control does not flow to the elsif condition which read an uninitialized Obj_Decl. * sem_ch9.adb (Analyze_Requeue): Default initialize Synch_Type. (Check_Interfaces): Default initialize Full_T_Ifaces and Priv_T_Ifaces, which seem to be left uninitialized and possibly read in some cases. * sem_dim.adb (Analyze_Aspect_Dimension_System): Retype Position more precisely. This requires to exchange the test for exiting in case of too many positions and the increment to Position, inside the loop. * sem_eval.adb (Eval_Concatenation): Default initialize Folded_Val, which cannot be read uninitialized, but the reasons for that are quite subtle. * sem_intr.adb (Check_Intrinsic_Call): Default initialize Rtyp. * sem_prag.adb (Collect_Subprogram_Inputs_Outputs): Default initialize Spec_Id. * sem_res.adb (Make_Call_Into_Operator): Default initialize Opnd_Type, and test for presence of non-null Opnd_Type before testing its scope, in a test which would read its value uninitialized, and is very rarely exercized (it depends on the presence of an extension of System). * sem_spark.ads: Update comment to fix name of main analysis procedure. * sem_warn.adb (Warn_On_Known_Condition): Default initialize Test_Result. * set_targ.adb (FailN): Mark procedure with No_Return. * stylesw.adb (Save_Style_Check_Options): Delete useless code to initialize all array Options to white space, as there is already code doing the same for the remaining positions in Options at the end of the procedure. 2017-11-09 Eric Botcazou * exp_ch11.adb (Possible_Local_Raise): Do not issue the warning for generic instantiations either. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254570 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_prag.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/ada/sem_prag.adb') diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 596f306af3d..78876ffbf25 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -28747,7 +28747,7 @@ package body Sem_Prag is Depends : Node_Id; Formal : Entity_Id; Global : Node_Id; - Spec_Id : Entity_Id; + Spec_Id : Entity_Id := Empty; Subp_Decl : Node_Id; Typ : Entity_Id; -- cgit v1.2.1 From d39570ea4d41c457345e5527494858872c353455 Mon Sep 17 00:00:00 2001 From: pmderodat Date: Thu, 9 Nov 2017 12:46:58 +0000 Subject: 2017-11-09 Javier Miranda * rtsfind.ads (RE_Id, RE_Unit_Table): Add RE_HT_Link. * exp_disp.adb (Make_DT): Initialize the HT_Link field of the TSD only if available. 2017-11-09 Bob Duff * exp_ch4.adb, exp_ch9.adb, exp_prag.adb, par-ch3.adb, sem_aggr.adb, sem_ch12.adb, sem_ch13.adb, sem_ch4.adb, sem_disp.adb, sem_prag.adb, sem_res.adb, sem_util.adb: Get rid of warnings about uninitialized variables. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254577 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_prag.adb | 51 ++++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 23 deletions(-) (limited to 'gcc/ada/sem_prag.adb') diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 78876ffbf25..55da40b7296 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -5817,8 +5817,8 @@ package body Sem_Prag is procedure Check_Grouping (L : List_Id) is HSS : Node_Id; - Prag : Node_Id; Stmt : Node_Id; + Prag : Node_Id := Empty; -- init to avoid warning begin -- Inspect the list of declarations or statements looking for @@ -5872,16 +5872,15 @@ package body Sem_Prag is else while Present (Stmt) loop - -- The current pragma is either the first pragma - -- of the group or is a member of the group. Stop - -- the search as the placement is legal. + -- of the group or is a member of the group. + -- Stop the search as the placement is legal. if Stmt = N then raise Stop_Search; - -- Skip group members, but keep track of the last - -- pragma in the group. + -- Skip group members, but keep track of the + -- last pragma in the group. elsif Is_Loop_Pragma (Stmt) then Prag := Stmt; @@ -11390,6 +11389,7 @@ package body Sem_Prag is SPARK_Msg_N ("expression of external state property must be " & "static", Expr); + return; end if; -- The lack of expression defaults the property to True @@ -16474,6 +16474,20 @@ package body Sem_Prag is return; end if; + -- Ada 2012 (AI05-0030): Cannot apply the implementation_kind + -- By_Protected_Procedure to the primitive procedure of a task + -- interface. + + if Chars (Arg2) = Name_By_Protected_Procedure + and then Is_Interface (Typ) + and then Is_Task_Interface (Typ) + then + Error_Pragma_Arg + ("implementation kind By_Protected_Procedure cannot be " + & "applied to a task interface primitive", Arg2); + return; + end if; + -- Procedures declared inside a protected type must be accepted elsif Ekind (Proc_Id) = E_Procedure @@ -16489,20 +16503,6 @@ package body Sem_Prag is return; end if; - -- Ada 2012 (AI05-0030): Cannot apply the implementation_kind - -- By_Protected_Procedure to the primitive procedure of a task - -- interface. - - if Chars (Arg2) = Name_By_Protected_Procedure - and then Is_Interface (Typ) - and then Is_Task_Interface (Typ) - then - Error_Pragma_Arg - ("implementation kind By_Protected_Procedure cannot be " - & "applied to a task interface primitive", Arg2); - return; - end if; - Record_Rep_Item (Proc_Id, N); end Implemented; @@ -24253,11 +24253,16 @@ package body Sem_Prag is else OK := Set_Warning_Switch (Chr); end if; - end if; - if not OK then + if not OK then + Error_Pragma_Arg + ("invalid warning switch character " & Chr, + Arg1); + end if; + + else Error_Pragma_Arg - ("invalid warning switch character " & Chr, + ("invalid wide character in warning switch ", Arg1); end if; -- cgit v1.2.1 From f7c9b330bade0cb07aa95155e46687f30ca85dd6 Mon Sep 17 00:00:00 2001 From: pmderodat Date: Thu, 9 Nov 2017 13:09:17 +0000 Subject: 2017-11-09 Ed Schonberg * sem_ch12.adb (Analyze_Generic_Package_Declaration): Handle properly the pragma Compile_Time_Error when it appears in a generic package declaration and uses an expanded name to denote the current unit. 2017-11-09 Jerome Lambourg * libgnarl/s-taprop__qnx.adb: Fix incorrect casing for pthread_self. * tracebak.c: Add support for tracebacks in QNX. 2017-11-09 Eric Botcazou * exp_aggr.adb (Aggr_Size_OK): Bump base limit from 50000 to 500000. 2017-11-09 Yannick Moy * erroutc.adb, set_targ.adb: Remove pragma Annotate for CodePeer justification. 2017-11-09 Joel Brobecker * doc/gnat_ugn/platform_specific_information.rst: Document packages needed on GNU/Linux by GNAT. * gnat_ugn.texi: Regenerate. 2017-11-09 Hristian Kirtchev * contracts.adb (Analyze_Contracts): Remove the three parameter version. This routine now only analyzes contracts and does not perform any freezing actions. (Analyze_Previous_Contracts): Removed. (Freeze_Previous_Contracts): New routine. * contracts.ads (Analyze_Previous_Contracts): Removed. (Freeze_Previous_Contracts): New routine. * sem_ch3.adb (Analyze_Declarations): Analyze the contract of an enclosing package spec regardless of whether the list denotes the visible or private declarations. Fix the removal of partial state refinements when the context is a package spec. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Freeze previous contracts. * sem_ch7.adb (Analyze_Package_Body_Helper): Freeze previous contracts. * sem_ch9.adb (Analyze_Entry_Body): Freeze previous contracts. (Analyze_Protected_Body): Freeze previous contracts. (Analyze_Task_Body): Freeze previous contracts. * sem_prag.adb: Comment reformatting. 2017-11-09 Bob Duff * libgnarl/g-thread.ads, libgnarl/g-thread.adb: (Make_Independent): Export this so users can use it without importing System.Tasking.Utilities. * libgnarl/s-tassta.adb (Vulnerable_Complete_Task): Relax assertion that fails when Make_Independent is called on a user task. * libgnarl/s-taskin.ads (Master_Of_Task): Avoid unusual capitalization style ((style) bad casing of "Master_of_Task"). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254580 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_prag.adb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gcc/ada/sem_prag.adb') diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 55da40b7296..b071aa8c892 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -217,7 +217,7 @@ package body Sem_Prag is Freeze_Id : Entity_Id); -- Subsidiary to the analysis of pragmas Contract_Cases, Part_Of, Post, and -- Pre. Emit a freezing-related error message where Freeze_Id is the entity - -- of a body which caused contract "freezing" and Contract_Id denotes the + -- of a body which caused contract freezing and Contract_Id denotes the -- entity of the affected contstruct. procedure Duplication_Error (Prag : Node_Id; Prev : Node_Id); @@ -432,7 +432,7 @@ package body Sem_Prag is -- Emit a clarification message when the case guard contains -- at least one undefined reference, possibly due to contract - -- "freezing". + -- freezing. if Errors /= Serious_Errors_Detected and then Present (Freeze_Id) @@ -447,7 +447,7 @@ package body Sem_Prag is -- Emit a clarification message when the consequence contains -- at least one undefined reference, possibly due to contract - -- "freezing". + -- freezing. if Errors /= Serious_Errors_Detected and then Present (Freeze_Id) @@ -3510,7 +3510,7 @@ package body Sem_Prag is end if; -- Emit a clarification message when the encapsulator is undefined, - -- possibly due to contract "freezing". + -- possibly due to contract freezing. if Errors /= Serious_Errors_Detected and then Present (Freeze_Id) @@ -24613,7 +24613,7 @@ package body Sem_Prag is Preanalyze_Assert_Expression (Expr, Standard_Boolean); -- Emit a clarification message when the expression contains at least - -- one undefined reference, possibly due to contract "freezing". + -- one undefined reference, possibly due to contract freezing. if Errors /= Serious_Errors_Detected and then Present (Freeze_Id) @@ -27363,7 +27363,7 @@ package body Sem_Prag is Constit_Id := Entity_Of (Constit); -- When a constituent is declared after a subprogram body - -- that caused "freezing" of the related contract where + -- that caused freezing of the related contract where -- pragma Refined_State resides, the constituent appears -- undefined and carries Any_Id as its entity. -- cgit v1.2.1