error #7859: THREADPRIVATE entity not allowed with DEFAULT(SHARED) clause

Reference Number : DPD200163004

Version : Initial release and update #1

Product :  Intel Fortran Composer XE 2011

Operating System : Windows*, Linux*, Mac OS X*

Problem Description : 
Intel Fortran Composer XE 2011 generates bogus compilation error #7859 when a THREADPRIVATE entity is referenced in a parallel region which has been annotated with a DEFAULT(SHARED) clause.

program demo_err
implicit none
integer, save :: foo
integer i
integer, parameter :: n = 100
!$omp threadprivate(foo)
!$omp parallel default(shared)
!$omp do
do i = 1, n
foo = i**2
!$omp end do
!$omp end parallel
end program demo_err

Compilation fails with the following error:
$ ifort -V
Intel® Fortran Intel® 64 Compiler XE for applications running on Intel® 64, Version Build 20101116

$ ifort demo_err_min.f90 -openmp
demo_err_min.f90(10): error #7859: A SHARABLE or THREADPRIVATE entity is not permitted in a PRIVATE, FIRSTPRIVATE, LASTPRIVATE, SHARED or REDUCTION clause. [FOO]
foo = i**2
compilation aborted for demo_err_min.f90 (code 1)

Simply remove the default(shared) clause from the !$omp parallel directive:
!$omp threadprivate(foo)
!$omp parallel

Resolution Status : 
This issue is resolved in ifort XE update #2. The packages containing the fixes are:

l_fcompxe_2011.2.137 (Linux*)

m_fcompxe_2011.2.142 (Mac OS X*)

w_fcompxe_2011.2.154 (Windows*)

Patrick Kennedy

[DISCLAIMER: The information on this web site is intended for hardware system manufacturers and software developers. Intel does not warrant the accuracy, completeness or utility of any information on this site. Intel may make changes to the information or the site at any time without notice. Intel makes no commitment to update the information at this site. ALL INFORMATION PROVIDED ON THIS WEBSITE IS PROVIDED "as is" without any express, implied, or statutory warranty of any kind including but not limited to warranties of merchantability, non-infringement of intellectual property, or fitness for any particular purpose. Independent companies manufacture the third-party products that are mentioned on this site. Intel is not responsible for the quality or performance of third-party products and makes no representation or warranty regarding such products. The third-party supplier remains solely responsible for the design, manufacture, sale and functionality of its products. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others.]
For more complete information about compiler optimizations, see our Optimization Notice.