From patchwork Sun Feb 14 19:27:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 582529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 1813214031E for ; Mon, 15 Feb 2016 06:28:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=EoV4GShn; dkim-atps=neutral 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=HVf4daVHo3Bks53FMOJxvJadHlGwaC13HoXggcw2dLz1uWDRAB W9vrxR7J77x+nfugzdY++5f8lfQ/Vj7NbRduqROLyV+TY0IeT7vxwmJaYAlPZbYG MxYEAsO/DCIYGdjfGSsUGixEqzNHcJmkodGD9ekX38OGkI5wLR5Kzk6aw= 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=yGkouVkKGn/QdcGcUADwVqKiWQ0=; b=EoV4GShnS7C95cdzD1N+ k6reVw6EFZ2uWUHis6njlhyDiEc0y1DR8UWhHQqsz4ojiSMqLKYY4+qftAi7NmCu ZuTlO9qq5xXfxI7BLzW+L7FVFUn8FFQ14/zEjwKgMO7VwsvD89V0/xkHuTtzwdx9 Jz8kHFmCD+93rkGYOxKnYmA= Received: (qmail 58298 invoked by alias); 14 Feb 2016 19:27:54 -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 58271 invoked by uid 89); 14 Feb 2016 19:27:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL, BAYES_05, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Arbeitskopie, arbeitskopie, sk:dump-pa, sk:dumppa X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout3.netcologne.de Received: from cc-smtpout3.netcologne.de (HELO cc-smtpout3.netcologne.de) (89.1.8.213) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 14 Feb 2016 19:27:51 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id D8AE212579; Sun, 14 Feb 2016 20:27:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id D557311E50; Sun, 14 Feb 2016 20:27:45 +0100 (CET) Received: from [78.35.170.7] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.0.9) (envelope-from ) id 56c0d531-0cb3-7f0000012729-7f000001e06a-1 for ; Sun, 14 Feb 2016 20:27:45 +0100 Received: from [192.168.178.20] (xdsl-78-35-170-7.netcologne.de [78.35.170.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA; Sun, 14 Feb 2016 20:27:44 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran] Two associate fixes in dump-parse-tree.c Message-ID: <56C0D530.9060406@netcologne.de> Date: Sun, 14 Feb 2016 20:27:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 Hello world, the two fixes in the patch - show ASSOCIATE lists if present, to complete the AST dump - fix an ICE where an EXEC_END_BLOCK survived. This can only happen if the END ASSOCIATE or END BLOCK statement had a statement label. If the preference is to use some other format for the ASSOCIATE lists, for example by putting each statement on its own list, I am open to suggestions. Regression-tested (but we don't really test for this). No test case because we don't have the infrastructure for it. No user impact expected (nobody but us developers uses -fdump-fortran-original, I think). OK for trunk? Regards Thomas 2016-02-14 Thomas Koenig * dump-parse-tree.c (show_code_node): Print association list of a block if present. Handle EXEC_END_BLOCK. Index: dump-parse-tree.c =================================================================== --- dump-parse-tree.c (Revision 233410) +++ dump-parse-tree.c (Arbeitskopie) @@ -1773,6 +1773,7 @@ show_code_node (int level, gfc_code *c) { const char* blocktype; gfc_namespace *saved_ns; + gfc_association_list *alist; if (c->ext.block.assoc) blocktype = "ASSOCIATE"; @@ -1780,6 +1781,12 @@ show_code_node (int level, gfc_code *c) blocktype = "BLOCK"; show_indent (); fprintf (dumpfile, "%s ", blocktype); + for (alist = c->ext.block.assoc; alist; alist = alist->next) + { + fprintf (dumpfile, " %s = ", alist->name); + show_expr (alist->target); + } + ++show_level; ns = c->ext.block.ns; saved_ns = gfc_current_ns; @@ -1793,6 +1800,11 @@ show_code_node (int level, gfc_code *c) break; } + case EXEC_END_BLOCK: + /* Only come here when there is a label on an + END ASSOCIATE construct. */ + break; + case EXEC_SELECT: d = c->block; fputs ("SELECT CASE ", dumpfile);