Fix PR libgomp/66761 and PR libgomp/67303 (tsan warnings)
Jakub Jelinek
jakub@redhat.com
Mon Aug 24 09:07:00 GMT 2015
On Sat, Aug 22, 2015 at 10:36:45AM +0000, VandeVondele Joost wrote:
> OK for trunk ?
> This applies without changes to the 5 branch, should I commit there as well ?
Ok, with a small change:
> 2015-08-22 Joost VandeVondele <vondele@gnu.gcc.org>
>
> PR libgomp/66761
> PR libgomp/67303
> * iter.c (gomp_iter_dynamic_next): Employ an atomic load.
> (gomp_iter_guided_next): Idem.
> * iter_ull.c (gomp_iter_ull_dynamic_next): Idem.
> (gomp_iter_ull_guided_next): Idem.
> * config/linux/wait.h (do_spin): Idem.
> --- libgomp/config/linux/wait.h (revision 227094)
> +++ libgomp/config/linux/wait.h (working copy)
> @@ -49,7 +49,8 @@ static inline int do_spin (int *addr, in
> {
> unsigned long long i, count = gomp_spin_count_var;
>
> - if (__builtin_expect (gomp_managed_threads > gomp_available_cpus, 0))
> + if (__builtin_expect (__atomic_load_n (&gomp_managed_threads,
> + MEMMODEL_RELAXED) > gomp_available_cpus, 0))
Please fix up formatting here, MEMMODEL_RELAXED should be below
&gomp_managed_threads and most likely > will need to be below
__atomic_load_n.
> count = gomp_throttled_spin_count_var;
> for (i = 0; i < count; i++)
> if (__builtin_expect (__atomic_load_n (addr, MEMMODEL_RELAXED) != val, 0))
Jakub
More information about the Gcc-patches
mailing list