https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101602

            Bug ID: 101602
           Summary: local and local_init are not supported in DO
                    CONCURRENT
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jeff.science at gmail dot com
  Target Milestone: ---

Fortran 2018 (https://j3-fortran.org/doc/year/18/18-007r1.pdf) has three
locality specifiers: shared, local and local_init.

GCC Fortran does not support any of these.  This breaks user experience for
Fortran programmers using DO CONCURRENT code that works with other compilers.

OpenMP supports equivalent locality specifiers already so the internal
capability for this surely exists in GCC.

      program bug
        implicit none
        integer :: i, j, k
        integer, dimension(100) :: x
        j = 20
        k = 30
        x = 7
        do concurrent (i=1:10) shared(x)
           k = k + x(i)
           j = k 
        end do
        do concurrent (i=1:10) local(j)
           k = k + x(i)
           j = k 
        end do
        do concurrent (i=1:10) local_init(k)
           k = k + x(i)
           j = k 
        end do
        print*,k
      end program bug


% gfortran-11 bug.F
bug.F:8:31:

    8 |         do concurrent (i=1:10) shared(x)
      |                               1
Error: Syntax error in DO statement at (1)
bug.F:11:11:

   11 |         end do
      |           1
Error: Expecting END PROGRAM statement at (1)
bug.F:12:31:

   12 |         do concurrent (i=1:10) local(j)
      |                               1
Error: Syntax error in DO statement at (1)
bug.F:15:11:

   15 |         end do
      |           1
Error: Expecting END PROGRAM statement at (1)
bug.F:16:31:

   16 |         do concurrent (i=1:10) local_init(k)
      |                               1
Error: Syntax error in DO statement at (1)
bug.F:19:11:

   19 |         end do
      |           1
Error: Expecting END PROGRAM statement at (1)

% gfortran-11 --version
GNU Fortran (Homebrew GCC 11.1.0_1) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reply via email to