On Wed, Aug 18, 2021 at 01:10:12PM +0200, Tobias Burnus wrote:
> I think otherwise the patch is boring - as boring as 'omp nothing' itself
> (outside its use in metadirectives).
Yeah, I think nobody sane will use it for anything but metadirective
except in compiler testsuites.
> Fortran: Add OpenMP's nothing directive support
>
> Fortran version of commit 5079b7781a2c506dcdfb241347d74c7891268225
>
> gcc/fortran/ChangeLog:
>
> * match.h (gfc_match_omp_nothing): New.
> * openmp.c (gfc_match_omp_nothing): New.
> * parse.c (decode_omp_directive): Match 'nothing' directive.
>
> gcc/testsuite/ChangeLog:
>
> * gfortran.dg/nothing-1.f90: New test.
> * gfortran.dg/nothing-2.f90: New test.
LGTM, thanks.
> + !$omp nothing
> + if (.false.) &
> +& & !$omp nothing
> + i = i + 1
> +
> + if (.false.) &
> +& & !$omp nothing
> + then
> + end if
I'm actually not sure if the above really is valid (well, treated as OpenMP
directive, rather than just an arbitrary comment), e.g. 5.0 2.2.2 says:
The sentinel can appear in any column but must be preceded only by white space;
which is not the case above. And I think that is the reason we don't have a
Fortran counterpart to the stand-alone and declarative directive
restrictions C/C++ has that they can't appear in certain contexts.
So, do we actually parse
if (.true.) &
& & !$omp barrier
as if with barrier construct in it?
Jakub