From patchwork Sun Oct 8 12:57:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 823004 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-463710-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="N7Ze1J6t"; 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 3y93MK5Rtbz9t34 for ; Sun, 8 Oct 2017 23:58:03 +1100 (AEDT) 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=KkIOGWFzuRwFcvErzhj2YWjB8YdUGjehQZsdkWktphTdfwXFPk xFFGUeHf9Lg33ICXjd+7XmeXAhNQcNx1bB4BBIsF4KzVepkZbzT2mMoi5ty5KiTL uO+H6myaBJeo5QdHqzNl94Wg3czVqIHxTGeYopJ3A+x/O1ZaT6bH6ZPhk= 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=CdhrQ65+qTs/FG7TOqelWHYA8ok=; b=N7Ze1J6tAijJ3TrMiBOt MMO2Z2VvQkXvxbFBwOFKiIVbVVugcUEkg1Kh8RvQxlvtQWeOSfc4B4GpxD+/aV2Q aMhnWWJI289zbl0EN8498EYucW0Dn/WnyN/49fZuTFEG+S/AvwJr7JsrhaetJXfr C0EZxJFT8lF+pTuObaju9Ug= Received: (qmail 79456 invoked by alias); 8 Oct 2017 12:57:51 -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 79438 invoked by uid 89); 8 Oct 2017 12:57:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=guaranteed, Small, snl, interest X-Spam-User: qpsmtpd, 2 recipients 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, 08 Oct 2017 12:57:48 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 8190E12D44; Sun, 8 Oct 2017 14:57:45 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id 7311911DBE; Sun, 8 Oct 2017 14:57:45 +0200 (CEST) Received: from [78.35.132.98] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 59da20c9-02b7-7f0000012729-7f000001a3c4-1 for ; Sun, 08 Oct 2017 14:57:45 +0200 Received: from [192.168.178.20] (xdsl-78-35-132-98.netcologne.de [78.35.132.98]) (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, 8 Oct 2017 14:57:44 +0200 (CEST) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran, committed] Small -fdump-fortran-original fixes, plus documentation update Message-ID: <44982d74-aac3-c2dd-7395-146362af16f3@netcologne.de> Date: Sun, 8 Oct 2017 14:57:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Hello world, I have committed a few small fixes for -fdump-fortran-original and friends. Since there was interest on c.l.f from somebdoy who actually wanted to use the dump for something useful, I have also clarified in the docs that this is something that is not guaranteed to work between releases. Regards Thomas 2017-10-08 Thomas Koenig * dump_prase_tree (show_symbol): Output list of variables in NAMELIST. (show_code_node): Add new line for ELSE and END DO for DO CONCURRENT. * invoke.texi: Document that the output of -fdump-fortran-original, -fdump-fortran-optimized and -fdump-parse-tree is unsable and may lead to ICEs. Index: dump-parse-tree.c =================================================================== --- dump-parse-tree.c (Revision 253381) +++ dump-parse-tree.c (Arbeitskopie) @@ -967,8 +967,17 @@ show_symbol (gfc_symbol *sym) show_indent (); fputs ("PDT parameters", dumpfile); show_actual_arglist (sym->param_list); + } + if (sym->attr.flavor == FL_NAMELIST) + { + gfc_namelist *nl; + show_indent (); + fputs ("variables : ", dumpfile); + for (nl = sym->namelist; nl; nl = nl->next) + fprintf (dumpfile, " %s",nl->sym->name); } + --show_level; } @@ -1979,8 +1988,8 @@ show_code_node (int level, gfc_code *c) d = d->block; for (; d; d = d->block) { + fputs("\n", dumpfile); code_indent (level, 0); - if (d->expr1 == NULL) fputs ("ELSE", dumpfile); else @@ -2170,9 +2179,12 @@ show_code_node (int level, gfc_code *c) fputc (',', dumpfile); } show_expr (c->expr1); + ++show_level; show_code (level + 1, c->block->next); + --show_level; code_indent (level, c->label1); + show_indent (); fputs ("END DO", dumpfile); break; Index: invoke.texi =================================================================== --- invoke.texi (Revision 253377) +++ invoke.texi (Arbeitskopie) @@ -1120,20 +1120,28 @@ either your program or the GNU Fortran compiler. @item -fdump-fortran-original @opindex @code{fdump-fortran-original} Output the internal parse tree after translating the source program -into internal representation. Only really useful for debugging the -GNU Fortran compiler itself. +into internal representation. This option is mostly useful for +debugging the GNU Fortran compiler itself. The output generated by +this option might change between releases. This option may also +generate internal compiler errors for features which have only +recently been added. @item -fdump-fortran-optimized @opindex @code{fdump-fortran-optimized} -Output the parse tree after front-end optimization. Only really -useful for debugging the GNU Fortran compiler itself. +Output the parse tree after front-end optimization. Mostly useful for +debugging the GNU Fortran compiler itself. The output generated by +this option might change between releases. This option may also +generate internal compiler errors for features which have only +recently been added. @item -fdump-parse-tree @opindex @code{fdump-parse-tree} Output the internal parse tree after translating the source program -into internal representation. Only really useful for debugging the -GNU Fortran compiler itself. This option is deprecated; use -@code{-fdump-fortran-original} instead. +into internal representation. Mostly useful for debugging the GNU +Fortran compiler itself. The output generated by this option might +change between releases. This option may also generate internal +compiler errors for features which have only recently been added. This +option is deprecated; use @code{-fdump-fortran-original} instead. @item -ffpe-trap=@var{list} @opindex @code{ffpe-trap=}@var{list}