public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ian.bush at nag dot co.uk" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-52970-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52970

             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=27148
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 when
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 
program test_par_opemp

!$ use omp_lib
implicit none 


integer :: kk, jx,jy,jz
Integer, Parameter :: nsbcll = 27

Integer, Dimension( 1:nsbcll ), Parameter :: &
  nix = (/ 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 = (/ 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 = (/ 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=1, nsbcll

    jx=nix(kk)
    jy= niy(kk)
    jz=niz(kk)
end do 
 !$omp end parallel do 


end program
Wot now? ~/Downloads/gcc-4.8/bin/gfortran --version
GNU Fortran (GCC) 4.8.0 20120408 (experimental)
Copyright © 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=f95
test_par_open.f90 
test_par_open.f90: In function ‘test_par_opemp’:
test_par_open.f90:18:0: error: ‘nix’ not specified in enclosing parallel
test_par_open.f90:15:0: error: enclosing parallel
test_par_open.f90:19:0: error: ‘niy’ not specified in enclosing parallel
test_par_open.f90:15:0: error: enclosing parallel
test_par_open.f90:20:0: error: ‘niz’ not specified in enclosing 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


             reply	other threads:[~2012-04-13  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13  9:32 ian.bush at nag dot co.uk [this message]
2015-10-20 16:02 ` [Bug fortran/52970] " dominiq at lps dot ens.fr
2015-10-20 19:08 ` anlauf at gmx dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-52970-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).