diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2023-07-17 15:13:44 +0200 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2023-07-17 15:13:44 +0200 |
commit | 89d0f082b3c95f68d116d4480126e3ab7fb7f36b (patch) | |
tree | 7557873cf77418874acbae1699b1e8e5b77845a3 /gcc/fortran/st.cc | |
parent | 3b9cd125cfca44d3ae18f409fb20b5c094829e41 (diff) | |
download | gcc-89d0f082b3c95f68d116d4480126e3ab7fb7f36b.zip gcc-89d0f082b3c95f68d116d4480126e3ab7fb7f36b.tar.gz gcc-89d0f082b3c95f68d116d4480126e3ab7fb7f36b.tar.bz2 |
OpenMP/Fortran: Parsing support for 'uses_allocators'
The 'uses_allocators' clause to the 'target' construct accepts predefined
allocators and can also be used to define a new allocator for a target region.
As predefined allocators in GCC do not require special handling, those can and
are ignored after parsing, such that this feature now works. On the other hand,
defining a new allocator will fail for now with a 'sorry, unimplemented'.
Note that both the OpenMP 5.0/5.1 and 5.2 syntax for uses_allocators
is supported by this commit.
2023-07-17 Tobias Burnus <tobias@codesoucery.com>
Chung-Lin Tang <cltang@codesourcery.com>
gcc/fortran/ChangeLog:
* dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Dump
uses_allocators clause.
* gfortran.h (gfc_free_omp_namelist): Add memspace_sym to u union
and traits_sym to u2 union.
(OMP_LIST_USES_ALLOCATORS): New enum value.
(gfc_free_omp_namelist): Add 'bool free_mem_traits_space' arg.
* match.cc (gfc_free_omp_namelist): Likewise.
* openmp.cc (gfc_free_omp_clauses, gfc_match_omp_variable_list,
gfc_match_omp_to_link, gfc_match_omp_doacross_sink,
gfc_match_omp_clause_reduction, gfc_match_omp_allocate,
gfc_match_omp_flush): Update call.
(gfc_match_omp_clauses): Likewise. Parse uses_allocators clause.
(gfc_match_omp_clause_uses_allocators): New.
(enum omp_mask2): Add new OMP_CLAUSE_USES_ALLOCATORS.
(OMP_TARGET_CLAUSES): Accept it.
(resolve_omp_clauses): Resolve uses_allocators clause
* st.cc (gfc_free_statement): Update gfc_free_omp_namelist call.
* trans-openmp.cc (gfc_trans_omp_clauses): Handle
OMP_LIST_USES_ALLOCATORS; fail with sorry unless predefined allocator.
(gfc_split_omp_clauses): Handle uses_allocators.
libgomp/ChangeLog:
* testsuite/libgomp.fortran/uses_allocators_1.f90: New test.
* testsuite/libgomp.fortran/uses_allocators_2.f90: New test.
Co-authored-by: Chung-Lin Tang <cltang@codesourcery.com>
Diffstat (limited to 'gcc/fortran/st.cc')
-rw-r--r-- | gcc/fortran/st.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/st.cc b/gcc/fortran/st.cc index 55debca..b6d87c4 100644 --- a/gcc/fortran/st.cc +++ b/gcc/fortran/st.cc @@ -288,7 +288,7 @@ gfc_free_statement (gfc_code *p) break; case EXEC_OMP_FLUSH: - gfc_free_omp_namelist (p->ext.omp_namelist, false, false); + gfc_free_omp_namelist (p->ext.omp_namelist, false, false, false); break; case EXEC_OMP_BARRIER: |