From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 40CFB3858C66; Thu, 25 Jan 2024 03:51:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 40CFB3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706154673; bh=daQgZN9jAXF9A97hnjpypdy2eLvwNwp0qUef9lHhwT8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YkBzk8oAmXPMOx5KvnDq3mcqkq41cbJlW70TSjC2sJ3P+Mv+ZT8SUTxXVi5rTKjNw SyFdFw2sy/qcqUWyuD2xRA1F42wgkeoJYYd+G7eNi/8qE/2r3H+nacyI9wuMPR7ef5 fAKyKPic1ZXN7t2d7jEYXKic5ezr+VsQAAaXHT/4= From: "simon.marchi at polymtl dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/31281] [gdb] intrusive_list.h:329: internal-error: push_back: Assertion elem_node->prev == INTRUSIVE_LIST_UNLINKED_VALUE failed. Date: Thu, 25 Jan 2024 03:51:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.marchi at polymtl dot ca X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31281 Simon Marchi changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simon.marchi at polymtl do= t ca --- Comment #12 from Simon Marchi --- I made what I think is a fairly minimal reproducer: https://godbolt.org/z/rbevnhG1f node_ptr_1 is the node field address computed using the pointer to member machinery. node_ptr_2 is also the node field address, but computed directl= y by taking its address. We would expect them to be the same, but they're not w= ith gcc 14 / trunk. They are with other compilers. Does this look sufficient to file a gcc bug? Here's the code in case godbolt is down. --- #include #include struct intrusive_list_node { void *next; }; struct dummy { void *base; }; struct thread_info : public dummy, public intrusive_list_node { intrusive_list_node node; }; template struct intrusive_member_node { static intrusive_list_node *as_node(thread_info *elem) { return &(elem->*MemberNode); } }; int main() { for (int i =3D 0; i < 100000; ++i) { thread_info *tp =3D new thread_info; auto node_ptr_1 =3D intrusive_member_node<&thread_info::node>::as_node(= tp); auto node_ptr_2 =3D &tp->node; std::cout << "With tp =3D=3D " << tp << ", does " << node_ptr_1 << " =3D=3D " << node_ptr_2 << " -> " << (node_ptr_1 =3D=3D n= ode_ptr_2) << std::endl; assert(node_ptr_1 =3D=3D node_ptr_2); } } --=20 You are receiving this mail because: You are on the CC list for the bug.=