From patchwork Wed May 10 16:48:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 92213 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3769932vqo; Wed, 10 May 2023 09:51:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/xo7Bo/KjoITMHfigLdbqC5Q96VMK9a4EZWtfBPZE/TIEp/djDmXvyYPYqrKd5ib80mVP X-Received: by 2002:a17:907:98c:b0:94a:5819:5a2b with SMTP id bf12-20020a170907098c00b0094a58195a2bmr16505334ejc.33.1683737470100; Wed, 10 May 2023 09:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683737470; cv=none; d=google.com; s=arc-20160816; b=uI0vOXCHkYvFAIxuqFIgnfGn6ifiBNhjTCL1TAmKa6QIfavSAHXWagnurgpgELHjob 0jTNBlUgGilM96bKJXWaRDz+la1jhraRqKq4pEI10/TEBskZ3dlSB+mfeRbvxEBV3mLV i3faYJrv4XTrr7oh9KIYIVHoP0ISDeODJPrcoRhkALmb0jjnetRmI37z802kn/cAQB0j PLimn7gY2+iX95Zei03edSExD4AIGGoUrbFkF/vo1E2OjfQpKLbEeNECE395UCKZ42l4 1V7cv3BmUdPePoqk0IwWNrs62Tw7Uf8jjqEdy2MwusMLijgRlXEeOgWmo+2TaZNCg9Nq MdHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=hyKt3QiD+lKrgnEEuXf9PAWjF9awbG4d7igQip9eUTM=; b=qRT2umaAOtkVDg5ERi02y3K+81VOjqdrqUANj96bWGs/Iy33pahc3FmtJbWn4BP4Jm HdtLag9RZ7uLLBOFE5TQIK0Zrjinb+QXcAlBDdtHdWA8iWvctlzcCXLZ+S6g6i+ICbWk bWlvp/xKqrWCXUHWYksIX/d9ebftNgXT3mWMf+glS0lQxhEt3Q1b7IL1vB6hIEeYomOf 7PBPAvW5MTj5QCh7/mONyFRtk+F4TqD4Ezg63Hfybru1yiPeQflj/S75daFeP7NP0hcD RAMzCZ/XOO80UUr+5kLd/WVl9Fm9qsiXLDFfwo0QB16DZTyp2uRpv6KuroXlNZJKWd7C YxUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pjywJwPR; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ml23-20020a170906cc1700b00965d8137645si3024212ejb.208.2023.05.10.09.51.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 09:51:10 -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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pjywJwPR; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D872E3835E04 for ; Wed, 10 May 2023 16:49:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D872E3835E04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683737387; bh=hyKt3QiD+lKrgnEEuXf9PAWjF9awbG4d7igQip9eUTM=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=pjywJwPRap7q9Nm8eo841B2CZT+9wORLM6ERRGkTku8DRvB1i71JVKngffGl0CVAE vuxLzB6Mek2DTBTYYXVCqgwQ/7rV/l//1bqrhgHn/BGx0NTzCxYyUIUnsMzOLVgrVz lVPXJlmkA5euyITeL3o8F4murCZlmyfLPYt2c810= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 38C4B3876880; Wed, 10 May 2023 16:49:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 38C4B3876880 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9659f452148so1324109666b.1; Wed, 10 May 2023 09:49:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683737340; x=1686329340; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hyKt3QiD+lKrgnEEuXf9PAWjF9awbG4d7igQip9eUTM=; b=gbqmopfiJZ7T6x7mJ2r8DUFeCD+An8NeVSOWHkz5nZwcN4OWoGx4bMTqATKUzaQS2c oQn6p/vmvxIAWp5RDXCPR9+KR2skqfK+cFsNKCgYKuMKlY37RikOE7wC6jk2ReTi8zws aRwaA8pLvAUo+bRbNVM7kkYU+detgeTetEsnVQjmRryD8yRh0QTP1y2d9X+TT/QU0Nw1 Sz668bgGHJ1xoqWY749Y9sDr6jONmxvRQo1lTGPBvqoSMn/SlvHK8sorwsTeQZp86jUf 2EwBg2XtiojRFMG8U/MDQFq/8+IPYKXuf0kHp+ecbfCmjR9zhXSom7+4yPyLv0zteQHg YO2g== X-Gm-Message-State: AC+VfDxTV0CD7TavJVm+kGYIssW9ja7C38qy7gFqzF2irISs2uECdPvY jfsQF+JgPJdztQr4ZOUIJggeeSsYcoU= X-Received: by 2002:a17:907:3da3:b0:95e:d74c:b06 with SMTP id he35-20020a1709073da300b0095ed74c0b06mr18873742ejc.64.1683737340436; Wed, 10 May 2023 09:49:00 -0700 (PDT) Received: from nbbrfq (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id p3-20020a17090664c300b0094f2f1c5ea1sm2925212ejn.174.2023.05.10.09.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 09:48:59 -0700 (PDT) Received: from b by nbbrfq with local (Exim 4.96) (envelope-from ) id 1pwmzq-000eXP-2r; Wed, 10 May 2023 18:48:58 +0200 To: fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org, Bernhard Reutner-Fischer Subject: [PATCH 1/2] Fortran: dump-parse-tree attribs: fix unbalanced braces [PR109624] Date: Wed, 10 May 2023 18:48:40 +0200 Message-Id: <20230510164841.155816-1-rep.dot.nop@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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: , X-Patchwork-Original-From: Bernhard Reutner-Fischer via Gcc-patches From: Bernhard Reutner-Fischer Reply-To: Bernhard Reutner-Fischer 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?1765526701323937765?= X-GMAIL-MSGID: =?utf-8?q?1765526701323937765?= From: Bernhard Reutner-Fischer gcc/fortran/ChangeLog: PR fortran/109624 * dump-parse-tree.cc (debug): New function for gfc_namespace. (gfc_debug_code): Delete forward declaration. (show_attr): Make sure to print balanced braces. --- (gdb) call debug(gfc_current_ns) Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4) procedure name = fmodule symtree: 'C_ptr' || symbol: 'c_ptr' type spec : (UNKNOWN 0) attributes: ) There is an open brace missing after "attributes: " Regression tested on x86_64-linux, OK for trunk? --- gcc/fortran/dump-parse-tree.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 1fc1f311e84..2380fa04796 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -125,6 +125,16 @@ void debug (gfc_ref *p) dumpfile = tmp; } +void +debug (gfc_namespace *ns) +{ + FILE *tmp = dumpfile; + dumpfile = stderr; + show_namespace (ns); + fputc ('\n', dumpfile); + dumpfile = tmp; +} + void gfc_debug_expr (gfc_expr *e) { @@ -136,7 +146,6 @@ gfc_debug_expr (gfc_expr *e) } /* Allow for dumping of a piece of code in the debugger. */ -void gfc_debug_code (gfc_code *c); void gfc_debug_code (gfc_code *c) @@ -758,12 +767,13 @@ show_expr (gfc_expr *p) static void show_attr (symbol_attribute *attr, const char * module) { + fputc ('(', dumpfile); if (attr->flavor != FL_UNKNOWN) { if (attr->flavor == FL_DERIVED && attr->pdt_template) - fputs (" (PDT-TEMPLATE", dumpfile); + fputs ("PDT-TEMPLATE ", dumpfile); else - fprintf (dumpfile, "(%s ", gfc_code2string (flavors, attr->flavor)); + fprintf (dumpfile, "%s ", gfc_code2string (flavors, attr->flavor)); } if (attr->access != ACCESS_UNKNOWN) fprintf (dumpfile, "%s ", gfc_code2string (access_types, attr->access));