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: 1779636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=AmIzRjCZ; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QGgwj4DV0z214S for ; Thu, 11 May 2023 02:49:25 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 179B83870896 for ; Wed, 10 May 2023 16:49:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 179B83870896 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683737363; 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=AmIzRjCZQ1NVc6Eku74eZaz9jInagXu4QUIqwq3WLheNnl0e/rKIWUGKj4A6Zw3OL a3EvV2BSw6b6i1XgAdQkvXeEffnaefettpIBEtqvft6J47mFEp+LZv5to/4syxEGm8 eBU0FAYe5v4FeZED1lKE/X/3V0av8FvYhYaGnHNk= 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-Google-Smtp-Source: ACHHUZ5Q3iBsml3wKlAnh0zsKKuQWegJ0NESfO7uYFkCycH4wTL3Cwqtjp33oUEwpa3ik4CaugkO1w== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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));