]> 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>
Fri, 6 May 2022 09:45:05 +0000 (10:45 +0100)
commit1a8c4d9ed36556a95bd7d53c04d2ec4c95594061
treed3fb88f1fbe3f66e9c1e85431540fb79131dd8f4
parent8025f29fbd8f87e27354b69d0bc9eb8d1aeae94c
Add a restriction on allocate clause (OpenMP 5.0)

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.cc (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/omp-low.cc
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/gcc.dg/gomp/pr104517.c
gcc/testsuite/gfortran.dg/gomp/allocate-3.f90