Hi Jakub,
> 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:
this worked for me on both i386-pc-solaris2.11 and
sparc-sun-solaris2.11, thanks. However, I had to rerun the builds with
the DWARF-5 patch backed out since that caused so much breakage that the
results were all but useless.
Two comments, though:
> --- libgomp/config/linux/sem.h.jj 2021-01-04 10:25:56.160037625 +0100
> +++ libgomp/config/linux/sem.h 2021-01-17 16:49:39.900750416 +0100
> @@ -85,4 +85,13 @@ gomp_sem_post (gomp_sem_t *sem)
> if (__builtin_expect (count & SEM_WAIT, 0))
> gomp_sem_post_slow (sem);
> }
> +
> +static inline int
> +gomp_sem_getcount (gomp_sem_t *sem)
> +{
> + int count = __atomic_load_n (sem, MEMMODEL_RELAXED);
> + if ((count & SEM_WAIT) != 0)
> + return -1;
> + return count / SEM_INC;
> +}
> #endif /* GOMP_SEM_H */
> --- libgomp/config/posix/sem.h.jj 2021-01-04 10:25:56.166037557 +0100
> +++ libgomp/config/posix/sem.h 2021-01-17 16:49:53.605593659 +0100
> @@ -64,6 +64,8 @@ extern void gomp_sem_post (gomp_sem_t *s
>
> extern void gomp_sem_destroy (gomp_sem_t *sem);
>
> +extern int gomp_sem_getcount (gomp_sem_t *sem);
> +
> #else /* HAVE_BROKEN_POSIX_SEMAPHORES */
>
> typedef sem_t gomp_sem_t;
> @@ -84,5 +86,13 @@ static inline void gomp_sem_destroy (gom
> {
> sem_destroy (sem);
> }
> +
> +static inline int gomp_sem_getcount (gomp_sem_t *sem)
Shouldn't there be a line break before gomp_semp_getcount (and once
again in posix/sem.c), as done in linux/sem.h above? libgomp seems a
bit inconsistent in that matter, though.
Besides, I've seen regular timeouts on both Solaris and Linux/x86_64 for
one of the new tests:
WARNING: libgomp.fortran/task-detach-6.f90 -O2 execution test program timed
out.
FAIL: libgomp.fortran/task-detach-6.f90 -O2 execution test
It doesn't happen every time when manually running the test, but every
third or forth time.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University