]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP: Add ME support for 'omp allocate' stack variables
authorTobias Burnus <tobias@codesourcery.com>
Wed, 20 Sep 2023 14:03:19 +0000 (16:03 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 20 Sep 2023 14:03:19 +0000 (16:03 +0200)
commit1a554a2c9f33fdb3c170f1c37274037ece050114
tree6fe2af4bde5515e04ec8af01de59a40a3fcde3dd
parentb9cb735fc1bb4ca2339ab900e2d07667d7c0f6b4
OpenMP: Add ME support for 'omp allocate' stack variables

Call GOMP_alloc/free for 'omp allocate' allocated variables. This is
for C only as C++ and Fortran show a sorry already in the FE. Note that
this only applies to stack variables as the C FE shows a sorry for
static variables.

gcc/ChangeLog:

* gimplify.cc (gimplify_bind_expr): Call GOMP_alloc/free for
'omp allocate' variables; move stack cleanup after other
cleanup.
(omp_notice_variable): Process original decl when decl
of the value-expression for a 'omp allocate' variable is passed.
* omp-low.cc (scan_omp_1_op): Handle 'omp allocate' variables

libgomp/ChangeLog:

* libgomp.texi (OpenMP 5.1 Impl.): Mark 'omp allocate' as
implemented for C only.
* testsuite/libgomp.c/allocate-4.c: New test.
* testsuite/libgomp.c/allocate-5.c: New test.
* testsuite/libgomp.c/allocate-6.c: New test.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/allocate-11.c: Remove C-only dg-message
for 'sorry, unimplemented'.
* c-c++-common/gomp/allocate-12.c: Likewise.
* c-c++-common/gomp/allocate-15.c: Likewise.
* c-c++-common/gomp/allocate-9.c: Likewise.
* c-c++-common/gomp/allocate-10.c: New test.
* c-c++-common/gomp/allocate-17.c: New test.
12 files changed:
gcc/gimplify.cc
gcc/omp-low.cc
gcc/testsuite/c-c++-common/gomp/allocate-10.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/allocate-11.c
gcc/testsuite/c-c++-common/gomp/allocate-12.c
gcc/testsuite/c-c++-common/gomp/allocate-15.c
gcc/testsuite/c-c++-common/gomp/allocate-17.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/allocate-9.c
libgomp/libgomp.texi
libgomp/testsuite/libgomp.c/allocate-4.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/allocate-5.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/allocate-6.c [new file with mode: 0644]