Gio T wrote:
This patch bumps the OpenMP version from 4.5 (201511) to 5.2 (202111),
with deprecations implemented up to 5.1 (202011). Additionally
introduces a new warning, Wdeprecated-openmp, for the deprecated
features, with the requisite changes to the testsuite.
Generic remarks to bystanders:
* -Wdeprecated-openmp (on by default) warns about deprecated
syntax/directive/clause names issued by the compiler (and
pointing to the new way); it can be disabled by -Wno-...
* Some declarations have been deprecated as well; those are
warned for by -Wdeprecated-declarations
With that patch, GCC moves from OpenMP 4.5 plus most 5.x to
5.2 - with some known deficits (bugs and some omissions), being
fixed.
Missing is OMPT/OMTD (tooling/tracing and debugging support)
and few features, mostly being upstreamed currently - e.g.
delimited declare variant is supposed to land this week.
(It was approved with minor comments.) The current status,
lacking some fine print, is at https://gcc.gnu.org/projects/gomp/ and
https://gcc.gnu.org/onlinedocs/libgomp/OpenMP-Implementation-Status.html
(mainline version, cf. https://gcc.gnu.org/onlinedocs/ for other
versions).
* * *
One testcase also showed how useful -Wunknown-pragmas is, given
that a directive name was misspelled in one file...
* * *
gcc/c-family/ChangeLog:
* c-cppbuiltin.cc (c_cpp_builtins): Bump version.
Which one? 'Bump _OPENMP version.' or something like that.
(Helps when reading, esp. as long as it still ends up in
the ChangeLog file without the context of 'git log'.)
* c.opt: Add warning.
I think it would be better to write:
* c.opt (Wdeprecated-openmp): Add.
Or likewise. That way it is clear which option has been
added (and it is also not much longer).
gcc/ChangeLog:
* doc/invoke.texi: Update docs.
Likewise; e.g. 'Update docs for -Wdeprecated-openmp'. Or
'(Wno-deprecated-openmp): Add.' or likewise.
gcc/fortran/ChangeLog:
* cpp.cc (cpp_define_builtins): Bump version.
Likewise: Mention _OPENMP.
* invoke.texi: Update docs.
Actually: Document -Wdeprecated-openmp.
* lang.opt: Add warning.
Namely, Wdeprecated-openmp
* openmp.cc (gfc_match_omp_clauses): Deprecate master affinity
policy.
(gfc_match_omp_parallel_master): Deprecate master construct.
(gfc_match_omp_parallel_master_taskloop): Ditto.
(gfc_match_omp_parallel_master_taskloop_simd): Ditto.
(gfc_match_omp_master): Ditto.
(gfc_match_omp_master_taskloop): Ditto.
(gfc_match_omp_master_taskloop_simd): Ditto.
OK but you can also combine multiple functions in the same file as:
(gfc_match_omp_parallel_master, gfc_match_omp_parallel_master_taskloop,
gfc_match_omp_parallel_master_taskloop_simd, ...
Altough, I am not sure it saves much space here as the function names
are very long.
(resolve_omp_clauses): Warn for *_device_ptr.
'Warn for deprecated use of '{use,is}_device_ptr.' ?
libgomp/ChangeLog:
* env.c (omp_display_env): Bump version.
'OpenMP version'? – (Albeit not really needed here due to the context.)
* fortran.c (ialias_redirect): Remove suppression pragmas.
(omp_set_dynamic_8_): Ditto.
(omp_set_nested_8_): Ditto.
(omp_get_nested_): Ditto.
And here you can save one, two lines lines, if you want.
* omp_lib.f90.in: Bump version.
* omp_lib.h.in: Ditto.
'Bump openmp_version.'? Or '...in (openmp_version): Bump./Bump version.'
* testsuite/libgomp.c++/affinity-1.C: Suppress warnings.
'Suppress deprecatation warning' - other warnings are unaffected (albeit
most are not on by default).
gcc/testsuite/ChangeLog:
* c-c++-common/cpp/openmp-define-3.c: Bump version.
'Bump expected version' ?
* c-c++-common/gomp/Wparentheses-1.c: Suppress warnings.
'Suppress deprecation warnings'?
* c-c++-common/gomp/clause-dups-1.c: Ditto.
* c-c++-common/gomp/clauses-1.c: Ditto, and fix spelling. Make
warnings stricter.
* c-c++-common/gomp/clauses-6.c: Ditto.
I wonder whether you should move the -1.c item to the end of the
'Ditto.' list or before it (and fill in the ditto part).
Otherwise: 'Fix directive name' and add '-Wunknown-pragmas' would be
clearer. (Spelling could also be comment spelling.)
* * *
* gfortran.dg/openmp-define-3.f90: Bump version.
expected version?
* * *
Except for the ChangeLog comments above: LGTM.
Thanks for the patch!
Tobias