From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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, 09 Nov 2015 19:59:00 -0000 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: Content-Type: multipart/mixed; boundary="------------020201030602070602010109" X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01085.txt.bz2 This is a multi-part message in MIME format. --------------020201030602070602010109 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1186 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 --------------020201030602070602010109 Content-Type: text/plain; charset=UTF-8; name="P" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="P" Content-length: 2538 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))) --------------020201030602070602010109--