Hello Jakub,

On 17/01/2021 17:04, Jakub Jelinek via Gcc-patches wrote:

On Sun, Jan 17, 2021 at 04:25:24PM +0100, Andreas Schwab wrote:
On Jan 17 2021, Jakub Jelinek via Gcc-patches wrote:

Kwok, I guess you can reproduce it even on Linux with --disable-linux-futex
And all targets that are not explicitly configured in
libcomp/configure.tgt, where --enable-linux-futex is a no-op.
Completely untested patch (except for the linux futex version; and RTEMS
stuff is missing; I think it doesn't have a function for it but has a
counter in the struct, so perhaps fetch it manually from there), it is
Sunday, don't want to do more tonight:

here is the RTEMS part:

diff --git a/libgomp/config/rtems/sem.h b/libgomp/config/rtems/sem.h
index 50b650ab807..0cd74153b05 100644
--- a/libgomp/config/rtems/sem.h
+++ b/libgomp/config/rtems/sem.h
@@ -47,6 +47,11 @@ static inline void gomp_sem_post (gomp_sem_t *sem)
   _Semaphore_Post (sem);
 }

+static inline int gomp_sem_getcount (gomp_sem_t *sem)
+{
+  return (int) __atomic_load_n (&sem->_count, MEMMODEL_RELAXED);
+}
+
 static inline void gomp_sem_destroy (gomp_sem_t *sem)
 {
   _Semaphore_Destroy (sem);

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

Reply via email to