Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2227720/?format=api
{ "id": 2227720, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2227720/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260424065244.262557-1-tkaminsk@redhat.com/", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.1/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 }, "msgid": "<20260424065244.262557-1-tkaminsk@redhat.com>", "date": "2026-04-24T06:41:08", "name": "[v2,1/4] libstdc++: Merged concept for ranges with static sized.", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "664b013d657a3f85e226ba3b02d91407f72ff8b4", "submitter": { "id": 90409, "url": "http://patchwork.ozlabs.org/api/1.1/people/90409/?format=api", "name": "Tomasz Kamiński", "email": "tkaminsk@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260424065244.262557-1-tkaminsk@redhat.com/mbox/", "series": [ { "id": 501310, "url": "http://patchwork.ozlabs.org/api/1.1/series/501310/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501310", "date": "2026-04-24T06:41:08", "name": "[v2,1/4] libstdc++: Merged concept for ranges with static sized.", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/501310/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2227720/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2227720/checks/", "tags": {}, "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=dQqbx4TK;\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=dQqbx4TK", "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 4g23ZY29TVz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 16:53:23 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E1B584BB24E0\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 06:53: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 35E784BB1C17\n for <gcc-patches@gcc.gnu.org>; Fri, 24 Apr 2026 06:52:50 +0000 (GMT)", "from mx-prod-mc-03.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-665-s9KyxPWcNR-y-7-CWC-rbA-1; Fri,\n 24 Apr 2026 02:52:48 -0400", "from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id EDF5D195605A; Fri, 24 Apr 2026 06:52:46 +0000 (UTC)", "from localhost (unknown [10.44.48.150])\n by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 49723300757B; Fri, 24 Apr 2026 06:52:45 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org E1B584BB24E0", "OpenDKIM Filter v2.11.0 sourceware.org 35E784BB1C17" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 35E784BB1C17", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 35E784BB1C17", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777013570; cv=none;\n b=veq58bc7mc0WpwilzqbfF2lkIAPIjbmcxZyfpJxkYbPVMEAZswL6zPr8lOKJPXGC+NY1zjL2SjKsslkqT8Ps4Lai69URn/pTGEzsrkwuL2QngrkReOry2n/WuJH3bsGWgrzPgYd5Kq9YLY6luMMfMFpR239l/HYNAdI0Dm8qWs8=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777013570; c=relaxed/simple;\n bh=X3TS9e7KgILTrls5ONqc4HwdAmUXzWchAs9nVTjJSAg=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=f2O0s+0UQ3aBVDAu2WzR8umHfS/GXgFjYJE0kNLQ39R9ABDQRviFbvgO0/6Etmahk9dlS7ZynRcpdRdzPfJ6IeYec3BY+eq11/4IpCYCc5PEtqx0Y2koCzGg6B2MXA2Yhz1u+vQih0XPHnxg5HaVfdTg840nm/RaNM2XpDO8798=", "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=1777013569;\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 in-reply-to:in-reply-to:references:references;\n bh=UOY4gANcDEVRf/UqvEPI1vFWjp0D/2HGogKiRJoYgiQ=;\n b=dQqbx4TKM8NKyJ1um6y3EUC7fZynq+vbRrQKo3cfVG1sUMh2/HtgTHPeazFhkYoL+ZBseK\n JWCDpvopuyxnDrVoPFqagHUQI5K1HpshEcVvH1xUyIU3V2WniBj4/H3bROrzx0+33krDHR\n NFqMZzJDr3XKcUosjZsFLGxQHlVa8DA=", "X-MC-Unique": "s9KyxPWcNR-y-7-CWC-rbA-1", "X-Mimecast-MFC-AGG-ID": "s9KyxPWcNR-y-7-CWC-rbA_1777013567", "From": "=?utf-8?q?Tomasz_Kami=C5=84ski?= <tkaminsk@redhat.com>", "To": "libstdc++@gcc.gnu.org,\n\tgcc-patches@gcc.gnu.org", "Subject": "[PATCH v2 1/4] libstdc++: Merged concept for ranges with static\n sized.", "Date": "Fri, 24 Apr 2026 08:41:08 +0200", "Message-ID": "<20260424065244.262557-1-tkaminsk@redhat.com>", "In-Reply-To": "\n <CAKvuMXD7w0Psg1NYzgPYvqPg6WdgzSd0_NaU=8-yD6sVzhpGQQ@mail.gmail.com>", "References": "\n <CAKvuMXD7w0Psg1NYzgPYvqPg6WdgzSd0_NaU=8-yD6sVzhpGQQ@mail.gmail.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.4", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "RVCkcodxtSFJloeMdKvGn3uZUdKm2rMC7I1Whx-4JwE_1777013567", "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 replaces duplicated __detail::__statically_sized (from std/meta)\nand simd::__static_sized_range (from include/bits/simd_details.h) concepts\nwith single range::__static_sized_range. The concept uses the implementation\nbased on __statically_sized concept, as it avoids triggering instantiations\nof some class template for each possible size value.\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/ranges_base.h (ranges::__static_sized_range):\n\tDefine.\n\t* include/bits/simd_details.h (simd::__static_sized_range):\n\tRemove.\n\t(simd::__static_range_size): Use ranges::__static_sized_range.\n\t* include/bits/simd_loadstore.h (simd::unchecked_store):\n\t(simd::unchecked_load): Use ranges::__static_sized_range.\n\t* include/bits/simd_vec.h (basic_vec::basic_vec(_Rg&&, flags<_Flags>):\n\tReplace __static_sized_range<_Rg, _S_size> with\n\tranges::__static_sized_range<_Rg> and traing requires size\n\tfor size value.\n\t* include/std/meta (__detail::__statically_sized): Remove.\n\t(std::define_static_array): Use ranges::__static_sized_range.\n\t* testsuite/std/simd/traits_impl.cc: Remove test for\n\tsimd::__static_sized_range.\n---\nThis is new patch in v2 as similar concepts landed before this series.\nUsing Jakub's version, as it does not require template instantiations.\n\nTested on x86_64-linux. OK for trunk?\n\n libstdc++-v3/include/bits/ranges_base.h | 6 ++++++\n libstdc++-v3/include/bits/simd_details.h | 9 +--------\n libstdc++-v3/include/bits/simd_loadstore.h | 8 ++++----\n libstdc++-v3/include/bits/simd_vec.h | 12 +++++++-----\n libstdc++-v3/include/std/meta | 12 +-----------\n libstdc++-v3/testsuite/std/simd/traits_impl.cc | 4 ----\n 6 files changed, 19 insertions(+), 32 deletions(-)", "diff": "diff --git a/libstdc++-v3/include/bits/ranges_base.h b/libstdc++-v3/include/bits/ranges_base.h\nindex 519927f5613..fea4100eb09 100644\n--- a/libstdc++-v3/include/bits/ranges_base.h\n+++ b/libstdc++-v3/include/bits/ranges_base.h\n@@ -558,6 +558,12 @@ namespace ranges\n template<sized_range _Range>\n using range_size_t = decltype(ranges::size(std::declval<_Range&>()));\n \n+#if __cplusplus > 202302L\n+ template<typename _Tp>\n+ concept __static_sized_range = sized_range<_Tp> && requires (_Tp& __t)\n+ { static_cast<char(*)[size_t(ranges::size(__t) >= 0)]>(nullptr); };\n+#endif // C++26\n+\n template<typename _Derived>\n requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>\n class view_interface; // defined in <bits/ranges_util.h>\ndiff --git a/libstdc++-v3/include/bits/simd_details.h b/libstdc++-v3/include/bits/simd_details.h\nindex a1acc5bd946..e2002b6de82 100644\n--- a/libstdc++-v3/include/bits/simd_details.h\n+++ b/libstdc++-v3/include/bits/simd_details.h\n@@ -986,18 +986,11 @@ namespace simd\n using mask = basic_mask<sizeof(_Tp), __deduce_abi_t<_Tp, _Np>>;\n \n // [simd.ctor] load constructor constraints\n- template <typename _Tp, size_t _Np = -1uz>\n- concept __static_sized_range\n- = ranges::sized_range<_Tp> && requires(_Tp&& __r) {\n-\ttypename integral_constant<size_t, ranges::size(__r)>;\n-\trequires (_Np == -1uz || ranges::size(__r) == _Np);\n- };\n-\n template <typename _Rg>\n consteval size_t\n __static_range_size(_Rg& __r)\n {\n- if constexpr (requires { typename integral_constant<size_t, ranges::size(__r)>; })\n+ if constexpr (ranges::__static_sized_range<_Rg>)\n \treturn ranges::size(__r);\n else\n \treturn dynamic_extent;\ndiff --git a/libstdc++-v3/include/bits/simd_loadstore.h b/libstdc++-v3/include/bits/simd_loadstore.h\nindex 20c5fb5cf7f..2390ea289f5 100644\n--- a/libstdc++-v3/include/bits/simd_loadstore.h\n+++ b/libstdc++-v3/include/bits/simd_loadstore.h\n@@ -75,7 +75,7 @@ namespace simd\n constexpr bool __allow_out_of_bounds = __f._S_test(__allow_partial_loadstore);\n constexpr size_t __static_size = __static_range_size(__r);\n \n- if constexpr (!__allow_out_of_bounds && __static_sized_range<_Rg>)\n+ if constexpr (!__allow_out_of_bounds && ranges::__static_sized_range<_Rg>)\n \tstatic_assert(ranges::size(__r) >= _RV::size(), \"given range must have sufficient size\");\n \n const auto* __ptr = __f.template _S_adjust_pointer<_RV>(ranges::data(__r));\n@@ -121,7 +121,7 @@ namespace simd\n constexpr bool __allow_out_of_bounds = __f._S_test(__allow_partial_loadstore);\n constexpr auto __static_size = __static_range_size(__r);\n \n- if constexpr (!__allow_out_of_bounds && __static_sized_range<_Rg>)\n+ if constexpr (!__allow_out_of_bounds && ranges::__static_sized_range<_Rg>)\n \tstatic_assert(ranges::size(__r) >= _RV::size(), \"given range must have sufficient size\");\n \n const auto* __ptr = __f.template _S_adjust_pointer<_RV>(ranges::data(__r));\n@@ -248,7 +248,7 @@ namespace simd\n \t\t \"'flag_convert' must be used for conversions that are not value-preserving\");\n \n constexpr bool __allow_out_of_bounds = __f._S_test(__allow_partial_loadstore);\n- if constexpr (!__allow_out_of_bounds && __static_sized_range<_Rg>)\n+ if constexpr (!__allow_out_of_bounds && ranges::__static_sized_range<_Rg>)\n \tstatic_assert(ranges::size(__r) >= _TV::size(), \"given range must have sufficient size\");\n \n auto* __ptr = __f.template _S_adjust_pointer<_TV>(ranges::data(__r));\n@@ -285,7 +285,7 @@ namespace simd\n \t\t \"'flag_convert' must be used for conversions that are not value-preserving\");\n \n constexpr bool __allow_out_of_bounds = __f._S_test(__allow_partial_loadstore);\n- if constexpr (!__allow_out_of_bounds && __static_sized_range<_Rg>)\n+ if constexpr (!__allow_out_of_bounds && ranges::__static_sized_range<_Rg>)\n \tstatic_assert(ranges::size(__r) >= _TV::size(), \"given range must have sufficient size\");\n \n auto* __ptr = __f.template _S_adjust_pointer<_TV>(ranges::data(__r));\ndiff --git a/libstdc++-v3/include/bits/simd_vec.h b/libstdc++-v3/include/bits/simd_vec.h\nindex 5f3bd7fd2f6..6657587e4d4 100644\n--- a/libstdc++-v3/include/bits/simd_vec.h\n+++ b/libstdc++-v3/include/bits/simd_vec.h\n@@ -1207,14 +1207,15 @@ namespace simd\n \t}\n \n template <ranges::contiguous_range _Rg, typename... _Flags>\n-\trequires __static_sized_range<_Rg, _S_size>\n+\trequires ranges::__static_sized_range<_Rg>\n \t && __vectorizable<ranges::range_value_t<_Rg>>\n \t && __explicitly_convertible_to<ranges::range_value_t<_Rg>, value_type>\n \t[[__gnu__::__always_inline__]]\n \tconstexpr\n \tbasic_vec(_Rg&& __range, flags<_Flags...> __flags = {})\n-\t : basic_vec(_LoadCtorTag(), __flags.template _S_adjust_pointer<basic_vec>(\n-\t\t\t\t\tranges::data(__range)))\n+\trequires (ranges::size(__range) == _S_size)\n+\t: basic_vec(_LoadCtorTag(), __flags.template _S_adjust_pointer<basic_vec>(\n+\t\t\t\t ranges::data(__range)))\n \t{\n \t static_assert(__loadstore_convertible_to<ranges::range_value_t<_Rg>, value_type,\n \t\t\t\t\t\t _Flags...>);\n@@ -2072,11 +2073,12 @@ namespace simd\n \t{}\n \n template <ranges::contiguous_range _Rg, typename... _Flags>\n-\trequires __static_sized_range<_Rg, _S_size>\n+\trequires ranges::__static_sized_range<_Rg>\n \t && __vectorizable<ranges::range_value_t<_Rg>>\n \t && __explicitly_convertible_to<ranges::range_value_t<_Rg>, value_type>\n \tconstexpr\n \tbasic_vec(_Rg&& __range, flags<_Flags...> __flags = {})\n+\trequires (ranges::size(__range) == _S_size)\n \t: basic_vec(_LoadCtorTag(),\n \t\t __flags.template _S_adjust_pointer<basic_vec>(ranges::data(__range)))\n \t{\n@@ -2245,7 +2247,7 @@ namespace simd\n \n // [simd.overview] deduction guide ------------------------------------------\n template <ranges::contiguous_range _Rg, typename... _Ts>\n- requires __static_sized_range<_Rg>\n+ requires ranges::__static_sized_range<_Rg>\n basic_vec(_Rg&& __r, _Ts...)\n -> basic_vec<ranges::range_value_t<_Rg>,\n \t\t __deduce_abi_t<ranges::range_value_t<_Rg>,\ndiff --git a/libstdc++-v3/include/std/meta b/libstdc++-v3/include/std/meta\nindex 21a4df45bfc..bc04dddcb64 100644\n--- a/libstdc++-v3/include/std/meta\n+++ b/libstdc++-v3/include/std/meta\n@@ -640,16 +640,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n return meta::extract<const ranges::range_value_t<_Rg>*>(__str);\n }\n \n- namespace __detail\n- {\n- template<typename _Rg>\n- concept __statically_sized\n- = requires(_Rg&& __r) {\n-\tstatic_cast<char(*)[static_cast<size_t>(ranges::size(__r))\n-\t\t\t >= 0]>(nullptr);\n- };\n- } // namespace __detail\n-\n template<ranges::input_range _Rg>\n consteval auto\n define_static_array(_Rg&& __r)\n@@ -657,7 +647,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n using _Tp = ranges::range_value_t<_Rg>;\n auto __array = meta::reflect_constant_array(__r);\n auto __type = meta::type_of(__array);\n- if constexpr (__detail::__statically_sized<_Rg>)\n+ if constexpr (ranges::__static_sized_range<_Rg>)\n \t{\n \t constexpr size_t __extent = static_cast<size_t>(ranges::size(__r));\n \t if constexpr (__extent)\ndiff --git a/libstdc++-v3/testsuite/std/simd/traits_impl.cc b/libstdc++-v3/testsuite/std/simd/traits_impl.cc\nindex 2f705c7df2f..02e2b690a6a 100644\n--- a/libstdc++-v3/testsuite/std/simd/traits_impl.cc\n+++ b/libstdc++-v3/testsuite/std/simd/traits_impl.cc\n@@ -83,10 +83,6 @@ void test()\n static_assert(!__streq_to_1(\"0\"));\n static_assert(!__streq_to_1(\"1 \"));\n \n- static_assert(__static_sized_range<int[4]>);\n- static_assert(__static_sized_range<int[4], 4>);\n- static_assert(__static_sized_range<std::array<int, 4>, 4>);\n-\n static_assert( __value_preserving_convertible_to<int, double>);\n static_assert(!__value_preserving_convertible_to<int, float>);\n static_assert( __value_preserving_convertible_to<float, double>);\n", "prefixes": [ "v2", "1/4" ] }