From patchwork Fri May 27 14:24:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1636282 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=t78Nwrv4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L8nCK2nJhz9sG0 for ; Sat, 28 May 2022 00:25:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A805139960EF for ; Fri, 27 May 2022 14:25:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A805139960EF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1653661529; bh=aQifCt2JVwsMzNfTXn0RQyhWbcLVcavwIelTYMjOpUc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=t78Nwrv4EGKT8/YK7P/iOFBr7pyJb292Hgr2rJhz0f40sRACiQJAwI9W3w8q1pJYQ C3uB0P/uHVzyN+HiO2JU+8QrxPz1WNyCGE7Kl3/5SF2ism0ArKPOTit7c+IsJmv8h4 u78BnA5Udo64xu9YqbXcYuTDQCXgVZZwe05OxaWk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id F3A68396D837 for ; Fri, 27 May 2022 14:24:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F3A68396D837 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-654-XQXdkuvjPyGVR1by7Z27sQ-1; Fri, 27 May 2022 10:24:36 -0400 X-MC-Unique: XQXdkuvjPyGVR1by7Z27sQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C8AD3C0ED61; Fri, 27 May 2022 14:24:36 +0000 (UTC) Received: from localhost (unknown [10.33.36.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3A00C23DC1; Fri, 27 May 2022 14:24:35 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Mark non-exported function always_inline [PR105671] Date: Fri, 27 May 2022 15:24:34 +0100 Message-Id: <20220527142434.1384212-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "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. libstdc++-v3/ChangeLog: 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__)) char_type* _M_high_mark() const _GLIBCXX_NOEXCEPT {