public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4313] libstdc++: Force _Hash_node_value_base methods inline to fix abi (PR111050)
@ 2023-09-28 17:24 Francois Dumont
  0 siblings, 0 replies; only message in thread
From: Francois Dumont @ 2023-09-28 17:24 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:2c1e3544a94c5d7354fad031e1f9731c3ce3af25

commit r14-4313-g2c1e3544a94c5d7354fad031e1f9731c3ce3af25
Author: Tim Song <t.canens.cpp@gmail.com>
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(); }

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

only message in thread, other threads:[~2023-09-28 17:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-28 17:24 [gcc r14-4313] libstdc++: Force _Hash_node_value_base methods inline to fix abi (PR111050) Francois Dumont

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