https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94971

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Parallel mode is basically broken for any new C++ standard.

All the tests for C++20 constexpr algorithms fail, because the std::__parallel
versions are not constexpr:

FAIL: 25_algorithms/replace_if/constexpr.cc (test for excess errors)
Excess errors:
/home/jwakely/src/gcc/libstdc++-v3/testsuite/25_algorithms/replace_if/constexpr.cc:29:
error: call to non-'constexpr' function 'void
std::__parallel::replace_if(_FIter, _FIter, _Predicate, const _Tp&) [with
_FIter = int*; _Predicate = test()::<lambda(int)>; _Tp = int]'
/home/jwakely/src/gcc/libstdc++-v3/testsuite/25_algorithms/replace_if/constexpr.cc:34:
error: non-constant condition for static assertion
/home/jwakely/src/gcc/libstdc++-v3/testsuite/25_algorithms/replace_if/constexpr.cc:34:
error: 'constexpr bool test()' called in a constant expression


I think that could be fixed by adding _GLIBCXX20_CONSTEXPR to them and then at
the beginning of each function:

#if __cpp_lib_is_constant_evaluated
if (std::is_constant_evaluated())
  return _GLIBCXX_STD_A::replace_if(...);
#endif


These fail to compile because the parallel algos don't support move semantics:
FAIL: 25_algorithms/stable_sort/49559.cc (test for excess errors)
FAIL: 25_algorithms/stable_sort/moveable.cc (test for excess errors)
FAIL: 25_algorithms/stable_sort/moveable2.cc (test for excess errors)
FAIL: 25_algorithms/partial_sort/moveable.cc (test for excess errors)
FAIL: 25_algorithms/nth_element/moveable.cc (test for excess errors)
FAIL: 25_algorithms/for_each/1.cc (test for excess errors)
FAIL: 25_algorithms/for_each/for_each_n.cc (test for excess errors)


These time out, I didn't check why:

FAIL: 25_algorithms/move/deque_iterators/1.cc execution test
FAIL: 25_algorithms/move_backward/deque_iterators/1.cc execution test
FAIL: 25_algorithms/copy_backward/deque_iterators/1.cc execution test


This fails because the new overload of std::search that takes a searcher isn't
declared in std::__parallel:

FAIL: 25_algorithms/search/searcher.cc (test for excess errors)
Excess errors:
/home/jwakely/src/gcc/libstdc++-v3/testsuite/25_algorithms/search/searcher.cc:39:
error: no matching function for call to 'search(int [2], int*, nocopy)'

These fail at runtime, because the parallel algos copy instead of moving:

FAIL: 26_numerics/accumulate/lwg2055.cc execution test
FAIL: 26_numerics/inner_product/lwg2055.cc execution test

Reply via email to