On Fri, Feb 10, 2023 at 12:52:47PM +0100, Tobias Burnus wrote:
> > I'm afraid this is needed but insufficient.
> > I think
> > case EXEC_OMP_MASKED_TASKLOOP:
> > case EXEC_OMP_MASKED_TASKLOOP_SIMD:
> > case EXEC_OMP_MASTER_TASKLOOP:
> > case EXEC_OMP_MASTER_TASKLOOP_SIMD:
> > case EXEC_OMP_PARALLEL_LOOP:
> > case EXEC_OMP_TARGET_PARALLEL_LOOP:
> > case EXEC_OMP_TARGET_TEAMS_LOOP:
> > case EXEC_OMP_TARGET_SIMD:
> > case EXEC_OMP_TEAMS_LOOP:
> > should be in the list above (of course alphabetically sorted in between the
> > others)
> > gfc_resolve_omp_parallel_blocks (code, ns);
>
> I think 'TARGET_SIMD' shouldn't be resolved though parallel blocks but
You're right, we use gfc_resolve_omp_parallel_blocks for
parallel, teams, task but not for target alone.
> can call directly call gfc_resolve_omp_do_blocks (as
> currently/previously implemented). The masked version were already
> handled inside gfc_resolve_omp_parallel_blocks but missing in
> gfc_resolve_code, while the 'loop' ones had to be added to both.
>
> (I did not extend the testcase, but I updated two to add additional
> dg-error to the same line.)
> gcc/fortran/ChangeLog:
>
> PR fortran/108512
> * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
> directives.
> (gfc_resolve_do_iterator): Set a source location for added
> 'private'-clause arguments.
> * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
> also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
> combined directives with loop + '{masked,master} taskloop (simd)'.
>
> gcc/testsuite/ChangeLog:
>
> PR fortran/108512
> * gfortran.dg/gomp/loop-5.f90: New test.
> * gfortran.dg/gomp/loop-2.f90: Update dg-error.
> * gfortran.dg/gomp/taskloop-2.f90: Update dg-error.
LGTM, thanks.
Jakub