From patchwork Mon Nov 9 19:59:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 541979 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 C8FB9140D8F for ; Tue, 10 Nov 2015 06:59:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=gNbkiv7X; 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=OyEH/ryUkQHAn/QBv 7359wO6VDrOQS6yfSJ2wnWJWFg2QcHEBroHbdBTAJGlxOeU9zSv8aSYExffB7sNJ qzEozJXRQuK1lQozgb1+ZRLwWOxDseZnJWmIG0r0+cnFgQia/XnNqs/xd5Qob9DW /LeBuJrH9SGt3/SBZiVdbJCACA= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=FwkiCjwVrm2DzqHL4lxUh7o ubaY=; b=gNbkiv7XpYl1kht2SVffEc06Nth+GQIn/pkK0Aotv6ZnJYTMGfX8330 4oUh10k64xaxJ/gMJQyeFfroWqnXLdqpLU/rgPkqK3FDYDAIqL5ljRY7ehlHG0Ux semU+ZPdplrNhba666S30zeEavch1XzD2DAF2L+chV23VWDz4aUQ= Received: (qmail 29888 invoked by alias); 9 Nov 2015 19:59:34 -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 28293 invoked by uid 89); 9 Nov 2015 19:59:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Nov 2015 19:59:33 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 1186D19F38E; Mon, 9 Nov 2015 19:59:32 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-203.phx2.redhat.com [10.3.113.203]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA9JxVck010719; Mon, 9 Nov 2015 14:59:31 -0500 Subject: Re: [PATCH] Minor refactoring in tree-ssanames.c & freelists verifier To: Michael Matz References: <5640611C.5090309@redhat.com> Cc: gcc-patches From: Jeff Law Message-ID: <5640FB23.7000108@redhat.com> Date: Mon, 9 Nov 2015 12:59:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes On 11/09/2015 08:00 AM, Michael Matz wrote: > Hi, > > On Mon, 9 Nov 2015, Jeff Law wrote: > > +verify_ssaname_freelists (struct function *fun) > +{ > + /* Do nothing if we are in RTL format. */ > + basic_block bb; > + FOR_EACH_BB_FN (bb, fun) > + { > + if (bb->flags & BB_RTL) > + return; > + } > > gimple_in_ssa_p (fun); Agreed & fixed. > > + /* Then note the operands of each statement. */ > + for (gimple_stmt_iterator gsi = gsi_start_bb (bb); > + !gsi_end_p (gsi); > + gsi_next (&gsi)) > + { > + ssa_op_iter iter; > + gimple *stmt = gsi_stmt (gsi); > + FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, SSA_OP_ALL_OPERANDS) > + if (TREE_CODE (t) == SSA_NAME) > + bitmap_set_bit (names_in_il, SSA_NAME_VERSION (t)); > + } > > t will always be an SSA_NAME here. Likewise. I think that test was in there from a time when I'd run the verifier at a different point in the pipeline and things weren't necessarily consistent. I'll simplify in the obvious way. I put bootstrapped x86_64-linux-gnu with the verifier enabled. Installed on the trunk. Thanks for catching these. Jeff commit 681292298ad97eebda56fa64f00c772c2c3c7e29 Author: law Date: Mon Nov 9 19:56:57 2015 +0000 Re: [PATCH] Minor refactoring in tree-ssanames.c & freelists verifier * tree-ssanames.c (verify_ssaname_freelists): Simplify check for being in gimple/ssa form. Remove redundant check for SSA_NAME. Fix comment typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230049 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7911804..43a8d49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-11-09 Jeff Law + + * tree-ssanames.c (verify_ssaname_freelists): Simplify check for + being in gimple/ssa form. Remove redundant check for SSA_NAME. + Fix comment typo. + 2015-11-09 Michael Meissner * config/rs6000/rs6000.opt (-mpower9-fusion): Add new switches for diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index 096b75b..b599bb5 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -124,17 +124,13 @@ ssanames_print_statistics (void) DEBUG_FUNCTION void verify_ssaname_freelists (struct function *fun) { - /* Do nothing if we are in RTL format. */ - basic_block bb; - FOR_EACH_BB_FN (bb, fun) - { - if (bb->flags & BB_RTL) - return; - } + if (!gimple_in_ssa_p (fun)) + return; bitmap names_in_il = BITMAP_ALLOC (NULL); /* Walk the entire IL noting every SSA_NAME we see. */ + basic_block bb; FOR_EACH_BB_FN (bb, fun) { tree t; @@ -163,8 +159,7 @@ verify_ssaname_freelists (struct function *fun) ssa_op_iter iter; gimple *stmt = gsi_stmt (gsi); FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, SSA_OP_ALL_OPERANDS) - if (TREE_CODE (t) == SSA_NAME) - bitmap_set_bit (names_in_il, SSA_NAME_VERSION (t)); + bitmap_set_bit (names_in_il, SSA_NAME_VERSION (t)); } } @@ -218,7 +213,7 @@ verify_ssaname_freelists (struct function *fun) debug/non-debug compilations have the same SSA_NAMEs. So for each lost SSA_NAME, see if it's likely one from that wart. These will always be marked as default definitions. So we loosely assume that anything - marked as a default definition isn't leaked by pretening they are + marked as a default definition isn't leaked by pretending they are in the IL. */ for (unsigned int i = UNUSED_NAME_VERSION + 1; i < num_ssa_names; i++) if (ssa_name (i) && SSA_NAME_IS_DEFAULT_DEF (ssa_name (i)))