From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1534) id B7E233858D1E; Tue, 20 Jun 2023 11:50:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7E233858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687261831; bh=qawbD8+KZFVN72cb2bHclQjU4XkLkRlG+J9lo8/rDHg=; h=From:To:Subject:Date:From; b=B1lmiVzWNEmQE2RiPUFt998xgY+r8PRO88FwgowKcK42A2TrOBN6VDQeWFXZnJYDM s/hOKS9gcOHtgga7jp2gepPkRHw2HdH8IgzxaMvuKsTvQY68Foa+slozpjaeEns+Ty XWP+LPl3CXpaKK2UzohxUeVBzP8CuwGDOrn4S5XM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Tobias Burnus To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1988] Fortran: Fix parse-dump-tree for OpenMP ALLOCATE clause X-Act-Checkin: gcc X-Git-Author: Tobias Burnus X-Git-Refname: refs/heads/master X-Git-Oldrev: 6f695bfd736c8cc4dd7a93f42f3574aa9f459163 X-Git-Newrev: 99e3214f582b08b69b11b53eb3fc73b0919ef4f1 Message-Id: <20230620115031.B7E233858D1E@sourceware.org> Date: Tue, 20 Jun 2023 11:50:31 +0000 (GMT) List-Id: https://gcc.gnu.org/g:99e3214f582b08b69b11b53eb3fc73b0919ef4f1 commit r14-1988-g99e3214f582b08b69b11b53eb3fc73b0919ef4f1 Author: Tobias Burnus Date: Tue Jun 20 13:46:11 2023 +0200 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. Diff: --- gcc/fortran/dump-parse-tree.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 99c8bdaadce..effcebe9325 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;