[Patch] Fortran: Fix OpenACC in specification-part checks [PR90111]

Tobias Burnus tobias@codesourcery.com
Mon Nov 9 11:24:10 GMT 2020


OpenACC (as OpenMP) permits some directives in the 'specification part'

In Fortran (here: Fortran 2018), the latter is:
   R504  specification-part is  [use-stmt]...
                                [import-stmt]...
                                [implicit-part]
                                [declaration-construct]...
which is an ordered list (first use, then import etc.).

Hence, gfortran's state_order lists the latter separately:

   enum state_order {ORDER_START,  ORDER_USE, ORDER_IMPORT,
                     ORDER_IMPLICIT_NONE, ORDER_IMPLICIT, ORDER_SPEC,
                     ORDER_EXEC};

Currently, 'acc declare' and 'acc routine' are placed into
'#define case_decl' which implies ORDER_SPEC.

This patch adds them to the related OpenMP constructs ('case_omp_decl'),
which does not touch the current state and just checks that the
ST_... appear before ORDER_EXEC.

If there are no comments, I intent to commit it later today.

Tobias

PS: Thanks to Thomas for pointing me to the PR.

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: acc-spec-part.diff
Type: text/x-patch
Size: 4487 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201109/804e8e65/attachment.bin>


More information about the Gcc-patches mailing list