This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/4] [GOMP4] [Fortran] OpenACC 1.0+ support in fortran front-end


Hi Tobias!

Thanks a lot for your review!
!$acc loop
outer_loop: do i = 1, n
   inner_loop: do j = 1,m
      ! ...
      cycle outer_loop
      exit outer_loop
   end do inner_loop
end do outer_loop

That's a new Fortran 2008 feature that CYCLE and EXIT can leave the inner DO loop.

I added the following to test suite:

  !$acc loop
  outer_loop: do i = 1, 5
    inner_loop: do j = 1,5
      if (i .eq. j) cycle outer_loop
      if (i .ne. j) exit outer_loop ! { dg-error "EXIT statement" }
    end do inner_loop
  end do outer_loop

  outer_loop1: do i = 1, 5
    !$acc loop
    inner_loop1: do j = 1,5
      if (i .eq. j) cycle outer_loop1 ! { dg-error "CYCLE statement" }
    end do inner_loop1
  end do outer_loop1

  !$acc loop collapse(2)
  outer_loop2: do i = 1, 5
    inner_loop2: do j = 1,5
      if (i .eq. j) cycle outer_loop2 ! { dg-error "CYCLE statement" }
      if (i .ne. j) exit outer_loop2 ! { dg-error "EXIT statement" }
    end do inner_loop2
end do outer_loop2

All cases pass.

The second one passes due to check of structured blocks:

  if (o != NULL)
    {
      gfc_error ("%s statement at %C leaving OpenMP structured block",
         gfc_ascii_statement (st));
      return MATCH_ERROR;
    }

So, I needed to change error message.

Also I fixed checks of polymofphic type and indentation.

OK for gomp4 branch?

--
Ilmir.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]