From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 4C5BD386F0DB; Thu, 7 Jul 2022 23:33:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C5BD386F0DB MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-10135] libstdc++: Mark non-exported function always_inline [PR105671] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 7f66dfbe4cba07458e224486e0dd6ff1ece321d3 X-Git-Newrev: 03af8492bee6243a9d10e78fea1a3e423bd5f9cd Message-Id: <20220707233341.4C5BD386F0DB@sourceware.org> Date: Thu, 7 Jul 2022 23:33:41 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 23:33:41 -0000 https://gcc.gnu.org/g:03af8492bee6243a9d10e78fea1a3e423bd5f9cd commit r11-10135-g03af8492bee6243a9d10e78fea1a3e423bd5f9cd Author: Jonathan Wakely Date: Fri May 27 12:43:18 2022 +0100 libstdc++: Mark non-exported function always_inline [PR105671] 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. libstdc++-v3/ChangeLog: PR libstdc++/105671 * include/std/sstream (basic_stringbuf::_M_high_mark): Add always_inline attribute. (cherry picked from commit de57440858591a88e8fd7ba2505ca54546c86021) Diff: --- 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 f21664100ab..56555ecd98a 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__)) char_type* _M_high_mark() const _GLIBCXX_NOEXCEPT {