public inbox for
 help / color / mirror / Atom feed
* [committed] libstdc++: Mark non-exported function always_inline [PR105671]
@ 2022-05-27 14:24 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2022-05-27 14:24 UTC (permalink / raw)
  To: libstdc++, gcc-patches

Tested powerpc64le-linux, pushed to trunk. Backports to gcc-12 and
gcc-11 will be done early next month.

-- >8 --

This new function was added for gcc 11.1 but is not exported from the
shared library. Depending on inlining decisions, its callers might get
inlined but an external definition be needed for this function. That
then fails to link.

Since we can't add the export to the gcc-11 release branch now, mark it
always_inline. We can consider exporting it for gcc-13 if/when we bump
the shared library version (and maybe also for gcc-12 which is currently
at the same version as trunk). For now, the attribute will solve the
problem on all affected branches. The function is small enough that
force-inlining it shouldn't cause problems.


	PR libstdc++/105671
	* include/std/sstream (basic_stringbuf::_M_high_mark): Add
	always_inline attribute.
 libstdc++-v3/include/std/sstream | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream
index bb25c2c69a9..bc7d636e702 100644
--- a/libstdc++-v3/include/std/sstream
+++ b/libstdc++-v3/include/std/sstream
@@ -425,6 +425,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
       // This might not be the same character as _M_string.end() because
       // basic_stringbuf::overflow might have written to unused capacity
       // in _M_string without updating its length.
+      __attribute__((__always_inline__))
       _M_high_mark() const _GLIBCXX_NOEXCEPT

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

only message in thread, other threads:[~2022-05-27 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 14:24 [committed] libstdc++: Mark non-exported function always_inline [PR105671] Jonathan Wakely

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