diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-09-22 09:29:13 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-09-22 09:29:13 +0200 |
commit | 059b819e3c94aae3dd0be55bd512ee6ee4e28798 (patch) | |
tree | bb8b074085f64d452820b382f51a65c04cf26448 /gcc/cp/typeck2.c | |
parent | 578b76873383784841f5478573f4ac5d251aa0ba (diff) | |
download | gcc-059b819e3c94aae3dd0be55bd512ee6ee4e28798.zip gcc-059b819e3c94aae3dd0be55bd512ee6ee4e28798.tar.gz gcc-059b819e3c94aae3dd0be55bd512ee6ee4e28798.tar.bz2 |
openmp: Add support for allocator and align modifiers on allocate clauses
As the allocate-2.c testcase shows, this change isn't 100% backwards compatible,
one could have allocate and/or align functions that return an OpenMP allocator
handle and previously it would call those functions and now would use those
names as keywords for the modifiers. But it allows specify extra alignment
requirements for the allocations.
2021-09-22 Jakub Jelinek <jakub@redhat.com>
gcc/
* tree.h (OMP_CLAUSE_ALLOCATE_ALIGN): Define.
* tree.c (omp_clause_num_ops): Change number of OMP_CLAUSE_ALLOCATE
arguments from 2 to 3.
* tree-pretty-print.c (dump_omp_clause): Print allocator() around
allocate clause allocator and print align if present.
* omp-low.c (scan_sharing_clauses): Force allocate_map entry even
for omp_default_mem_alloc if align modifier is present. If align
modifier is present, use TREE_LIST to encode both allocator and
align.
(lower_private_allocate, lower_rec_input_clauses, create_task_copyfn):
Handle align modifier on allocator clause if present.
gcc/c-family/
* c-omp.c (c_omp_split_clauses): Copy over OMP_CLAUSE_ALLOCATE_ALIGN.
gcc/c/
* c-parser.c (c_parser_omp_clause_allocate): Parse allocate clause
modifiers.
gcc/cp/
* parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
modifiers.
* semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
* pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
also OMP_CLAUSE_ALLOCATE_ALIGN.
gcc/testsuite/
* c-c++-common/gomp/allocate-6.c: New test.
* c-c++-common/gomp/allocate-7.c: New test.
* g++.dg/gomp/allocate-4.C: New test.
libgomp/
* testsuite/libgomp.c-c++-common/allocate-2.c: New test.
* testsuite/libgomp.c-c++-common/allocate-3.c: New test.
Diffstat (limited to 'gcc/cp/typeck2.c')
0 files changed, 0 insertions, 0 deletions