From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id D2B3338133FE; Fri, 27 May 2022 14:23:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2B3338133FE 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 r13-801] libstdc++: Mark non-exported function always_inline [PR105671] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 8af266501795dd76d05faef498dbd3472a01b305 X-Git-Newrev: de57440858591a88e8fd7ba2505ca54546c86021 Message-Id: <20220527142325.D2B3338133FE@sourceware.org> Date: Fri, 27 May 2022 14:23:25 +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: Fri, 27 May 2022 14:23:25 -0000 https://gcc.gnu.org/g:de57440858591a88e8fd7ba2505ca54546c86021 commit r13-801-gde57440858591a88e8fd7ba2505ca54546c86021 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. 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 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__)) char_type* _M_high_mark() const _GLIBCXX_NOEXCEPT {