From: Sam James <sam@gentoo.org>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/build] Workaround gcc PR113599
Date: Thu, 25 Jan 2024 15:27:55 +0000 [thread overview]
Message-ID: <87msstigal.fsf@gentoo.org> (raw)
In-Reply-To: <20240125142107.8643-1-tdevries@suse.de>
Tom de Vries <tdevries@suse.de> 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<thread_info>
> +class thread_info : public intrusive_list_node<thread_info>,
> + 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<private_thread_info>;
> 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<thread_info>
> +class thread_info : public intrusive_list_node<thread_info>,
> + public refcounted_object
> {
> public:
> explicit thread_info (inferior *inf, ptid_t ptid);
>
> base-commit: 726f209eb1b05842d816eac8b0b8f9c7f6cd9fbc
next prev parent reply other threads:[~2024-01-25 15:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 14:21 Tom de Vries
2024-01-25 14:51 ` Tom Tromey
2024-01-25 15:27 ` Sam James [this message]
2024-01-25 15:30 ` Tom de Vries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87msstigal.fsf@gentoo.org \
--to=sam@gentoo.org \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).