From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id j0cDDx9+smUspgcAWB0awg (envelope-from ) for ; Thu, 25 Jan 2024 10:28:31 -0500 Received: by simark.ca (Postfix, from userid 112) id 34A3D1E0C3; Thu, 25 Jan 2024 10:28:31 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 1D7451E092 for ; Thu, 25 Jan 2024 10:28:29 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7BB393857809 for ; Thu, 25 Jan 2024 15:28:28 +0000 (GMT) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 40635385841F for ; Thu, 25 Jan 2024 15:28:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40635385841F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 40635385841F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706196488; cv=none; b=OQUQK+RQ5/tiEhzYUPnLZdAPYqyO9U8fjv0SgzMOcdWXb8pyF+TQzfhCy6+j/QvDKwh8biXda6jpnyDKMtmdOCtU4YRa9/8/XkQyxEU3db+mXk3hTRrm3DlA/4i+H7567QZS5H+lLmsKp3aEYHX5ZByPChUxsRv4L9r+2sNOY5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706196488; c=relaxed/simple; bh=w+AO1Fuytckn7CEVFaFrfH5InAHIRnR5NfDIjEYym88=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qR0RFnfhj4jiBH4JqxoqSx9+de/5V9Qk0jsZOv35qZp4A8cVycH7aRGqPLMulxcf81r3vJRTo+lT/78lRM8TJ9B4dZLJ2tKvDunnzygLJX4yqDcLh4UT7lLsoZNDjKg4bomtC3n5SS0UKVfLOcLIy6DCvn0lhSVuO9QbT9n4OIQ= ARC-Authentication-Results: i=1; server2.sourceware.org References: <20240125142107.8643-1-tdevries@suse.de> User-agent: mu4e 1.10.8; emacs 30.0.50 From: Sam James To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/build] Workaround gcc PR113599 Date: Thu, 25 Jan 2024 15:27:55 +0000 Organization: Gentoo In-reply-to: <20240125142107.8643-1-tdevries@suse.de> Message-ID: <87msstigal.fsf@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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 Tom de Vries writes: > Since gcc commit d3f48f68227 ("c++: non-dependent .* operand folding > [PR112427]"), with gdb we run into PR gcc/113599 [1], a wrong-code bug, as > reported in PR build/31281. > > Work around this by flipping inherit order: > ... > -class thread_info : public refcounted_object, > - public intrusive_list_node > +class thread_info : public intrusive_list_node, > + public refcounted_object > ... > > An argument could be made that this isn't necessary, because this occurred in > an unreleased gcc version. > > However, I think it could be useful when bisecting gcc for other problems in > building gdb. Having this workaround means the bisect won't reintroduce the > problem. Furthermore, the workaround is harmless. > > Tested on Fedora rawhide x86_64. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31281 > > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113599 > --- > gdb/gdbthread.h | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h > index e7035d40ad4..1d9730fd1fa 100644 > --- a/gdb/gdbthread.h > +++ b/gdb/gdbthread.h > @@ -244,10 +244,11 @@ using private_thread_info_up = std::unique_ptr; > strong reference, and is thus not accounted for in the thread's > refcount. > > - The intrusive_list_node base links threads in a per-inferior list. */ > + The intrusive_list_node base links threads in a per-inferior list. > + We place it first in the inherit orer to work around PR gcc/113599. */ order > > -class thread_info : public refcounted_object, > - public intrusive_list_node > +class thread_info : public intrusive_list_node, > + public refcounted_object > { > public: > explicit thread_info (inferior *inf, ptid_t ptid); > > base-commit: 726f209eb1b05842d816eac8b0b8f9c7f6cd9fbc