aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2011-11-21 11:38:35 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2011-11-21 12:38:35 +0100
commita5dd23a728109134f3eea1272cb7edaba389f5c6 (patch)
treec5547ad418f7231614dae5dede71839222e1f9ed
parenta4901c083549b9173a1cb3e55741ef0dfc3a8472 (diff)
downloadgcc-a5dd23a728109134f3eea1272cb7edaba389f5c6.zip
gcc-a5dd23a728109134f3eea1272cb7edaba389f5c6.tar.gz
gcc-a5dd23a728109134f3eea1272cb7edaba389f5c6.tar.bz2
sem_prag.adb (Process_Convention): A dispatching call cannot have a stdcall calling convention.
2011-11-21 Pascal Obry <obry@adacore.com> * sem_prag.adb (Process_Convention): A dispatching call cannot have a stdcall calling convention. 2011-11-21 Pascal Obry <obry@adacore.com> * s-taprop-linux.adb (Initialize_Lock): Do not allocate a mutex attribute as not needed. (Initialize_TCB): Likewise. (Initialize): Likewise. From-SVN: r181564
-rw-r--r--gcc/ada/ChangeLog12
-rw-r--r--gcc/ada/s-taprop-linux.adb36
-rw-r--r--gcc/ada/sem_prag.adb5
3 files changed, 25 insertions, 28 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index a9c682b..c0efe1b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,15 @@
+2011-11-21 Pascal Obry <obry@adacore.com>
+
+ * sem_prag.adb (Process_Convention): A dispatching call cannot
+ have a stdcall calling convention.
+
+2011-11-21 Pascal Obry <obry@adacore.com>
+
+ * s-taprop-linux.adb (Initialize_Lock): Do not allocate a
+ mutex attribute as not needed.
+ (Initialize_TCB): Likewise.
+ (Initialize): Likewise.
+
2011-11-21 Robert Dewar <dewar@adacore.com>
* sem_ch6.adb (Is_Public_Subprogram_For): New procedure
diff --git a/gcc/ada/s-taprop-linux.adb b/gcc/ada/s-taprop-linux.adb
index c63d553..70f2d14 100644
--- a/gcc/ada/s-taprop-linux.adb
+++ b/gcc/ada/s-taprop-linux.adb
@@ -291,14 +291,10 @@ package body System.Task_Primitives.Operations is
else
declare
- Mutex_Attr : aliased pthread_mutexattr_t;
- Result : Interfaces.C.int;
+ Result : Interfaces.C.int;
begin
- Result := pthread_mutexattr_init (Mutex_Attr'Access);
- pragma Assert (Result = 0);
-
- Result := pthread_mutex_init (L.WO'Access, Mutex_Attr'Access);
+ Result := pthread_mutex_init (L.WO'Access, null);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -315,14 +311,10 @@ package body System.Task_Primitives.Operations is
is
pragma Unreferenced (Level);
- Mutex_Attr : aliased pthread_mutexattr_t;
- Result : Interfaces.C.int;
+ Result : Interfaces.C.int;
begin
- Result := pthread_mutexattr_init (Mutex_Attr'Access);
- pragma Assert (Result = 0);
-
- Result := pthread_mutex_init (L, Mutex_Attr'Access);
+ Result := pthread_mutex_init (L, null);
pragma Assert (Result = 0 or else Result = ENOMEM);
@@ -817,9 +809,8 @@ package body System.Task_Primitives.Operations is
--------------------
procedure Initialize_TCB (Self_ID : Task_Id; Succeeded : out Boolean) is
- Mutex_Attr : aliased pthread_mutexattr_t;
- Cond_Attr : aliased pthread_condattr_t;
- Result : Interfaces.C.int;
+ Cond_Attr : aliased pthread_condattr_t;
+ Result : Interfaces.C.int;
begin
-- Give the task a unique serial number
@@ -831,11 +822,8 @@ 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);
+ pthread_mutex_init (Self_ID.Common.LL.L'Access, null);
pragma Assert (Result = 0 or else Result = ENOMEM);
if Result /= 0 then
@@ -1081,9 +1069,8 @@ package body System.Task_Primitives.Operations is
----------------
procedure Initialize (S : in out Suspension_Object) is
- Mutex_Attr : aliased pthread_mutexattr_t;
- Cond_Attr : aliased pthread_condattr_t;
- Result : Interfaces.C.int;
+ Cond_Attr : aliased pthread_condattr_t;
+ Result : Interfaces.C.int;
begin
-- Initialize internal state (always to False (RM D.10(6)))
@@ -1093,10 +1080,7 @@ 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);
+ Result := pthread_mutex_init (S.L'Access, null);
pragma Assert (Result = 0 or else Result = ENOMEM);
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 148c6de..9ba2129 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -3527,8 +3527,9 @@ package body Sem_Prag is
-- For Stdcall, a subprogram, variable or subprogram type is required
if C = Convention_Stdcall
- and then not Is_Subprogram (E)
- and then not Is_Generic_Subprogram (E)
+ and then
+ ((not Is_Subprogram (E) and then not Is_Generic_Subprogram (E))
+ or else Is_Dispatching_Operation (E))
and then Ekind (E) /= E_Variable
and then not
(Is_Access_Type (E)