]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Force _Hash_node_value_base methods inline to fix abi (PR111050)
authorTim Song <t.canens.cpp@gmail.com>
Wed, 6 Sep 2023 17:31:55 +0000 (19:31 +0200)
committerFrançois Dumont <fdumont@gcc.gnu.org>
Thu, 28 Sep 2023 17:14:30 +0000 (19:14 +0200)
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__]].

libstdc++-v3/include/bits/hashtable_policy.h

index 347d468ea866a2ada5a11f2bdda1280891b4b3be..86b32fb15f23401d9ef92265ec16c60672bbfe27 100644 (file)
@@ -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(); }