From patchwork Sun Jun 16 08:41:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 1116507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-503024-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=netcologne.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="a60KGO/h"; dkim=pass (2048-bit key; unprotected) header.d=netcologne.de header.i=@netcologne.de header.b="NblvFQP8"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45RSX705kkz9s7h for ; Sun, 16 Jun 2019 18:42:25 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=DHoSoF/ij9XEw3RzeL+fLsMBS9c+P5N5TGaF168/FpOCIdUMfG JXMhcbmERrXscvw40bYqRpNIwVfJXEq03Eifx7r9efutgVM7VGDI0IJeWcr0r61W rRKZzDgJiHGlaMANfkEiFGmt+VmSZxf6IaoafNW6SxKlxu/jPXR4E55OE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=E1XfZleyNCfwKV7bhaZCmzD5yf4=; b=a60KGO/hmRSVPnC6Vf2n dQzivFrvza+Ph8G7WcoBRQbZ6XIyOVqvFN9kjdmfAA8v8FBGrgjEXkcxHAHflkOK HBo5x6SdgNteAkF8rsmXynJePBzdwgR8IeUk+hh5Yjx+6ebEawR/QiJ+LQiOPYOq zTH22fcewiJmL94z6r89zHs= Received: (qmail 110979 invoked by alias); 16 Jun 2019 08:42:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 110966 invoked by uid 89); 16 Jun 2019 08:42:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=*tmp, gfc_expr, 271945, H*r:2001 X-HELO: cc-smtpout1.netcologne.de Received: from cc-smtpout1.netcologne.de (HELO cc-smtpout1.netcologne.de) (89.1.8.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 16 Jun 2019 08:42:12 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 246BF130D6; Sun, 16 Jun 2019 10:42:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=netcologne.de; s=nc1116a; t=1560674526; bh=4mJnwHOzVfo1PpZ5+z+AyDOCNWnZdm4/9krD1C7oaKE=; h=To:From:Subject:Message-ID:Date:From; b=NblvFQP8AUzijN9mX3czrgwcHPt9zTJpb1r/wDhcNKFIP/y7N/dNTpIXUrFZ8aaBU pu63hF11m3v5tuVpFIerVTl7HWd0jYCdsO86FPAv/nmEV824AMIEoGm99r2Lw9PThc PWNS+S7br5bCuXaVwb2lYXYRa/MScX35C4Ksj2KZ9cB+Z97K9Kp/5QJO/GoNeSoQMC EMdBqFiDq4C9LY7DUJr1N9k4nqUGzSDQFd/M5olHLluMiX4j3qvpiEd8YgnPt/7py6 zAw9p+Byhuw1GNnpQrZOVBWy8lFzs/mviCP3p2ZfJIFirb+w6VLqWcs1OxG3oypu7Z IjMQH9yZblxCg== Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id 1E5F811D8D; Sun, 16 Jun 2019 10:42:06 +0200 (CEST) Received: from [2001:4dd7:e391:0:7285:c2ff:fe6c:992d] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.6.0) (envelope-from ) id 5d0600de-0155-7f0000012729-7f000001ae7e-1 for ; Sun, 16 Jun 2019 10:42:06 +0200 Received: from [IPv6:2001:4dd7:e391:0:7285:c2ff:fe6c:992d] (2001-4dd7-e391-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de [IPv6:2001:4dd7:e391:0:7285:c2ff:fe6c:992d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA; Sun, 16 Jun 2019 10:42:02 +0200 (CEST) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran, committed] Improve internal compiler debugging Message-ID: <96f40de0-d2f0-f754-56e3-7c73459266a0@netcologne.de> Date: Sun, 16 Jun 2019 10:41:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 Hi, I just committed the attached patch as obvious ans simple. No impact on user code, just to make internal debugging easier. Regards Thomas 2019-06-16 Thomas Koenig * dump_parse_tree (debug): Add verison for formal arglist. Do not crash when a gfc_expr is NULL. Index: dump-parse-tree.c =================================================================== --- dump-parse-tree.c (Revision 271945) +++ dump-parse-tree.c (Arbeitskopie) @@ -66,6 +66,19 @@ dumpfile = tmp; } +void debug (gfc_formal_arglist *formal) +{ + FILE *tmp = dumpfile; + dumpfile = stderr; + for (; formal; formal = formal->next) + { + fputc ('\n', dumpfile); + show_symbol (formal->sym); + } + fputc ('\n', dumpfile); + dumpfile = tmp; +} + void debug (symbol_attribute attr) { debug (&attr); @@ -75,9 +88,15 @@ { FILE *tmp = dumpfile; dumpfile = stderr; - show_expr (e); - fputc (' ', dumpfile); - show_typespec (&e->ts); + if (e != NULL) + { + show_expr (e); + fputc (' ', dumpfile); + show_typespec (&e->ts); + } + else + fputs ("() ", dumpfile); + fputc ('\n', dumpfile); dumpfile = tmp; }