public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/build] Workaround gcc PR113599
@ 2024-01-25 15:30 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2024-01-25 15:30 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2ec7980408fafb172d2ddb716a367ce2111e2e9e

commit 2ec7980408fafb172d2ddb716a367ce2111e2e9e
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Jan 25 16:31:47 2024 +0100

    [gdb/build] Workaround gcc PR113599
    
    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.
    
    Approved-By: Tom Tromey <tom@tromey.com>
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31281
    
    [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113599

Diff:
---
 gdb/gdbthread.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index e7035d40ad4..11c553a99ca 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 order to work around PR gcc/113599.  */
 
-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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-25 15:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 15:30 [binutils-gdb] [gdb/build] Workaround gcc PR113599 Tom de Vries

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).