diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2022-12-09 21:45:37 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2022-12-09 21:45:37 +0100 |
commit | b2e1c49b4a4592f9e96ae9ece8af7d0e6527b194 (patch) | |
tree | 2ff8c340654035539084af7e525b77be0a350023 /gcc/fortran/dump-parse-tree.cc | |
parent | 71b31d13757ae0f544651c29b113ccf120573760 (diff) | |
download | gcc-b2e1c49b4a4592f9e96ae9ece8af7d0e6527b194.zip gcc-b2e1c49b4a4592f9e96ae9ece8af7d0e6527b194.tar.gz gcc-b2e1c49b4a4592f9e96ae9ece8af7d0e6527b194.tar.bz2 |
Fortran/OpenMP: align/allocator modifiers to the allocate clause
gcc/fortran/ChangeLog:
* dump-parse-tree.cc (show_omp_namelist): Improve OMP_LIST_ALLOCATE
output.
* gfortran.h (struct gfc_omp_namelist): Add 'align' to 'u'.
(gfc_free_omp_namelist): Add bool arg.
* match.cc (gfc_free_omp_namelist): Likewise; free 'u.align'.
* openmp.cc (gfc_free_omp_clauses, gfc_match_omp_clause_reduction,
gfc_match_omp_flush): Update call.
(gfc_match_omp_clauses): Match 'align/allocate modifers in
'allocate' clause.
(resolve_omp_clauses): Resolve align.
* st.cc (gfc_free_statement): Update call
* trans-openmp.cc (gfc_trans_omp_clauses): Handle 'align'.
libgomp/ChangeLog:
* libgomp.texi (5.1 Impl. Status): Split allocate clause/directive
item about 'align'; mark clause as 'Y' and directive as 'N'.
* testsuite/libgomp.fortran/allocate-2.f90: New test.
* testsuite/libgomp.fortran/allocate-3.f90: New test.
Diffstat (limited to 'gcc/fortran/dump-parse-tree.cc')
-rw-r--r-- | gcc/fortran/dump-parse-tree.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 2f042ab..5ae72dc 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -1357,6 +1357,29 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n) } ns_iter = n->u2.ns; } + if (list_type == OMP_LIST_ALLOCATE) + { + if (n->expr) + { + fputs ("allocator(", dumpfile); + show_expr (n->expr); + fputc (')', dumpfile); + } + if (n->expr && n->u.align) + fputc (',', dumpfile); + if (n->u.align) + { + fputs ("allocator(", dumpfile); + show_expr (n->u.align); + fputc (')', dumpfile); + } + if (n->expr || n->u.align) + fputc (':', dumpfile); + fputs (n->sym->name, dumpfile); + if (n->next) + fputs (") ALLOCATE(", dumpfile); + continue; + } if (list_type == OMP_LIST_REDUCTION) switch (n->u.reduction_op) { |