From a5dd23a728109134f3eea1272cb7edaba389f5c6 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Mon, 21 Nov 2011 11:38:35 +0000 Subject: [PATCH] sem_prag.adb (Process_Convention): A dispatching call cannot have a stdcall calling convention. 2011-11-21 Pascal Obry * sem_prag.adb (Process_Convention): A dispatching call cannot have a stdcall calling convention. 2011-11-21 Pascal Obry * s-taprop-linux.adb (Initialize_Lock): Do not allocate a mutex attribute as not needed. (Initialize_TCB): Likewise. (Initialize): Likewise. From-SVN: r181564 --- gcc/ada/ChangeLog | 12 ++++++++++++ gcc/ada/s-taprop-linux.adb | 36 ++++++++++-------------------------- gcc/ada/sem_prag.adb | 5 +++-- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a9c682b9972..c0efe1b0043 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,15 @@ +2011-11-21 Pascal Obry + + * sem_prag.adb (Process_Convention): A dispatching call cannot + have a stdcall calling convention. + +2011-11-21 Pascal Obry + + * 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 * 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 c63d5531b62..70f2d143545 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 148c6dee659..9ba21291b85 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) -- 2.30.2