From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C180F3858C00; Wed, 7 Sep 2022 20:43:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C180F3858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662583385; bh=gUjsEczcmzl8cGKu10oXw+z0hhO7ipgwxkk6kdzT0pU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AJX/yBoxcxz/LiotC5RSze0Q8wURX9voY+es3mHP+Nd5tT30OA/HGTXlol2d7i5YI gcS0ZO8f2B0t3Rfv+ZuVkWE03YuHPNzwQINOoVS4wlvdtuiATSxF6Lcg2d/yL7eEHe 27Ma52orzDJykhWtiCzEaEHKJ+zh3/8Ocro1i6J8= From: "markmigm at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106820] internal compiler error: in function_and_variable_visibility [for std::shared_ptr{b,??} use via module] Date: Wed, 07 Sep 2022 20:43:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: markmigm at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106820 --- Comment #4 from Mark Millard --- (In reply to Mark Millard from comment #3) > . . . > And in a debugger I see: >=20 > (lldb) print node->decl->decl_with_vis.weak_flag > (unsigned int) $2 =3D 1 > (lldb) print node->decl->decl_with_vis.comdat_flag > (unsigned int) $3 =3D 0 > (lldb) print node->weakref > (unsigned int) $4 =3D 0 > (lldb) print node->decl->decl_common.decl_flag_1 > (unsigned int) $5 =3D 0 >=20 > and: >=20 > (lldb) call debug_tree(node->decl) > type type size > unit-size > align:32 warn_if_not_align:0 symtab:0 alias-set -1 > canonical-type 0x8cd415e8 precision:32 min -2147483648> max > pointer_to_this reference_to_this > > > SI size unit-size 0x8cd40270 4> > align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type > 0x939e7f18 > arg-types > chain = >> > pointer_to_this > > addressable used static tree_3 weak in_system_header decl_5 decl_6 DI > /usr/local/lib/gcc12/include/c++/aarch64-portbld-freebsd14.0/bits/gthr- > default.h:121:1 align:32 warn_if_not_align:0 context 0x8cd3e000 module_shared_ptr_alias_construction_failure.cpp> > attributes purpose normal local bindings <0x0>> > value value > readonly constant static "pthread_mutex_unlock\000">> > chain purpose normal local bindings <0x0>>>> > full-name "int __gthrw_pthread_mutex_unlock(pthread_mutex**)" > module 1:/usr/local/lib/gcc12/include/c++/memory exported chain > > And, sure enough, __gthrw_pthread_mutex_unlock looks to involve "weak" via https://github.com/gcc-mirror/gcc/blob/master/libgcc/gthr-posix.h having in use: # define __gthrw2(name,name2,type) \ static __typeof(type) name \ __attribute__ ((__weakref__(#name2), __copy__ (type))); \ __gthrw_pragma(weak type) . . . /* Typically, __gthrw_foo is a weak reference to symbol foo. */ #define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name) . . . __gthrw(pthread_mutex_unlock) There could be more examples of the type of issue but the build stops at the first to fail the gcc_assert.=