aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-31 11:27:37 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-31 11:27:37 +0200
commitb87897272f39da4bb0fb15bf275f18f5411d1915 (patch)
treecfeb1fa47dde723b03a38b0ebdfac2394578e9a3
parent680fba0932753037dd955a7266a450f5800bc765 (diff)
downloadgcc-b87897272f39da4bb0fb15bf275f18f5411d1915.zip
gcc-b87897272f39da4bb0fb15bf275f18f5411d1915.tar.gz
gcc-b87897272f39da4bb0fb15bf275f18f5411d1915.tar.bz2
[multiple changes]
2011-08-31 Matthew Heaney <heaney@adacore.com> * a-rbtgbo.adb (Clear_Tree): Assert representation invariant for lock status. 2011-08-31 Ed Schonberg <schonberg@adacore.com> * sem_ch5.adb: Set kind of loop parameter properly, to preserve all errors in B tests. 2011-08-31 Jose Ruiz <ruiz@adacore.com> * 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
-rw-r--r--gcc/ada/ChangeLog21
-rw-r--r--gcc/ada/a-rbtgbo.adb11
-rw-r--r--gcc/ada/sem_ch13.adb10
-rw-r--r--gcc/ada/sem_ch5.adb6
-rw-r--r--gcc/ada/sem_ch9.adb3
5 files changed, 41 insertions, 10 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 3240bcd..6ced910 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,24 @@
+2011-08-31 Matthew Heaney <heaney@adacore.com>
+
+ * a-rbtgbo.adb (Clear_Tree): Assert representation invariant for lock
+ status.
+
+2011-08-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch5.adb: Set kind of loop parameter properly, to preserve all
+ errors in B tests.
+
+2011-08-31 Jose Ruiz <ruiz@adacore.com>
+
+ * 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 <dewar@adacore.com>
* 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 f420438..a2590e9 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 787d564..a4b1024 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 f8f0039..50c9bb6 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 86a8fe6..cdac2f7 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);