Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2219557/?format=api
{ "id": 2219557, "url": "http://patchwork.ozlabs.org/api/patches/2219557/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260403114721.110965-1-tkaminsk@redhat.com/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260403114721.110965-1-tkaminsk@redhat.com>", "list_archive_url": null, "date": "2026-04-03T11:39:20", "name": "libstdc++: Export explicit instantiations of __format::__do_vformat_to.", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "4c11fcb4eafbf593c7d41abfac2894b8f42858ce", "submitter": { "id": 90409, "url": "http://patchwork.ozlabs.org/api/people/90409/?format=api", "name": "Tomasz Kamiński", "email": "tkaminsk@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260403114721.110965-1-tkaminsk@redhat.com/mbox/", "series": [ { "id": 498619, "url": "http://patchwork.ozlabs.org/api/series/498619/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=498619", "date": "2026-04-03T11:39:20", "name": "libstdc++: Export explicit instantiations of __format::__do_vformat_to.", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498619/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219557/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219557/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=gCsGA39L;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=gCsGA39L", "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com", "sourceware.org; spf=pass smtp.mailfrom=redhat.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnH6c1by8z1yCt\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 22:48:23 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 496A94BA23C7\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 3 Apr 2026 11:48:21 +0000 (GMT)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 1AAAC4BA2E3D\n for <gcc-patches@gcc.gnu.org>; Fri, 3 Apr 2026 11:47:27 +0000 (GMT)", "from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-613-lSWNduE_NjSbMfpgpzwCMA-1; Fri,\n 03 Apr 2026 07:47:24 -0400", "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id C5AEA19560AA; Fri, 3 Apr 2026 11:47:23 +0000 (UTC)", "from localhost (unknown [10.44.48.114])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 20ACB19560A6; Fri, 3 Apr 2026 11:47:22 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 496A94BA23C7", "OpenDKIM Filter v2.11.0 sourceware.org 1AAAC4BA2E3D" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 1AAAC4BA2E3D", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 1AAAC4BA2E3D", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775216847; cv=none;\n b=l0TcQGuu+mKDiBbdp+7/aig4mSnplcv1JZSTOhdA/Gph4GgzDE+f+LR0avzLbSxEAu2SyVLYVehvYoOUMbjDbQr9duJjGHStV1OoM4ex+0wmjF1c+6wAPxMS0YqSpOXoZbXrEaPWm6cjdZOffIF4GWGyYdJeF/0IDQx25dMtkrI=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1775216847; c=relaxed/simple;\n bh=Bf4VCi3CAH1UzXeqbPivMJPYHcJhZUCpCEJ5QBEm5hs=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=X3msYnwIaBWwKT3BfzoCInoSHeD3qCft8rOeprczR+uNqygNBOYoS2nhoI7/ntVFhdljoDN7n7Q1tIrZc2bBoYgeenQ1yxRPgnlu6QSlQEna9onnUHDFoWxJWxR5SNIRAVSS1ZukpgWMOqFyCqfd2kKKH2vILHZJF01OHS10Uwc=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775216846;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding;\n bh=bd57S0UWUN+JohxPrQFNhl3dYzIIqwbTbPct4AMMddY=;\n b=gCsGA39LkzyLPFfaCT0ZfVzDmuGbJMlhKuWPLfr1w8h5SlvVyndAo++EM1cGyXoQWD5AqC\n 2vuXvOnr1xHJlldZhEvI41geKOC2g1GYsXYS46flfJ4ZWXDS40fQQHM5EuzVg/NqLGdtcF\n +i5uF8h7KxHv8X08IE2gEM3KvmcUA7c=", "X-MC-Unique": "lSWNduE_NjSbMfpgpzwCMA-1", "X-Mimecast-MFC-AGG-ID": "lSWNduE_NjSbMfpgpzwCMA_1775216844", "From": "=?utf-8?q?Tomasz_Kami=C5=84ski?= <tkaminsk@redhat.com>", "To": "libstdc++@gcc.gnu.org,\n\tgcc-patches@gcc.gnu.org", "Subject": "[PATCH] libstdc++: Export explicit instantiations of\n __format::__do_vformat_to.", "Date": "Fri, 3 Apr 2026 13:39:20 +0200", "Message-ID": "<20260403114721.110965-1-tkaminsk@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.12", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "fYPFaf3MD7BmONC8YywPkpTmauXpeyiWd_P3yvvzrRQ_1775216844", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "This patch exports instantiations of __format::__do_vformat_to\nfor _Sink_iter and char/wchar_t. As every format function is\nimplementing as delegating the one of these overloads, this\nsignificantly reduces the compliation time.\n\nInstantiating __format::__do_vformat_to triggers specializations\nof formatters for types stored in handle direclty (arithmetic\ntypes, strings), however we do not export any of their symbols.\nThis keeps the interface boundary minimal. This file should\nbe recompiled in later mode, when it is called stable.\n\nlibstdc++-v3/ChangeLog:\n\n\t* config/abi/pre/gnu.ver (GLIBCXX_3.4): Exclude exports\n\tof std::basic_fo* (matching basic_format_context).\n\t(GLIBCXX_3.4.35): Export __format::__do_vformat_to\n\tspecializations for _Sink_iter and char/wchar_t.\n\t* include/std/format: (__format::__do_vformat_to):\n\tRemove inline and declare extern instantiation\n\tof __format::__do_vformat_to _Sink_iter and char/wchar_t.\n\t* src/c++20/Makefile.am: Add format-inst.cc.\n\t* src/c++20/Makefile.in: Regenerate.\n\t* src/c++20/format-inst.cc: New file defining explicit\n\tinstantiation.\n---\nFrom simple test on files from testsuite/std/format/functions/, the\nresults looks very promising:\n\n\t\tBefore\tAfter\nformat.cc\t24.203s 10.846s\nformat_to.cc 18.475s 2.844s\nformat_to_n.cc\t18.677s 3.074s\t\nvformat_to.cc\t17.281s 2.246s\n\nHowever, I am a bit concerned if the approach works, as\nlibstdc++.so will always contains weak simbol for __do_vformat_to\nfor _Sink_iter<char>, that supports only C++20 specifiers.\nShould we instead compile the format-inst in latest mode, and\nalways provide extern defintion?\nNote that the same problem will also be present for the print function,\nbut I haven not realized it then.\n\nI plan to do similar change for __formatter_chrono<char>::_M_format\nfunctions (entry point).\n\n\n libstdc++-v3/config/abi/pre/gnu.ver | 8 ++++-\n libstdc++-v3/include/std/format | 13 +++++++-\n libstdc++-v3/src/c++20/Makefile.am | 3 +-\n libstdc++-v3/src/c++20/Makefile.in | 6 ++--\n libstdc++-v3/src/c++20/format-inst.cc | 46 +++++++++++++++++++++++++++\n 5 files changed, 71 insertions(+), 5 deletions(-)\n create mode 100644 libstdc++-v3/src/c++20/format-inst.cc", "diff": "diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver\nindex fb968e122d8..2b391584c94 100644\n--- a/libstdc++-v3/config/abi/pre/gnu.ver\n+++ b/libstdc++-v3/config/abi/pre/gnu.ver\n@@ -34,7 +34,9 @@ GLIBCXX_3.4 {\n std::basic_[a-e]*;\n std::basic_f[a-h]*;\n # std::basic_filebuf;\n- std::basic_f[j-r]*;\n+ std::basic_f[j-n]*;\n+# std::basic_format_context;\n+ std::basic_f[p-r]*;\n # std::basic_fstream;\n std::basic_f[t-z]*;\n std::basic_[g-h]*;\n@@ -2587,6 +2589,10 @@ GLIBCXX_3.4.35 {\n _ZNSt12__cow_stringaSEOS_;\n _ZNKSt12__cow_string5c_strEv;\n \n+ # __format::__do_vformat_to(_Sink_iter<char>, string_view, const format_args&, const locale*);\n+ # __format::__do_vformat_to(_Sink_iter<wchar_t>, wstring_view, const wformat_args&, const locale*);\n+ _ZNSt8__format15__do_vformat_toINS_10_Sink_iterI[wc]EE[wc]St20basic_format_contextIS2_[wc]EEET_S5_St17basic_string_viewIT0_St11char_traitsIS7_EERKSt17basic_format_argsIT1_EPKSt6locale;\n+\n #if defined (_WIN32) && !defined (__CYGWIN__)\n _ZSt19__get_once_callablev;\n _ZSt15__get_once_callv;\ndiff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format\nindex eca5bd213aa..2a8229a2eb5 100644\n--- a/libstdc++-v3/include/std/format\n+++ b/libstdc++-v3/include/std/format\n@@ -5220,7 +5220,7 @@ namespace __format\n };\n \n template<typename _Out, typename _CharT, typename _Context>\n- inline _Out\n+ _Out\n __do_vformat_to(_Out __out, basic_string_view<_CharT> __fmt,\n \t\t const basic_format_args<_Context>& __args,\n \t\t const locale* __loc)\n@@ -5310,6 +5310,17 @@ namespace __format\n \t}\n }\n \n+#if __cplusplus <= 202002L && _GLIBCXX_EXTERN_TEMPLATE > 0\n+ extern template _Sink_iter<char>\n+ __do_vformat_to(_Sink_iter<char>, string_view,\n+\t\t const format_args&, const locale*);\n+# ifdef _GLIBCXX_USE_WCHAR_T\n+ extern template _Sink_iter<wchar_t>\n+ __do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n+\t\t const wformat_args&, const locale*);\n+# endif\n+#endif\n+\n template<typename _Out, typename _CharT>\n format_to_n_result<_Out>\n __do_vformat_to_n(_Out __out, iter_difference_t<_Out> __n,\ndiff --git a/libstdc++-v3/src/c++20/Makefile.am b/libstdc++-v3/src/c++20/Makefile.am\nindex 0061678dc0f..7744fa43a63 100644\n--- a/libstdc++-v3/src/c++20/Makefile.am\n+++ b/libstdc++-v3/src/c++20/Makefile.am\n@@ -30,7 +30,8 @@ headers =\n if ENABLE_EXTERN_TEMPLATE\n # XTEMPLATE_FLAGS = -fno-implicit-templates\n inst_sources = \\\n-\tsstream-inst.cc\n+\tsstream-inst.cc \\\n+\tformat-inst.cc\n else\n # XTEMPLATE_FLAGS =\n inst_sources =\ndiff --git a/libstdc++-v3/src/c++20/Makefile.in b/libstdc++-v3/src/c++20/Makefile.in\nindex f481ad08edb..566d7292021 100644\n--- a/libstdc++-v3/src/c++20/Makefile.in\n+++ b/libstdc++-v3/src/c++20/Makefile.in\n@@ -124,7 +124,8 @@ CONFIG_CLEAN_VPATH_FILES =\n LTLIBRARIES = $(noinst_LTLIBRARIES)\n libc__20convenience_la_LIBADD =\n am__objects_1 = tzdb.lo format.lo atomic.lo clock.lo syncbuf.lo\n-@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo\n+@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = sstream-inst.lo \\\n+@ENABLE_EXTERN_TEMPLATE_TRUE@\tformat-inst.lo\n @GLIBCXX_HOSTED_TRUE@am_libc__20convenience_la_OBJECTS = \\\n @GLIBCXX_HOSTED_TRUE@\t$(am__objects_1) $(am__objects_2)\n libc__20convenience_la_OBJECTS = $(am_libc__20convenience_la_OBJECTS)\n@@ -433,7 +434,8 @@ headers =\n \n # XTEMPLATE_FLAGS = -fno-implicit-templates\n @ENABLE_EXTERN_TEMPLATE_TRUE@inst_sources = \\\n-@ENABLE_EXTERN_TEMPLATE_TRUE@\tsstream-inst.cc\n+@ENABLE_EXTERN_TEMPLATE_TRUE@\tsstream-inst.cc \\\n+@ENABLE_EXTERN_TEMPLATE_TRUE@\tformat-inst.cc\n \n sources = tzdb.cc format.cc atomic.cc clock.cc syncbuf.cc\n @GLIBCXX_HOSTED_FALSE@libc__20convenience_la_SOURCES = \ndiff --git a/libstdc++-v3/src/c++20/format-inst.cc b/libstdc++-v3/src/c++20/format-inst.cc\nnew file mode 100644\nindex 00000000000..1904de35f7b\n--- /dev/null\n+++ b/libstdc++-v3/src/c++20/format-inst.cc\n@@ -0,0 +1,46 @@\n+// Definitions for <chrono> formatting -*- C++ -*-\n+\n+// Copyright The GNU Toolchain Authors.\n+//\n+// This file is part of the GNU ISO C++ Library. This library is free\n+// software; you can redistribute it and/or modify it under the\n+// terms of the GNU General Public License as published by the\n+// Free Software Foundation; either version 3, or (at your option)\n+// any later version.\n+\n+// This library is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+// GNU General Public License for more details.\n+\n+// Under Section 7 of GPL version 3, you are granted additional\n+// permissions described in the GCC Runtime Library Exception, version\n+// 3.1, as published by the Free Software Foundation.\n+\n+// You should have received a copy of the GNU General Public License and\n+// a copy of the GCC Runtime Library Exception along with this program;\n+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see\n+// <http://www.gnu.org/licenses/>.\n+\n+#include <format>\n+#include <chrono>\n+\n+namespace std\n+{\n+_GLIBCXX_BEGIN_NAMESPACE_VERSION\n+namespace __format\n+{\n+\n+ template _Sink_iter<char>\n+ __do_vformat_to(_Sink_iter<char>, string_view,\n+\t\t const format_args&, const locale*);\n+\n+# ifdef _GLIBCXX_USE_WCHAR_T\n+ template _Sink_iter<wchar_t>\n+ __do_vformat_to(_Sink_iter<wchar_t>, wstring_view,\n+\t\t const wformat_args&, const locale*);\n+# endif\n+\n+} // namespace __format\n+_GLIBCXX_END_NAMESPACE_VERSION\n+} // namespace std\n", "prefixes": [] }