! { dg-do compile } ! { dg-options "-O2 -fopenmp" } program nestomp integer :: j j = 8 call bar contains subroutine foo (i) integer :: i !$omp atomic j = j + 1 end subroutine subroutine bar integer :: i i = 6 !$omp parallel call foo(i) !$omp end parallel end subroutine end Guess this is related to 25261, tree-nested.c really needs work for OpenMP.
Confirmed, we don't add to the calls the chain decl.
Subject: Bug 28790 Author: jakub Date: Tue Sep 26 18:10:58 2006 New Revision: 117235 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117235 Log: PR middle-end/25261 PR middle-end/28790 * tree-nested.c (struct nesting_info): Added static_chain_added. (convert_call_expr): Set static_chain_added when adding static chain. Handle OMP_PARALLEL and OMP_SECTION. * gcc.dg/gomp/nestedfn-1.c: New test. * testsuite/libgomp.c/nestedfn-4.c: New test. * testsuite/libgomp.c/nestedfn-5.c: New test. * testsuite/libgomp.fortran/nestedfn3.f90: New test. Added: trunk/gcc/testsuite/gcc.dg/gomp/nestedfn-1.c trunk/libgomp/testsuite/libgomp.c/nestedfn-4.c trunk/libgomp/testsuite/libgomp.c/nestedfn-5.c trunk/libgomp/testsuite/libgomp.fortran/nestedfn3.f90 Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-nested.c trunk/libgomp/ChangeLog
Fixed.