From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10849 invoked by alias); 13 Apr 2012 09:32:26 -0000 Received: (qmail 10837 invoked by uid 22791); 13 Apr 2012 09:32:25 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Apr 2012 09:32:12 +0000 From: "ian.bush at nag dot co.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52970] New: OpenMP Scoping Incorrect for Arrays of Parameters Date: Fri, 13 Apr 2012 09:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ian.bush at nag dot co.uk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00978.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52970 Bug #: 52970 Summary: OpenMP Scoping Incorrect for Arrays of Parameters Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: ian.bush@nag.co.uk Created attachment 27148 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D27148 Program showing the problem Hi, when using default( none ) for the scoping of variables in an OpenMP parallel region gfortran complains that arrays of Parameters need scoping w= hen they don't as they are named constants, not variables. Interestingly scalar Parameters behave correctly (sorry for any line wrap issues): Wot now? cat test_par_open.f90=20 program test_par_opemp !$ use omp_lib implicit none=20 integer :: kk, jx,jy,jz Integer, Parameter :: nsbcll =3D 27 Integer, Dimension( 1:nsbcll ), Parameter :: & nix =3D (/ 0, -1,-1,-1, 0, 0, 0, 1, 1, 1, -1,-1,-1, 0, 0, 1, 1, 1, -1,-1= ,-1, 0, 0, 0, 1, 1, 1 /) , & niy =3D (/ 0, -1, 0, 1,-1, 0, 1,-1, 0, 1, -1, 0, 1,-1, 1,-1, 0, 1, -1, 0, 1,-1, 0, 1,-1, 0, 1 /) , & niz =3D (/ 0, -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1= , 1, 1, 1, 1, 1, 1, 1 /) !$omp parallel do default(none) private(kk,jx,jy,jz) do kk=3D1, nsbcll jx=3Dnix(kk) jy=3D niy(kk) jz=3Dniz(kk) end do=20 !$omp end parallel do=20 end program Wot now? ~/Downloads/gcc-4.8/bin/gfortran --version GNU Fortran (GCC) 4.8.0 20120408 (experimental) Copyright =C2=A9 2012 Free Software Foundation, Inc. GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING Wot now? ~/Downloads/gcc-4.8/bin/gfortran -fopenmp -W -Wall -pedantic -std= =3Df95 test_par_open.f90=20 test_par_open.f90: In function =E2=80=98test_par_opemp=E2=80=99: test_par_open.f90:18:0: error: =E2=80=98nix=E2=80=99 not specified in enclo= sing parallel test_par_open.f90:15:0: error: enclosing parallel test_par_open.f90:19:0: error: =E2=80=98niy=E2=80=99 not specified in enclo= sing parallel test_par_open.f90:15:0: error: enclosing parallel test_par_open.f90:20:0: error: =E2=80=98niz=E2=80=99 not specified in enclo= sing parallel test_par_open.f90:15:0: error: enclosing parallel Note no error is generated for the scalar parameter nsbcll. This happens in 4.8.0, 4.6.2 and 4.5.2. Portland group, intel and oracle are all happy with= the above code. The above code is attached, Ian