summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-09-02 08:48:53 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-09-02 08:48:53 +0200
commit2ba1a7c7e8de1443bc460914dc247b63c9014ac6 (patch)
tree421c3d1e172072c112f9f90e3f03cd0f2ed80d42 /gcc
parent8b875290b18fadaac0d10ec6d223dc8391367e67 (diff)
downloadgcc-2ba1a7c7e8de1443bc460914dc247b63c9014ac6.tar.gz
[multiple changes]
2011-09-02 Jose Ruiz <ruiz@adacore.com> * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB, Initialize): Define and initialize the mutex attributes and condition variable attributes locally. 2011-09-02 Vincent Celier <celier@adacore.com> * prj-nmsc.adb (Check_File): Mark as Locally_Removed a naming exception replaced in an extending project. (Check_Object): No error when the other source is locally removed. 2011-09-02 Yannick Moy <moy@adacore.com> * exp_ch6.adb (Is_Build_In_Place_Function_Call): in Alfa mode, allow unresolved calls. From-SVN: r178432
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog17
-rw-r--r--gcc/ada/exp_ch6.adb12
-rw-r--r--gcc/ada/prj-nmsc.adb3
-rw-r--r--gcc/ada/s-taprop-linux.adb44
4 files changed, 58 insertions, 18 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 18ebefdfaf8..50355a76953 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,20 @@
+2011-09-02 Jose Ruiz <ruiz@adacore.com>
+
+ * s-taprop-linux.adb (Initialize_Lock, Initialize_TCB,
+ Initialize): Define and initialize the
+ mutex attributes and condition variable attributes locally.
+
+2011-09-02 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Check_File): Mark as Locally_Removed a naming
+ exception replaced in an extending project.
+ (Check_Object): No error when the other source is locally removed.
+
+2011-09-02 Yannick Moy <moy@adacore.com>
+
+ * exp_ch6.adb (Is_Build_In_Place_Function_Call): in Alfa mode, allow
+ unresolved calls.
+
2011-08-31 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/Makefile.in: Clean up handling of x86 and x86-64
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index b156a4f0934..d1632db490d 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -6084,7 +6084,7 @@ package body Exp_Ch6 is
Build_Protected_Subprogram_Call (N,
Name => New_Occurrence_Of (Subp, Sloc (N)),
- Rec => Convert_Concurrent (Rec, Etype (Rec)),
+ Rec => Convert_Concurrent (Rec, Etype (Rec)),
External => True);
else
@@ -6797,6 +6797,16 @@ package body Exp_Ch6 is
elsif Nkind (Name (Exp_Node)) = N_Explicit_Dereference then
Function_Id := Etype (Name (Exp_Node));
+
+ -- In Alfa mode, protected subprogram calls are not expanded, so that
+ -- we may end up with a call that is neither resolved to an entity,
+ -- nor an indirect call.
+
+ elsif Alfa_Mode then
+ return False;
+
+ else
+ raise Program_Error;
end if;
return Is_Build_In_Place_Function (Function_Id);
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 1858c5d8133..92ae7851fe0 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -7588,8 +7588,9 @@ package body Prj.Nmsc is
-- the same file it is expected that it has the same object)
if Source /= No_Source
+ and then Source.Replaced_By = No_Source
and then Source.Path /= Src.Path
- and then Src.Project = Source.Project
+ and then Is_Extending (Src.Project, Source.Project)
then
Error_Msg_File_1 := Src.File;
Error_Msg_File_2 := Source.File;
diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb
index 6eeaf62a014..f4f5bc3f1b8 100644
--- a/gcc/ada/s-taprop-linux.adb
+++ b/gcc/ada/s-taprop-linux.adb
@@ -97,12 +97,6 @@ package body System.Task_Primitives.Operations is
Dispatching_Policy : Character;
pragma Import (C, Dispatching_Policy, "__gl_task_dispatching_policy");
- -- The following are effectively constants, but they need to be initialized
- -- by calling a pthread_ function.
-
- Mutex_Attr : aliased pthread_mutexattr_t;
- Cond_Attr : aliased pthread_condattr_t;
-
Foreign_Task_Elaborated : aliased Boolean := True;
-- Used to identified fake tasks (i.e., non-Ada Threads)
@@ -261,9 +255,13 @@ package body System.Task_Primitives.Operations is
is
pragma Unreferenced (Prio);
- Result : Interfaces.C.int;
+ Mutex_Attr : aliased pthread_mutexattr_t;
+ Result : Interfaces.C.int;
begin
+ Result := pthread_mutexattr_init (Mutex_Attr'Access);
+ pragma Assert (Result = 0);
+
Result := pthread_mutex_init (L, Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -279,9 +277,13 @@ package body System.Task_Primitives.Operations is
is
pragma Unreferenced (Level);
- Result : Interfaces.C.int;
+ Mutex_Attr : aliased pthread_mutexattr_t;
+ Result : Interfaces.C.int;
begin
+ Result := pthread_mutexattr_init (Mutex_Attr'Access);
+ pragma Assert (Result = 0);
+
Result := pthread_mutex_init (L, Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -762,7 +764,9 @@ package body System.Task_Primitives.Operations is
--------------------
procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is
- Result : Interfaces.C.int;
+ Mutex_Attr : aliased pthread_mutexattr_t;
+ Cond_Attr : aliased pthread_condattr_t;
+ Result : Interfaces.C.int;
begin
-- Give the task a unique serial number
@@ -774,6 +778,9 @@ package body System.Task_Primitives.Operations is
Self_ID.Common.LL.Thread := Null_Thread_Id;
if not Single_Lock then
+ Result := pthread_mutexattr_init (Mutex_Attr'Access);
+ pragma Assert (Result = 0);
+
Result := pthread_mutex_init (Self_ID.Common.LL.L'Access,
Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -784,6 +791,9 @@ package body System.Task_Primitives.Operations is
end if;
end if;
+ Result := pthread_condattr_init (Cond_Attr'Access);
+ pragma Assert (Result = 0);
+
Result := pthread_cond_init (Self_ID.Common.LL.CV'Access,
Cond_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -1027,7 +1037,9 @@ package body System.Task_Primitives.Operations is
----------------
procedure Initialize (S : in out Suspension_Object) is
- Result : Interfaces.C.int;
+ Mutex_Attr : aliased pthread_mutexattr_t;
+ Cond_Attr : aliased pthread_condattr_t;
+ Result : Interfaces.C.int;
begin
-- Initialize internal state (always to False (RM D.10(6)))
@@ -1037,6 +1049,9 @@ package body System.Task_Primitives.Operations is
-- Initialize internal mutex
+ Result := pthread_mutexattr_init (Mutex_Attr'Access);
+ pragma Assert (Result = 0);
+
Result := pthread_mutex_init (S.L'Access, Mutex_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -1047,6 +1062,9 @@ package body System.Task_Primitives.Operations is
-- Initialize internal condition variable
+ Result := pthread_condattr_init (Cond_Attr'Access);
+ pragma Assert (Result = 0);
+
Result := pthread_cond_init (S.CV'Access, Cond_Attr'Access);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -1340,12 +1358,6 @@ package body System.Task_Primitives.Operations is
end if;
end loop;
- Result := pthread_mutexattr_init (Mutex_Attr'Access);
- pragma Assert (Result = 0);
-
- Result := pthread_condattr_init (Cond_Attr'Access);
- pragma Assert (Result = 0);
-
Initialize_Lock (Single_RTS_Lock'Access, RTS_Lock_Level);
-- Initialize the global RTS lock