https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102698

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2021-10-12
           Keywords|                            |openmp

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  helgrind says

==1313== ----------------------------------------------------------------
==1313== 
==1313== Possible data race during write of size 4 at 0x64DEB90 by thread #1
==1313== Locks held: none
==1313==    at 0x566182B: gomp_barrier_wait_end (bar.c:40)
==1313==    by 0x566182B: gomp_barrier_wait_end (bar.c:35)
==1313==    by 0x565FA2D: gomp_simple_barrier_wait (simple-bar.h:60)
==1313==    by 0x565FA2D: gomp_team_start (team.c:853)
==1313==    by 0x56576BC: GOMP_parallel (parallel.c:169)
==1313==    by 0x400938: aaaa_ieor_ (t.f90:57)
==1313==    by 0x400A80: MAIN__ (t.f90:26)
==1313==    by 0x40102C: main (t.f90:38)
==1313== 
==1313== This conflicts with a previous read of size 4 by thread #24
==1313== Locks held: none
==1313==    at 0x566187B: gomp_barrier_wait_start (bar.h:98)
==1313==    by 0x566187B: gomp_barrier_wait (bar.c:56)
==1313==    by 0x565EFD2: gomp_simple_barrier_wait (simple-bar.h:60)
==1313==    by 0x565EFD2: gomp_thread_start (team.c:117)
==1313==    by 0x4C36016: ??? (in
/usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
==1313==    by 0x5CEAA19: start_thread (in /lib64/libpthread-2.31.so)
==1313==    by 0x6002D0E: clone (in /lib64/libc-2.31.so)
==1313==  Address 0x64deb90 is 128 bytes inside a block of size 192 alloc'd
==1313==    at 0x4C328FF: malloc (in
/usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
==1313==    by 0x5651308: gomp_malloc (alloc.c:38)
==1313==    by 0x565F218: gomp_get_thread_pool (pool.h:42)
==1313==    by 0x565F218: get_last_team (team.c:150)
==1313==    by 0x565F218: gomp_new_team (team.c:169)
==1313==    by 0x56576A5: GOMP_parallel (parallel.c:169)
==1313==    by 0x400938: aaaa_ieor_ (t.f90:57)
==1313==    by 0x400A80: MAIN__ (t.f90:26)
==1313==    by 0x40102C: main (t.f90:38)
==1313==  Block was alloc'd by thread #1

(and more of those)

and then

==1313== ----------------------------------------------------------------
==1313== 
==1313== Possible data race during read of size 4 at 0x64DEC94 by thread #1
==1313== Locks held: none
==1313==    at 0x5661963: do_spin (wait.h:57)
==1313==    by 0x5661963: do_wait (wait.h:66)
==1313==    by 0x5661963: gomp_team_barrier_wait_end (bar.c:112)
==1313==    by 0x56604A8: gomp_team_end (team.c:937)
==1313==    by 0x400938: aaaa_ieor_ (t.f90:57)
==1313==    by 0x400A80: MAIN__ (t.f90:26)
==1313==    by 0x40102C: main (t.f90:38)
==1313== 
==1313== This conflicts with a previous write of size 4 by thread #3
==1313== Locks held: none
==1313==    at 0x5661A25: gomp_team_barrier_wait_end (bar.c:102)
==1313==    by 0x565F011: gomp_thread_start (team.c:124)
==1313==    by 0x4C36016: ??? (in
/usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
==1313==    by 0x5CEAA19: start_thread (in /lib64/libpthread-2.31.so)
==1313==    by 0x6002D0E: clone (in /lib64/libc-2.31.so)
==1313==  Address 0x64dec94 is 132 bytes inside a block of size 6,528 alloc'd
==1313==    at 0x4C328FF: malloc (in
/usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
==1313==    by 0x5651308: gomp_malloc (alloc.c:38)
==1313==    by 0x565F077: gomp_new_team (team.c:174)
==1313==    by 0x56576A5: GOMP_parallel (parallel.c:169)
==1313==    by 0x400938: aaaa_ieor_ (t.f90:57)
==1313==    by 0x400A80: MAIN__ (t.f90:26)
==1313==    by 0x40102C: main (t.f90:38)
==1313==  Block was alloc'd by thread #1

and

==1313== ----------------------------------------------------------------
==1313== 
==1313== Possible data race during write of size 8 at 0x1FFEFFF778 by thread #1
==1313== Locks held: none
==1313==    at 0x4FDD826: _gfortran_reshape_4 (reshape_i4.c:47)
==1313== 
==1313== This conflicts with a previous read of size 8 by thread #3
==1313== Locks held: none
==1313==    at 0x4010D7: aaaa_ieor_._omp_fn.0 (t.f90:59)
==1313==    by 0x565F005: gomp_thread_start (team.c:123)
==1313==    by 0x4C36016: ??? (in
/usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
==1313==    by 0x5CEAA19: start_thread (in /lib64/libpthread-2.31.so)
==1313==    by 0x6002D0E: clone (in /lib64/libc-2.31.so)
==1313==  Address 0x1ffefff778 is on thread #1's stack

so the thing is having data races, either because the GCC OMP runtime
is faulty or your expectations.

Reply via email to