From b87897272f39da4bb0fb15bf275f18f5411d1915 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 31 Aug 2011 11:27:37 +0200 Subject: [PATCH] [multiple changes] 2011-08-31 Matthew Heaney * a-rbtgbo.adb (Clear_Tree): Assert representation invariant for lock status. 2011-08-31 Ed Schonberg * sem_ch5.adb: Set kind of loop parameter properly, to preserve all errors in B tests. 2011-08-31 Jose Ruiz * sem_ch13.adb (Analyze_Aspect_Specifications): For the Priority and Interrupt_Priority aspects, force the analysis of the aspect expression (when building the equivalent pragma). Otherwise, its analysis is done too late, after the task or protected object has been created. * sem_ch9.adb (Analyze_Single_Protected_Declaration, Analyze_Single_Task_Declaration): Remove the code to move the aspects to the object declaration because they are needed in the type declaration. From-SVN: r178370 --- gcc/ada/ChangeLog | 21 +++++++++++++++++++++ gcc/ada/a-rbtgbo.adb | 11 ++++++----- gcc/ada/sem_ch13.adb | 10 +++++++++- gcc/ada/sem_ch5.adb | 6 +++++- gcc/ada/sem_ch9.adb | 3 --- 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3240bcdfda5..6ced91054a7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,24 @@ +2011-08-31 Matthew Heaney + + * a-rbtgbo.adb (Clear_Tree): Assert representation invariant for lock + status. + +2011-08-31 Ed Schonberg + + * sem_ch5.adb: Set kind of loop parameter properly, to preserve all + errors in B tests. + +2011-08-31 Jose Ruiz + + * sem_ch13.adb (Analyze_Aspect_Specifications): For the Priority and + Interrupt_Priority aspects, force the analysis of the aspect expression + (when building the equivalent pragma). Otherwise, its analysis is done + too late, after the task or protected object has been created. + * sem_ch9.adb (Analyze_Single_Protected_Declaration, + Analyze_Single_Task_Declaration): Remove the code to move the aspects + to the object declaration because they are needed in the type + declaration. + 2011-08-31 Robert Dewar * exp_ch5.adb, exp_ch7.ads, sem_ch5.adb, put_scos.adb, s-rannum.adb, diff --git a/gcc/ada/a-rbtgbo.adb b/gcc/ada/a-rbtgbo.adb index f420438efac..a2590e93390 100644 --- a/gcc/ada/a-rbtgbo.adb +++ b/gcc/ada/a-rbtgbo.adb @@ -59,15 +59,16 @@ package body Ada.Containers.Red_Black_Trees.Generic_Bounded_Operations is "attempt to tamper with cursors (container is busy)"; end if; + -- The lock status (which monitors "element tampering") always implies + -- that the busy status (which monitors "cursor tampering") is set too; + -- this is a representation invariant. Thus if the busy bit is not set, + -- then the lock bit must not be set either. + pragma Assert (Tree.Lock = 0); + Tree.First := 0; Tree.Last := 0; Tree.Root := 0; Tree.Length := 0; - - -- Why are the following commented out with no explanation ??? - -- Tree.Busy - -- Tree.Lock - Tree.Free := -1; end Clear_Tree; diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 787d564ed6e..a4b1024e3c9 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -1164,7 +1164,9 @@ package body Sem_Ch13 is Pragma_Identifier => Make_Identifier (Sloc (Id), Pname), Pragma_Argument_Associations => - New_List (Relocate_Node (Expr))); + New_List + (Make_Pragma_Argument_Association + (Sloc (Id), Expression => Relocate_Node (Expr)))); Set_From_Aspect_Specification (Aitem, True); @@ -1526,6 +1528,12 @@ package body Sem_Ch13 is end if; Prepend (Aitem, To => L); + + -- Analyze rewritten pragma. Otherwise, its + -- analysis is done too late, after the task or + -- protected object has been created. + + Analyze (Aitem); end; -- For all other cases, insert in sequence diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index f8f00395c48..50c9bb68f97 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1965,7 +1965,6 @@ package body Sem_Ch5 is begin Enter_Name (Id); - Set_Ekind (Id, E_Constant); -- We always consider the loop variable to be referenced, since -- the loop may be used just for counting purposes. @@ -2058,6 +2057,11 @@ package body Sem_Ch5 is Analyze (DS); end if; + -- Set kind of loop parameter, which may be used in + -- the subsequent analysis of of the condition in a + -- quantified expression. + + Set_Ekind (Id, E_Loop_Parameter); return; end; diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index 86a8fe6f483..cdac2f787d3 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -23,7 +23,6 @@ -- -- ------------------------------------------------------------------------------ -with Aspects; use Aspects; with Atree; use Atree; with Checks; use Checks; with Einfo; use Einfo; @@ -1726,7 +1725,6 @@ package body Sem_Ch9 is Defining_Identifier => O_Name, Object_Definition => Make_Identifier (Loc, Chars (T))); - Move_Aspects (N, O_Decl); Rewrite (N, T_Decl); Insert_After (N, O_Decl); Mark_Rewrite_Insertion (O_Decl); @@ -1796,7 +1794,6 @@ package body Sem_Ch9 is Defining_Identifier => O_Name, Object_Definition => Make_Identifier (Loc, Chars (T))); - Move_Aspects (N, O_Decl); Rewrite (N, T_Decl); Insert_After (N, O_Decl); Mark_Rewrite_Insertion (O_Decl); -- 2.30.2