From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1720) id 2A5863858C52; Thu, 28 Sep 2023 17:24:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A5863858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695921869; bh=oUlqiG5VUdwuBk9x5k/1N96cZHCPr61UQGrQIFk9FHk=; h=From:To:Subject:Date:From; b=gCV8oYzVsKAtEMZfmuM5W+s+rh2IMaKwdDDhUTV6lHOHC+XwdDmjlz17UmkVSidsP HtZfQwoQ9MpZlebx3m68JAgy5bUWzBcC+owK9K7qgY43U9W1PVMXOpNouLOKZtMWcv gznB9PvJq4WkB7Byo0UdONRitmf8oOyTuzC7kG+M= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Francois Dumont To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-4313] libstdc++: Force _Hash_node_value_base methods inline to fix abi (PR111050) X-Act-Checkin: gcc X-Git-Author: Tim Song X-Git-Refname: refs/heads/master X-Git-Oldrev: 8552dcd8e4448c02fe230662093756b75dd94399 X-Git-Newrev: 2c1e3544a94c5d7354fad031e1f9731c3ce3af25 Message-Id: <20230928172429.2A5863858C52@sourceware.org> Date: Thu, 28 Sep 2023 17:24:29 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2c1e3544a94c5d7354fad031e1f9731c3ce3af25 commit r14-4313-g2c1e3544a94c5d7354fad031e1f9731c3ce3af25 Author: Tim Song Date: Wed Sep 6 19:31:55 2023 +0200 libstdc++: Force _Hash_node_value_base methods inline to fix abi (PR111050) https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1b6f0476837205932613ddb2b3429a55c26c409d changed _Hash_node_value_base to no longer derive from _Hash_node_base, which means that its member functions expect _M_storage to be at a different offset. So explosions result if an out-of-line definition is emitted for any of the member functions (say, in a non-optimized build) and the resulting object file is then linked with code built using older version of GCC/libstdc++. libstdc++-v3/ChangeLog: PR libstdc++/111050 * include/bits/hashtable_policy.h (_Hash_node_value_base<>::_M_valptr(), _Hash_node_value_base<>::_M_v()) Add [[__gnu__::__always_inline__]]. Diff: --- libstdc++-v3/include/bits/hashtable_policy.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h index 347d468ea86..86b32fb15f2 100644 --- a/libstdc++-v3/include/bits/hashtable_policy.h +++ b/libstdc++-v3/include/bits/hashtable_policy.h @@ -327,18 +327,22 @@ namespace __detail __gnu_cxx::__aligned_buffer<_Value> _M_storage; + [[__gnu__::__always_inline__]] _Value* _M_valptr() noexcept { return _M_storage._M_ptr(); } + [[__gnu__::__always_inline__]] const _Value* _M_valptr() const noexcept { return _M_storage._M_ptr(); } + [[__gnu__::__always_inline__]] _Value& _M_v() noexcept { return *_M_valptr(); } + [[__gnu__::__always_inline__]] const _Value& _M_v() const noexcept { return *_M_valptr(); }