From 885e570af17aed5736e4fd92347ca05e3d552926 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 1 Aug 2014 12:22:23 +0200 Subject: [PATCH] [multiple changes] 2014-08-01 Robert Dewar * sem_prag.adb: Minor reformatting. * s-regpat.adb: Minor reformatting. * sem_ch3.adb (Analyze_Object_Declaration): Do not set Treat_As_Volatile on constants. 2014-08-01 Tristan Gingold * exp_ch9.adb (Make_Task_Create_Call): Improve error message. 2014-08-01 Ed Schonberg * sem_ch10.adb (Analyze_Compilation_Unit): Do not place a warning on a with_clause created for the renaming of a parent unit in an explicit with_clause. From-SVN: r213448 --- gcc/ada/ChangeLog | 17 +++++++++++++++++ gcc/ada/exp_ch9.adb | 14 ++++++++++++++ gcc/ada/s-regpat.adb | 23 +++++++++++++++-------- gcc/ada/sem_ch10.adb | 6 +++++- gcc/ada/sem_ch3.adb | 9 ++++++--- gcc/ada/sem_prag.adb | 3 +-- 6 files changed, 58 insertions(+), 14 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 7f190853be6..d5606e6a248 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,20 @@ +2014-08-01 Robert Dewar + + * sem_prag.adb: Minor reformatting. + * s-regpat.adb: Minor reformatting. + * sem_ch3.adb (Analyze_Object_Declaration): Do not set + Treat_As_Volatile on constants. + +2014-08-01 Tristan Gingold + + * exp_ch9.adb (Make_Task_Create_Call): Improve error message. + +2014-08-01 Ed Schonberg + + * sem_ch10.adb (Analyze_Compilation_Unit): Do not place a + warning on a with_clause created for the renaming of a parent + unit in an explicit with_clause. + 2014-08-01 Ed Schonberg * sem_ch13.adb (Analyze_Aspect_Specifications, case Aspect_Import): diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb index d01e849c88f..3cacc77fed3 100644 --- a/gcc/ada/exp_ch9.adb +++ b/gcc/ada/exp_ch9.adb @@ -14013,6 +14013,20 @@ package body Exp_Ch9 is Ttyp := Corresponding_Concurrent_Type (Task_Rec); Tnam := Chars (Ttyp); + -- The sequential partition elaboration policy is supported only in the + -- restricted profile. + + -- This test should be in sem_ch9, not here ??? + + if Partition_Elaboration_Policy = 'S' + and then not Restricted_Profile + then + Error_Msg_N + ("sequential elaboration supported only in restricted profile", + Task_Rec); + return Make_Null_Statement (Loc); + end if; + -- Get task declaration. In the case of a task type declaration, this is -- simply the parent of the task type entity. In the single task -- declaration, this parent will be the implicit type, and we can find diff --git a/gcc/ada/s-regpat.adb b/gcc/ada/s-regpat.adb index 842b6e362c2..add78bdb4c6 100644 --- a/gcc/ada/s-regpat.adb +++ b/gcc/ada/s-regpat.adb @@ -414,9 +414,9 @@ package body System.Regpat is Flags : out Expression_Flags; IP : out Pointer); -- Parse regular expression, i.e. main body or parenthesized thing - -- Caller must absorb opening parenthesis. - -- Capturing should be set to True when we have an open parenthesis - -- from which we want the user to extra text. + -- Caller must absorb opening parenthesis. Capturing should be set to + -- True when we have an open parenthesis from which we want the user + -- to extra text. procedure Parse_Branch (Flags : out Expression_Flags; @@ -920,10 +920,13 @@ package body System.Regpat is Ender := Emit_Node (CLOSE); Emit (Character'Val (Par_No)); Link_Tail (IP, Ender); + else - -- need to keep looking after the closing parenthesis + -- Need to keep looking after the closing parenthesis + null; end if; + else Ender := Emit_Node (EOP); Link_Tail (IP, Ender); @@ -1012,14 +1015,18 @@ package body System.Regpat is begin if Parse_Pos <= Parse_End - 1 - and then Expression (Parse_Pos) = '?' - and then Expression (Parse_Pos + 1) = ':' + and then Expression (Parse_Pos) = '?' + and then Expression (Parse_Pos + 1) = ':' then Parse_Pos := Parse_Pos + 2; - -- non-capturing parenthesis + + -- Non-capturing parenthesis + Parse (True, False, New_Flags, IP); + else - -- capturing parenthesis + -- Capturing parenthesis + Parse (True, True, New_Flags, IP); Expr_Flags.Has_Width := Expr_Flags.Has_Width or else New_Flags.Has_Width; diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb index 3fe718b7262..13deef6bc49 100644 --- a/gcc/ada/sem_ch10.adb +++ b/gcc/ada/sem_ch10.adb @@ -242,7 +242,7 @@ package body Sem_Ch10 is -- on the context. Note that in contrast with the handling of private -- types, the limited view and the non-limited view of a type are treated -- as separate entities, and no entity exchange needs to take place, which - -- makes the implementation must simpler than could be feared. + -- makes the implementation much simpler than could be feared. ------------------------------ -- Analyze_Compilation_Unit -- @@ -507,11 +507,15 @@ package body Sem_Ch10 is -- Avoid checking implicitly generated with clauses, limited with -- clauses or withs that have pragma Elaborate or Elaborate_All. + -- With_clauses introduced for renamings of parent clauses are not + -- marked implicit because they need to be properly installed, but + -- they do not come from source and do not require warnings. if Nkind (Clause) = N_With_Clause and then not Implicit_With (Clause) and then not Limited_Present (Clause) and then not Elaborate_Present (Clause) + and then Comes_From_Source (Clause) then -- Package body-to-spec check diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index e9f3061adac..adbfd5011df 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -3923,10 +3923,13 @@ package body Sem_Ch3 is Set_Etype (Id, Act_T); - -- Object is marked to be treated as volatile if type is volatile and - -- we clear the Current_Value setting that may have been set above. + -- Non-constant object is marked to be treated as volatile if type is + -- volatile and we clear the Current_Value setting that may have been + -- set above. Doing so for constants isn't required and might interfere + -- with possible uses of the object as a static expression in contexts + -- incompatible with volatility (e.g. as a case-statement alternative). - if Treat_As_Volatile (Etype (Id)) then + if Ekind (Id) /= E_Constant and then Treat_As_Volatile (Etype (Id)) then Set_Treat_As_Volatile (Id); Set_Current_Value (Id, Empty); end if; diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index ea747791568..3aef37217af 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -7841,8 +7841,7 @@ package body Sem_Prag is and then Comes_From_Source (Original_Node (Expression (Parent (Def_Id)))) then - - -- Set imported flag to prevent cascaded errors. + -- Set imported flag to prevent cascaded errors Set_Is_Imported (Def_Id); -- 2.30.2