[Patch] Fortran: OpenMP/OpenACC diagnose substring rejections better

Tobias Burnus tobias@codesourcery.com
Thu Feb 4 11:24:10 GMT 2021


This issue came up when looking at Julian's OpenACC patches
and by coincidence it was also discussed for OpenMP
yesterday (lang-spec F2F meeting; Issue #2607).

OpenACC rather explicitly lists what counts as 'var' and
substrings do not appear there. While OpenMP is rather
silent on this issue; I think between the
lines it can be read that it is not permitted - and
supporting it will run into many issues. (Hence, the
agreement that it should not be allowed; wording changes
still need to be voted on, cf. Issue #2607).


Without the patch, gfortran gives the
   Error: ‘str2’ in MAP clause at (1) is not a proper array section

And with the patch
   Error: Unexpected substring reference in MAP clause at (1)
Except, in one OpenMP case, it stops earlier and we get:
   Error: Syntax error in OpenMP variable list at (1)
(see testcase)

OK for mainline?

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: omp-substr.diff
Type: text/x-patch
Size: 3934 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210204/2f08c58c/attachment-0001.bin>


More information about the Gcc-patches mailing list