On Tue, May 11, 2021 at 11:54:58PM +0200, Tobias Burnus wrote: > The sfield / firstprivate lookup used the wrong var decl > for the lookup – hence it failed. > I used an extra long diff to make it easier to follow why > 'c' and not 'detach_clause' has the proper clause for the > decl to be used as key. > > Testsuite run ongoing. > OK for mainline, when it passes? > > Tobias > > ----------------- > Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München > Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank > Thürauf
> OpenMP: detach - fix firstprivate handling > gcc/ChangeLog: > > * omp-low.c (finish_taskreg_scan): Use the proper detach decl. > > libgomp/ChangeLog: > > * testsuite/libgomp.fortran/detach-1.f90: New test. LGTM, but please add also a libgomp.c-c++-common/task-detach-12.c testcase like: /* { dg-do run } */ /* { dg-options "-fopenmp" } */ #include <omp.h> int main () { struct S { int a[7]; } s = { { 1, 2, 3, 4, 5, 6, 7 } }; omp_event_handle_t x; #pragma omp parallel master #pragma omp task firstprivate (s) detach (x) { if (s.a[3] != 4) __builtin_abort (); omp_fulfill_event (x); } return 0; } Also, please backport to 11 after a while. Thanks. Jakub