aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2023-06-20 13:46:11 +0200
committerTobias Burnus <tobias@codesourcery.com>2023-06-20 13:49:54 +0200
commit99e3214f582b08b69b11b53eb3fc73b0919ef4f1 (patch)
tree783e8cd7c3f2a08ecfcad144dfd6e5f6e73e9690 /gcc
parent6f695bfd736c8cc4dd7a93f42f3574aa9f459163 (diff)
downloadgcc-99e3214f582b08b69b11b53eb3fc73b0919ef4f1.zip
gcc-99e3214f582b08b69b11b53eb3fc73b0919ef4f1.tar.gz
gcc-99e3214f582b08b69b11b53eb3fc73b0919ef4f1.tar.bz2
Fortran: Fix parse-dump-tree for OpenMP ALLOCATE clause
Commit r14-1301-gd64e8e1224708e added u2.allocator to gfc_omp_namelist for better readability and to permit to use namelist->expr for code like the following: !$omp allocators allocate(align(32) : dt%alloc_comp) allocate (dt%alloc_comp(5)) !$omp allocate(dt%alloc_comp2) align(64) allocate (dt%alloc_comp2(10)) However, for the parse-tree dump the change was incomplete. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator modifier of OMP_LIST_ALLOCATE.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/dump-parse-tree.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index 99c8bda..effcebe 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -1374,7 +1374,7 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
}
if (list_type == OMP_LIST_ALLOCATE)
{
- if (n->expr)
+ if (n->u2.allocator)
{
fputs ("allocator(", dumpfile);
show_expr (n->u2.allocator);
@@ -1388,9 +1388,12 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
show_expr (n->u.align);
fputc (')', dumpfile);
}
- if (n->expr || n->u.align)
+ if (n->u2.allocator || n->u.align)
fputc (':', dumpfile);
- fputs (n->sym->name, dumpfile);
+ if (n->expr)
+ show_expr (n->expr);
+ else
+ fputs (n->sym->name, dumpfile);
if (n->next)
fputs (") ALLOCATE(", dumpfile);
continue;