From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE21D3858283; Tue, 9 Jan 2024 23:15:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE21D3858283 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704842133; bh=cafR0bmDc3v5WMqnPWKKxkg+AUgLbEDVNCo+b17tGIQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jXSus1HhouJmt9Mg2ZeUU9eTAOIR+6zODAWkS0aq+rAxh5ppsUMLVuSOCONJjOMYk f6SVBA5hofxAAlZbeclrOfw0+P8nZnJBr0l1DEOhC0AOJprtb+rHmHppk0fRxqsB7h WFeI+eWmHVb6K/TkSanOVZ7heDbXSVIvuBEjx2Kw= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/110512] C++20 random access iterators run sequentially with PSTL Date: Tue, 09 Jan 2024 23:15:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: patch X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110512 --- Comment #6 from Jonathan Wakely --- The proposed change will compile very slowly, something like this would be better: --- a/libstdc++-v3/include/pstl/execution_impl.h +++ b/libstdc++-v3/include/pstl/execution_impl.h @@ -19,13 +19,24 @@ namespace __pstl { namespace __internal { +#if __glibcxx_concepts +template + concept __is_random_access_iter + =3D std::is_base_of_v> + || std::random_access_iterator<_Iter>; +template + using __are_random_access_iterators + =3D std::bool_constant<(__is_random_access_iter<_IteratorTypes> && ...= )>; +#else template using __are_iterators_of =3D std::conjunction< std::is_base_of<_IteratorTag, typename std::iterator_traits>::iterator_category>...>; template using __are_random_access_iterators =3D __are_iterators_of; +#endif struct __serial_backend_tag { This uses the libstdc++ helper __iter_category_t but since we no longer nee= d to sync with upstream, that seems fine.=