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

            Bug ID: 103342
           Summary: [OPENMP]Missing barrier for linear clause within loop
                    simd construct which not directly contained by
                    parrellel construct
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xiao....@compiler-dev.com
  Target Milestone: ---

The test case is,

program p
  integer, parameter :: N = 10000
  integer :: a(N)
  integer :: i, j
  j = 0
  !$omp parallel do simd linear(j: 2)
  do i = 1, N
    a(i) = a(i) + j
    j = j + 2
  enddo
  j = 0
  !$omp parallel
  call subr(a)
  !$omp end parallel
contains
  subroutine subr(x)
    integer :: x(N)
    !$omp do simd linear(j: 2)
    do i = 1, N
      x(i) = x(i) + j
      j = j + 2
    enddo
  end subroutine
end program

After complier with,
  gfortran-10 test.f90 -fopenmp -fdump-tree-all

In the file test.f90.007t.omplower, I found "builtin_GOMP_barrier" in "p", but
none in "subr".

And when I convert to C-style testcase, found "builtin_GOMP_barrier" in both.

Except the missing of barrier, there is an ICE for gfortran when removed "simd"
in "subr".

Reply via email to