]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add a restriction on allocate clause (OpenMP 5.0)
authorHafiz Abid Qadeer <abidh@codesourcery.com>
Fri, 18 Feb 2022 21:28:08 +0000 (21:28 +0000)
committerHafiz Abid Qadeer <abidh@codesourcery.com>
Tue, 8 Mar 2022 19:17:51 +0000 (19:17 +0000)
commit68115abc85880f7202b5e3952e8c407a0f4e0f56
tree44d449c93c2d8ddd824846bc80d418b97f7959a6
parent5aa5d41e16246f2b47e85ace0672c458dd52dd97
Add a restriction on allocate clause (OpenMP 5.0)

This is backport of a patch posted in
https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590597.html

An allocate clause in target region must specify an allocator
unless the compilation unit has requires construct with
dynamic_allocators clause.  Current implementation of the allocate
clause did not check for this restriction. This patch fills that
gap.

gcc/ChangeLog:

* omp-low.c (omp_maybe_offloaded_ctx): New prototype.
(scan_sharing_clauses):  Check a restriction on allocate clause.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/allocate-2.c: Add tests.
* c-c++-common/gomp/allocate-8.c: New test.
* gfortran.dg/gomp/allocate-3.f90: Add tests.
* gcc.dg/gomp/pr104517.c: Update.
gcc/ChangeLog.omp
gcc/omp-low.c
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/gomp/allocate-2.c
gcc/testsuite/c-c++-common/gomp/allocate-8.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/allocate-3.f90