From patchwork Mon Jun 13 16:12:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 634708 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 3rSyVs3QxZz9t0q for ; Tue, 14 Jun 2016 02:13:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=xlKbU/Sr; 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=GbETbOx7Gtp47RgF 6p+RBn2eazDR6FgNWF5zzYX5vG3PqULtDLg+ncZsBXC5aJpZN94TCpkjIRRp7yc+ +9FWRsq3mMMb9AdDJCJfDl3NCfaqeIi3MaeGdmlW+N3FL0jWOHUfTX/YDz2h/kSs cj2TpoLd0k9ef8d/o7WS/M0hasY= 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=30MO2dCNPo2BJxAAVRO71C A9V84=; b=xlKbU/Sr2GCVDYD32N70U1Ef9TDGIWNUE+9ep9EwPuV1q8PTFuaZtt +g/CB61LtupLwo6kWYLtJnV+kE/C3bgC1z+Tu6ssJ8Gm6/wuuLhnbTr8NCprxe5O 4pqxPTSSTw4xnzg7T4QAk9rDPSXEOj3JyhPm7uO7ZF0brbFMmOmCU= Received: (qmail 52419 invoked by alias); 13 Jun 2016 16:13:00 -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 52408 invoked by uid 89); 13 Jun 2016 16:12:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=Steven, Hx-languages-length:4247, typos, H*r:PDT X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 13 Jun 2016 16:12:49 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1bCUTm-0006TD-EN from Thomas_Schwinge@mentor.com ; Mon, 13 Jun 2016 09:12:46 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Mon, 13 Jun 2016 09:12:46 -0700 Received: by tftp-cs (Postfix, from userid 49978) id 73BFCC21C6; Mon, 13 Jun 2016 09:12:45 -0700 (PDT) From: Thomas Schwinge To: GCC Patches CC: Steven Bosscher Subject: Fix CASE_CHAIN typos (was: [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c) In-Reply-To: References: User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Mon, 13 Jun 2016 18:12:35 +0200 Message-ID: <8760tdnk3w.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Wed, 18 Apr 2012 17:32:08 +0200, Steven Bosscher wrote: > Subject says all. Will commit as obvious. > > * tree.def (CASE_LABEL_EXPR): Fix documentation, mention all operands. > * tree-cfg.c (edge_to_cases): Fix documentation. > --- tree.def (revision 186526) > +++ tree.def (working copy) > @@ -876,10 +876,16 @@ DEFTREECODE (LOOP_EXPR, "loop_expr", tcc_statement > of all the cases. */ > DEFTREECODE (SWITCH_EXPR, "switch_expr", tcc_statement, 3) > > -/* Used to represent a case label. The operands are CASE_LOW and > - CASE_HIGH, respectively. If CASE_LOW is NULL_TREE, the label is a > - 'default' label. If CASE_HIGH is NULL_TREE, the label is a normal case > - label. CASE_LABEL is the corresponding LABEL_DECL. */ > +/* Used to represent a case label. > + > + Operand 0 is CASE_LOW. It may be NULL_TREE, in which case the label > + is a 'default' label. > + Operand 1 is CASE_HIGH. If it is NULL_TREE, the label is a simple > + (one-value) case label. If it is non-NULL_TREE, the case is a range. > + Operand 2 is CASE_LABEL, which is is the corresponding LABEL_DECL. > + Operand 4 is CASE_CHAIN. This operand is only used in tree-cfg.c to > + speed up the lookup of case labels which use a particular edge in > + the control flow graph. */ > DEFTREECODE (CASE_LABEL_EXPR, "case_label_expr", tcc_statement, 4) Typo: the last one's operand 3 not 4. ;-) > --- tree-cfg.c (revision 186526) > +++ tree-cfg.c (working copy) > @@ -56,7 +56,7 @@ static const int initial_cfg_capacity = 20; > > /* This hash table allows us to efficiently lookup all CASE_LABEL_EXPRs > which use a particular edge. The CASE_LABEL_EXPRs are chained together > - via their TREE_CHAIN field, which we clear after we're done with the > + via their CASE_CHAIN field, which we clear after we're done with the > hash table to prevent problems with duplication of GIMPLE_SWITCHes. > > Access to this list of CASE_LABEL_EXPRs allows us to efficiently The thing doing the "clear after we're done" likewise needs to get its documentation updated. ;-) As obvious, committed to trunk in r237384: commit 00091facd9b1a23f371a11b4c48e7a106f6d1011 Author: tschwinge Date: Mon Jun 13 16:10:35 2016 +0000 Fix CASE_CHAIN typos gcc/ * tree-cfg.c (edge_to_cases_cleanup): Fix CASE_CHAIN typo. * tree.def (CASE_LABEL_EXPR): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237384 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/tree-cfg.c | 2 +- gcc/tree.def | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) Grüße Thomas diff --git gcc/ChangeLog gcc/ChangeLog index c2f0f7e..733e512 100644 --- gcc/ChangeLog +++ gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-06-13 Thomas Schwinge + + * tree-cfg.c (edge_to_cases_cleanup): Fix CASE_CHAIN typo. + * tree.def (CASE_LABEL_EXPR): Likewise. + 2016-06-13 Bernd Edlinger * input.c (test_builtins): Fix an assertion. diff --git gcc/tree-cfg.c gcc/tree-cfg.c index 40e524b..0fac49c 100644 --- gcc/tree-cfg.c +++ gcc/tree-cfg.c @@ -1126,7 +1126,7 @@ make_cond_expr_edges (basic_block bb) /* Called for each element in the hash table (P) as we delete the edge to cases hash table. - Clear all the TREE_CHAINs to prevent problems with copying of + Clear all the CASE_CHAINs to prevent problems with copying of SWITCH_EXPRs and structure sharing rules, then free the hash table element. */ diff --git gcc/tree.def gcc/tree.def index d16575a..2c35540 100644 --- gcc/tree.def +++ gcc/tree.def @@ -949,7 +949,7 @@ DEFTREECODE (SWITCH_EXPR, "switch_expr", tcc_statement, 3) Operand 1 is CASE_HIGH. If it is NULL_TREE, the label is a simple (one-value) case label. If it is non-NULL_TREE, the case is a range. Operand 2 is CASE_LABEL, which is is the corresponding LABEL_DECL. - Operand 4 is CASE_CHAIN. This operand is only used in tree-cfg.c to + Operand 3 is CASE_CHAIN. This operand is only used in tree-cfg.c to speed up the lookup of case labels which use a particular edge in the control flow graph. */ DEFTREECODE (CASE_LABEL_EXPR, "case_label_expr", tcc_statement, 4)