Test Case: ! derived from OpenMP test omp3f/NF03_2_9_2_2a.f90 ! REFERENCES : OpenMP 3.0, p. 83, line 30 program NF03_2_9_2_2a implicit none integer, save :: threadprivate_var !$omp threadprivate(threadprivate_var) !$omp parallel !$omp task untied threadprivate_var = 1 !$omp end task !$omp end parallel print *, "FAIL - Negative test should not compile" end program NF03_2_9_2_2a > gfortran -fopenmp test.f90 > ./a.out FAIL - Negative test should not compile > Comments from OpenMP testers: This test case is derived from OpenMP test omp3f/NF03_2_9_2_2a.f90 . The negative test checks the following restriction: The OpenMP API Version 3.0 (May 2008) states the following on p. 83 line 30: " * A program in which an untied task accesses threadprivate storage is non-conforming."
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) $> gfortran-4.4 -fopenmp pr44085.f90 &&./a.out FAIL - Negative test should not compile gcc version 4.5.1 20100509 (prerelease) $> gfortran-4.5 -fopenmp pr44085.f90 &&./a.out FAIL - Negative test should not compile gcc version 4.6.0 20100510 (experimental) $> gfortran-svn -fopenmp pr44085.f90 &&./a.out FAIL - Negative test should not compile
Subject: Bug 44085 Author: jakub Date: Wed May 12 12:11:00 2010 New Revision: 159316 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159316 Log: PR middle-end/44085 * gimplify.c (enum omp_region_type): Add ORT_UNTIED_TASK, change value of ORT_TASK. (new_omp_context): Handle ORT_UNTIED_TASK like ORT_TASK. (omp_notice_threadprivate_variable): New function. (omp_notice_variable): Call it for threadprivate variables. If enclosing ctx is a task, print enclosing task rather than enclosing parallel. Handle ORT_UNTIED_TASK like ORT_TASK. (gimplify_omp_task): Pass ORT_UNTIED_TASK instead of ORT_TASK if task has untied clause. * gcc.dg/gomp/pr44085.c: New test. * gfortran.dg/gomp/pr44085.f90: New test. Added: trunk/gcc/testsuite/gcc.dg/gomp/pr44085.c trunk/gcc/testsuite/gfortran.dg/gomp/pr44085.f90 Modified: trunk/gcc/ChangeLog trunk/gcc/gimplify.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 44085 Author: jakub Date: Wed May 12 12:18:55 2010 New Revision: 159317 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159317 Log: PR middle-end/44085 * gimplify.c (enum omp_region_type): Add ORT_UNTIED_TASK, change value of ORT_TASK. (new_omp_context): Handle ORT_UNTIED_TASK like ORT_TASK. (omp_notice_threadprivate_variable): New function. (omp_notice_variable): Call it for threadprivate variables. If enclosing ctx is a task, print enclosing task rather than enclosing parallel. Handle ORT_UNTIED_TASK like ORT_TASK. (gimplify_omp_task): Pass ORT_UNTIED_TASK instead of ORT_TASK if task has untied clause. * gcc.dg/gomp/pr44085.c: New test. * gfortran.dg/gomp/pr44085.f90: New test. Added: branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/gomp/pr44085.c branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/gomp/pr44085.f90 Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/gimplify.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Subject: Bug 44085 Author: jakub Date: Wed May 12 12:30:21 2010 New Revision: 159318 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159318 Log: PR middle-end/44085 * gimplify.c (enum omp_region_type): Add ORT_UNTIED_TASK, change value of ORT_TASK. (new_omp_context): Handle ORT_UNTIED_TASK like ORT_TASK. (omp_notice_threadprivate_variable): New function. (omp_notice_variable): Call it for threadprivate variables. If enclosing ctx is a task, print enclosing task rather than enclosing parallel. Handle ORT_UNTIED_TASK like ORT_TASK. (gimplify_omp_task): Pass ORT_UNTIED_TASK instead of ORT_TASK if task has untied clause. * gcc.dg/gomp/pr44085.c: New test. * gfortran.dg/gomp/pr44085.f90: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/gomp/pr44085.c branches/gcc-4_4-branch/gcc/testsuite/gfortran.dg/gomp/pr44085.f90 Modified: branches/gcc-4_4-branch/gcc/ChangeLog branches/gcc-4_4-branch/gcc/gimplify.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
Fixed.