From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fOlUK+GqcGqmtwIAWB0awg (envelope-from ) for ; Mon, 03 Aug 2026 10:51:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1785768673; bh=1BPQFeytJxsjF9FY4HYXV1EvwMhhZim+pKD0vFeGYak=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gjQICcFHimie8aivZs92VIHPLYMBG8q5R4Ms5fwx6sqIsZBw80y+oF/soFCmOe1FG oi5Y/3b9879wDRgpHjkXdt4oCYp9bTGfKTWu7/sxR9Wlt71tHDHw8PpbPtz8+1dwUj ocz3l8GGGVlb7rbDYuNzLbH3MD0bNT4jGBXkGotA= Received: by simark.ca (Postfix, from userid 112) id 9F4C61E099; Mon, 03 Aug 2026 10:51:13 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=NpTrzLuo; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B3CA71E099 for ; Mon, 03 Aug 2026 10:51:12 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D15B4BB1C08 for ; Mon, 3 Aug 2026 14:51:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D15B4BB1C08 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=NpTrzLuo Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id EF7804BAE7F8 for ; Mon, 3 Aug 2026 14:50:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF7804BAE7F8 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EF7804BAE7F8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785768649; cv=none; b=s6FrpWKSvL+czPgz/fSIk1bT/PxJwEWntIEm2AfAcgIItp8kWYYuBL5J0k6jzFyg4jkUp57TjpVl1Lk8/CD9YZF5bI1l0hPhGp2s1/3s//K2nNEE8w0fRt/1I7FuNG63nSqw24xxQAtRhSnP7Is2NN8qHLXVurnT5sw5eu6XFoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785768649; c=relaxed/simple; bh=1BPQFeytJxsjF9FY4HYXV1EvwMhhZim+pKD0vFeGYak=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=EmjG8jiacmYXACyNc+Sz1/c1ptFyOYECt0//SK6XGGQgvIIXggU322gWHTOmAWa87p9xfG3RkyqNCnAaaNqxf2DZiV/fR4+jw6d9nb2GUu3bn9ZQLOkamos2wiuVssNWpv+IYivXP3LBHi6OBYByYNYilUmI0ctGSZOpxps1ob8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=NpTrzLuo DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF7804BAE7F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1785768648; bh=1BPQFeytJxsjF9FY4HYXV1EvwMhhZim+pKD0vFeGYak=; h=Date:Subject:To:References:From:In-Reply-To:From; b=NpTrzLuokLTB2C48AsRPI3qbDACebqAnrdTzNg8dGKRXOQVSQSRdqfs9Zl+rGkSq9 FA77N3Wn/u+rdzUFx253RC4l9FobzOh2i1B+EnROMxEJy1pW77LukxkAT+sN12ZjjL 7ZWYgrpmMIYBjgWeejZah/jm1ubjJ35gn3t8NBmc= Received: by simark.ca (Postfix) id D8F7B1E099; Mon, 03 Aug 2026 10:50:47 -0400 (EDT) Message-ID: <0148fccf-a2f1-4aa0-a85d-a0053fffd387@simark.ca> Date: Mon, 3 Aug 2026 10:50:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] gdb: remove dead code in make_pointer_type and make_reference_type To: Tankut Baris Aktemur , gdb-patches@sourceware.org References: <20260803143531.2958552-1-tankutbaris.aktemur@amd.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20260803143531.2958552-1-tankutbaris.aktemur@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 8/3/26 10:35 AM, Tankut Baris Aktemur wrote: > At the end of `make_pointer_type` and `make_reference_type`, GDB > updates the length of every type in the chain. This is practically > dead code, because if we reach this point, we must have allocated a > new type. After a new allocation, the chain contains only the > newly-created type itself. See in `type_allocator::new_type ()`: > > type->chain = type; /* Chain back to itself. */ > > That is, we always have `ntype == ntype->chain`. Therefore, the loop > can never be entered. Remove it. > > In `make_reference_type`, we also remove `*reftype = ntype;`, because > a few lines above the assignment was already made. This is repeated > code. Thanks, this LGTM. Approved-By: Simon Marchi Simon