From patchwork Tue Jun 20 12:01:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 110446 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3609590vqr; Tue, 20 Jun 2023 05:02:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vQd0dU8kT6IHnrpYusSe0Lh5XQnU5KMbJXHwis31Ia4wj7OV3du2RUlZiByF8DSV8EolB X-Received: by 2002:a17:907:806:b0:974:5e14:29c0 with SMTP id wv6-20020a170907080600b009745e1429c0mr12346218ejb.21.1687262559037; Tue, 20 Jun 2023 05:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687262559; cv=none; d=google.com; s=arc-20160816; b=M4RbzRJJka7P4aho4mgFohODt3jy20Knr4atTxrNAi5hOGfiApnNEsh3tvileQ4pfc eN8/aBmdBVVT+zCZDF71fPs5tNsDHrJIHzj5ikQg/A4HJdeFuQZM1KBoEtRl9xuEPUfO aEJeB6tcSCItU20EMkFMQ2B6Jn7S01PwYtybR1G3YdI6q2+cG8lXDzpTpo/Qofi1tBw6 OUZYKIPtHbArDw6loGYS/zXnImODVoF3taUj5ydjtd7q8YCOtKGVAPqgSaffzZxury/N M2ylSsz6RFbzsJVA8cGZxJt3Q9sjRHXoePU2P4Cyh8Lj8bvUmtI1vkh4UCpJmQP1C5br 66dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:delivered-to; bh=eBqlDEx7e+i0Ytqf23Qlfw91GE23BFHxbkw8gEtmnS8=; b=0P4/AHAG5gt9KlOp+d70EnagFmaJWDhKkXgTrFMFn7fcQgeOrwSYtyu1bZo38Ah4q/ 6uFF0W53HD/oN/XMgoJA8ssjepUliyXfUy+KmZJoe7xRolvPb6JYABgaXZMPCWU655q2 aMGA/yWpNMtxjKm09EpI2OcEpfyQsTcbOwVuxDoqHG2vKsG7lt3NrtgrGHNXiQGOTGUr 0F72V9ag1TjZuoZVs5NZtU7+d0/6wO+MnMUYuZaR03R8lPjKhWBGNa/Ld8Ay8IsoisHz rlIYicvi0DZzgdrXUHP77U0pj+vHHTcqW3/q3WhYJfpWJYdg31ySVWaaBejYmtZRs05F GThA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b22-20020a170906709600b00987a085f37esi1076855ejk.420.2023.06.20.05.02.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jun 2023 05:02:39 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8697D3857344 for ; Tue, 20 Jun 2023 12:02:20 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 454503858D1E; Tue, 20 Jun 2023 12:01:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 454503858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.00,257,1681200000"; d="diff'?scan'208";a="9325982" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 20 Jun 2023 04:01:53 -0800 IronPort-SDR: 7lahKvOtSTuyGluM45wODB4fN2R88ofiJShgj97YMkSeON6LGIRcQ4lU9j0Z7jrdaqB8VAi3k4 jL3jtJONIFXO/BUKWfJ3DAlsnr/WFRqbZ7F9FA7hr8Y9WqavMb16QF4FgB8zBquS36h0DQN7FH UN7MSxmJdmp2MnPWlzSvGEnvy5fMGfYfNvbyONHjiTKvCmS12Ixb8GDTJjArnIKUMxYsrA1PZN xLQPpKbtMXQYHntyyHIZKE524TJzlYhXlEjl1+7Z9cQozCzNmDMT8gvwnfVNSCnTVeJicbzIge ijo= Message-ID: Date: Tue, 20 Jun 2023 14:01:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US To: gcc-patches , fortran From: Tobias Burnus Subject: [committed] Fortran: Fix parse-dump-tree for OpenMP ALLOCATE clause X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769223025284918341?= X-GMAIL-MSGID: =?utf-8?q?1769223025284918341?= A rather obvious fix. The allocator(...) bit showed up with -fdump-parse-tree. Committed as Rev. r14-1988-g99e3214f582b08 Side remark: Regarding the example inside the commit log: OpenMP 5.1 permitted derived-type components. Due to global wording changes, OpenMP 5.2 disabled it for both the new 'allocators' and for the old 'allocate' directive. This turned out to be an accidental change and it will be permitted in a future OpenMP version again (for 'allocators' as the executable form of the 'allocate' directive was deprecated and then removed; in GCC, we will have to support it for both for legacy support reasons). – While n->expr is now support for the dump, it is currently unreachable as dt-component parsing is disabled for both allocate and allocators. (To be changed.) Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 commit 99e3214f582b08b69b11b53eb3fc73b0919ef4f1 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 --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 @@ -1370,31 +1370,34 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n) fputc (list_type == OMP_LIST_AFFINITY ? ':' : ',', dumpfile); } } ns_iter = n->u2.ns; } if (list_type == OMP_LIST_ALLOCATE) { - if (n->expr) + if (n->u2.allocator) { fputs ("allocator(", dumpfile); show_expr (n->u2.allocator); fputc (')', dumpfile); } if (n->expr && n->u.align) fputc (',', dumpfile); if (n->u.align) { fputs ("align(", dumpfile); 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; } if (list_type == OMP_LIST_REDUCTION) switch (n->u.reduction_op) {