https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93826
Bug ID: 93826
Summary: [OpenMP][OpenACC] Collapsed loop – code silently
ignored
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Keywords: openacc, openmp
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
Target Milestone: ---
Found when looking at PR 93552.
The code gfc_trans_omp_do for collapes (and for OpenACC's 'tile') creates a
single #pragma followed by a bunch of "for (....)" statements, matching the
specified number of collapse/tile.
It then translates the body of the inner loop in one go.
RESULT: Code outside the innermost loop is silently ignored.
EXPECTED: I have still to digest the OpenMP/OpenACC spec, but I expect either
an error (if invalid) or that the code does not get ignored (if valid).
program p
integer :: i, j, k
real :: x
!$acc parallel loop collapse(3)
!$omp parallel do collapse(3)
do i = 1, 8
do j = 1, 8
do k = 1, 8
end do
x = 5 ! <<< not translated but also not an error message
end do
end do
end