From: Arnaud Charlet Date: Tue, 14 Jun 2016 12:36:01 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a527952159edc4505c450047b57256d9c7d89d7;p=gcc.git [multiple changes] 2016-06-14 Hristian Kirtchev * sem_ch7.adb, sem_ch12.adb, freeze.adb, lib-xref.ads, exp_ch3.adb: Minor reformatting. 2016-06-14 Bob Duff * sem_elab.adb: Do nothing if the callee is intrinsic. * sinfo.ads, einfo.ads: Minor comment fixes. From-SVN: r237436 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index cedc29835b8..26b488a0809 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2016-06-14 Hristian Kirtchev + + * sem_ch7.adb, sem_ch12.adb, freeze.adb, lib-xref.ads, exp_ch3.adb: + Minor reformatting. + +2016-06-14 Bob Duff + + * sem_elab.adb: Do nothing if the callee is intrinsic. + * sinfo.ads, einfo.ads: Minor comment fixes. + 2016-06-14 Ed Schonberg * contracts.adb (Has_Null_Body): Move to sem_util, for general diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index 405455d1b0e..19e40871c97 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -2675,13 +2675,14 @@ package Einfo is -- Is_Intrinsic_Subprogram (Flag64) -- Defined in functions and procedures. It is set if a valid pragma --- Interface or Import is present for this subprogram specifying pragma --- Intrinsic. Valid means that the name and profile of the subprogram --- match the requirements of one of the recognized intrinsic subprograms --- (see package Sem_Intr for details). Note: the value of Convention for --- such an entity will be set to Convention_Intrinsic, but it is the --- setting of Is_Intrinsic_Subprogram, NOT simply having convention set --- to intrinsic, which causes intrinsic code to be generated. +-- Interface or Import is present for this subprogram specifying +-- convention Intrinsic. Valid means that the name and profile of the +-- subprogram match the requirements of one of the recognized intrinsic +-- subprograms (see package Sem_Intr for details). Note: the value of +-- Convention for such an entity will be set to Convention_Intrinsic, +-- but it is the setting of Is_Intrinsic_Subprogram, NOT simply having +-- convention set to intrinsic, which causes intrinsic code to be +-- generated. -- Is_Invariant_Procedure (Flag257) -- Defined in functions and procedures. Set for a generated invariant diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index 3213b5d56a0..7f98b91d23d 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -3700,28 +3700,28 @@ package body Exp_Ch3 is -- Recursive procedure that generates a list of checks for components -- that need it, and recurses through variant parts when present. - function Build_Component_Invariant_Call (Comp : Entity_Id) - return Node_Id; - -- Build call to invariant procedure for a record component. + function Build_Component_Invariant_Call + (Comp : Entity_Id) return Node_Id; + -- Build call to invariant procedure for a record component ------------------------------------ -- Build_Component_Invariant_Call -- ------------------------------------ - function Build_Component_Invariant_Call (Comp : Entity_Id) - return Node_Id + function Build_Component_Invariant_Call + (Comp : Entity_Id) return Node_Id is - Sel_Comp : Node_Id; - Typ : Entity_Id; Call : Node_Id; Proc : Entity_Id; + Sel_Comp : Node_Id; + Typ : Entity_Id; begin Typ := Etype (Comp); Sel_Comp := Make_Selected_Component (Loc, - Prefix => New_Occurrence_Of (Object_Entity, Loc), + Prefix => New_Occurrence_Of (Object_Entity, Loc), Selector_Name => New_Occurrence_Of (Comp, Loc)); if Is_Access_Type (Typ) then @@ -3759,13 +3759,14 @@ package body Exp_Ch3 is if Is_Access_Type (Etype (Comp)) then Call := Make_If_Statement (Loc, - Condition => + Condition => Make_Op_Ne (Loc, Left_Opnd => Make_Null (Loc), Right_Opnd => - Make_Selected_Component (Loc, - Prefix => New_Occurrence_Of (Object_Entity, Loc), - Selector_Name => New_Occurrence_Of (Comp, Loc))), + Make_Selected_Component (Loc, + Prefix => + New_Occurrence_Of (Object_Entity, Loc), + Selector_Name => New_Occurrence_Of (Comp, Loc))), Then_Statements => New_List (Call)); end if; @@ -4620,10 +4621,8 @@ package body Exp_Ch3 is Propagate_Type_Has_Flags (Base, Comp_Typ); Set_Has_Controlled_Component - (Base, Has_Controlled_Component - (Comp_Typ) - or else - Is_Controlled (Comp_Typ)); + (Base, Has_Controlled_Component (Comp_Typ) + or else Is_Controlled (Comp_Typ)); if No (Init_Proc (Base)) then diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index ff3f063113f..046fd1516a8 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -1161,11 +1161,13 @@ package body Freeze is ADC : Node_Id; Comp_ADC_Present : out Boolean) is - Encl_Base : Entity_Id; Comp_Base : Entity_Id; Comp_ADC : Node_Id; + Encl_Base : Entity_Id; Err_Node : Node_Id; + Component_Aliased : Boolean; + Comp_Byte_Aligned : Boolean; -- Set for the record case, True if Comp starts on a byte boundary -- (in which case it is allowed to have different storage order). @@ -1174,8 +1176,6 @@ package body Freeze is -- Set True when the component is a nested composite, and it does not -- have the same scalar storage order as Encl_Type. - Component_Aliased : Boolean; - begin -- Record case @@ -1226,9 +1226,9 @@ package body Freeze is Comp_Base := Underlying_Type (Comp_Base); end if; - Comp_ADC := Get_Attribute_Definition_Clause - (First_Subtype (Comp_Base), - Attribute_Scalar_Storage_Order); + Comp_ADC := + Get_Attribute_Definition_Clause + (First_Subtype (Comp_Base), Attribute_Scalar_Storage_Order); Comp_ADC_Present := Present (Comp_ADC); -- Case of record or array component: check storage order compatibility. @@ -1240,9 +1240,8 @@ package body Freeze is or else Is_Array_Type (Comp_Base) then Comp_SSO_Differs := - Reverse_Storage_Order (Encl_Base) - /= - Reverse_Storage_Order (Comp_Base); + Reverse_Storage_Order (Encl_Base) /= + Reverse_Storage_Order (Comp_Base); -- Parent and extension must have same storage order diff --git a/gcc/ada/lib-xref.ads b/gcc/ada/lib-xref.ads index 40950085a6c..a6b96767eef 100644 --- a/gcc/ada/lib-xref.ads +++ b/gcc/ada/lib-xref.ads @@ -614,9 +614,9 @@ package Lib.Xref is -- This procedure is called from Frontend to process these table entries function Has_Deferred_Reference (Ent : Entity_Id) return Boolean; - -- This function determines whether an entity has a pending reference, in - -- order to suppress premature warnings about useless assignments. See - -- comments in Analyze_Assignment in sem-ch5.adb. + -- Determine whether arbitrary entity Ent has a pending reference in order + -- to suppress premature warnings about useless assignments. See comments + -- in Analyze_Assignment in sem_ch5.adb. ----------------------------- -- SPARK Xrefs Information -- diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 6c0567ecc4d..5d5e2dd318f 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -1500,9 +1500,8 @@ package body Sem_Ch12 is -- correspond to some formal in the generic. if Nkind (Named) /= N_Others_Choice - and then - (Present (Explicit_Generic_Actual_Parameter (Named)) - or else Box_Present (Named)) + and then (Present (Explicit_Generic_Actual_Parameter (Named)) + or else Box_Present (Named)) then Num_Actuals := Num_Actuals + 1; end if; diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index bb475890049..8c318fddc73 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -2586,7 +2586,7 @@ package body Sem_Ch7 is (Priv, Finalize_Storage_Only (Base_Type (Full))); Propagate_Type_Has_Flags - (Priv, Base_Type (Full)); + (Priv, Base_Type (Full)); Set_Has_Controlled_Component (Priv, Has_Controlled_Component (Base_Type (Full))); diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb index 2b2747e02c0..783f6dda206 100644 --- a/gcc/ada/sem_elab.adb +++ b/gcc/ada/sem_elab.adb @@ -641,6 +641,13 @@ package body Sem_Elab is return; end if; + -- Intrinsics such as instances of Unchecked_Deallocation do not have + -- any body, so elaboration checking is not needed, and would be wrong. + + if Is_Intrinsic_Subprogram (E) then + return; + end if; + -- Proceed with check Ent := E; diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index d27cb734fe2..4e8d51a41ae 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -4119,7 +4119,7 @@ package Sinfo is -- treated as though it were Empty) if No_Initialization is set True. -------------------------------------- - -- 4.5 Short Circuit Control Forms -- + -- 4.5 Short-Circuit Control Forms -- -------------------------------------- -- EXPRESSION ::= @@ -7677,7 +7677,7 @@ package Sinfo is ----------------------------- -- This node is created by the analyzer/expander to handle some - -- expansion cases, notably short circuit forms where there are + -- expansion cases, notably short-circuit forms where there are -- actions associated with the right-hand side operand. -- The N_Expression_With_Actions node represents an expression with @@ -7884,17 +7884,15 @@ package Sinfo is -- same as the type of the subexpression which it replaces. -- If Condition is empty, then the raise is unconditional. If the - -- Condition field is non-empty, it is a boolean expression which - -- is first evaluated, and the exception is raised only if the - -- value of the expression is True. In the unconditional case, the - -- creation of this node is usually accompanied by a warning message - -- error. The creation of this node will usually be accompanied by a - -- message (unless it appears within the right operand of a short - -- circuit form whose left argument is static and decisively - -- eliminates elaboration of the raise operation. The condition field - -- can ONLY be present when the node is used as a statement form, it - -- may NOT be present in the case where the node appears within an - -- expression. + -- Condition field is non-empty, it is a boolean expression which is + -- first evaluated, and the exception is raised only if the value of the + -- expression is True. In the unconditional case, the creation of this + -- node is usually accompanied by a warning message (unless it appears + -- within the right operand of a short-circuit form whose left argument + -- is static and decisively eliminates elaboration of the raise + -- operation). The condition field can ONLY be present when the node is + -- used as a statement form; it must NOT be present in the case where + -- the node appears within an expression. -- The exception is generated with a message that contains the -- file name and line number, and then appended text. The Reason