From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id EF642385E823 for ; Fri, 21 May 2021 22:30:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EF642385E823 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 14LMTsCr008167; Fri, 21 May 2021 17:29:54 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 14LMTqRt008166; Fri, 21 May 2021 17:29:52 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 21 May 2021 17:29:52 -0500 From: Segher Boessenkool To: Bill Schmidt Cc: gcc-patches@gcc.gnu.org, jakub@redhat.com, jlaw@tachyum.com, dje.gcc@gmail.com Subject: Re: [PATCH 10/57] rs6000: Red-black tree implementation for balanced tree search Message-ID: <20210521222952.GF10366@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2021 22:30:56 -0000 On Tue, Apr 27, 2021 at 10:32:45AM -0500, Bill Schmidt via Gcc-patches wrote: > 2021-03-03 Bill Schmidt > > gcc/ > * config/rs6000/rbtree.c: New file. > * config/rs6000/rbtree.h: New file. > + struct rbt_string_node *nodeptr > + = (struct rbt_string_node *) malloc (sizeof (struct rbt_string_node)); malloc (sizeof *nodeptr) helps catch foolish errors. This is one of the secondary reasons not too use superfluous parens with the sizeof operator: when you see them you know there is probably something not quite right (like here, should not repeat the type, it is too easy to make errors that way). > + /* Gender-neutral formations are awkward, so let's be fair. ;-) > + ("Parent-sibling" is just awful.) */ > + struct rbt_string_node *aunt = curr->par->par->left; "unt" is nice imo :-) > --- /dev/null > +++ b/gcc/config/rs6000/rbtree.h > +/* Red-black binary search tree on strings. Presently we don't support > + deletes; only insert/find operations are implemented. */ > +enum rbt_color > + { > + RBT_BLACK, > + RBT_RED > + }; You you need this in the header? You could just say enum rbt_color; and nothing more? Okay for trunk, whatever you decide to do for these. Thanks! Segher