Nvc++ compiler internal error with C++20 standard parallelism

Code gets compiler with C++17, but C++20 leads to

Internal error: assertion failed at: "il.cpp", line 10269 in trans_unit_for_source_corresp

Code:

#include <numeric>
#include <vector>
#include <execution>

auto main() -> int
{
    std::vector const a = {1., 2.};
    std::vector const b = {5., 7.};
    auto const expected = 19.;
    auto const ab = std::transform_reduce(
        std::execution::par_unseq,
        std::cbegin(a), std::cend(a),
        std::cbegin(b),
        0.0
    );
    return (expected == ab) ? EXIT_SUCCESS : EXIT_FAILURE;
}

Command options:

nvc++ -stdpar=gpu -gpu=cc70 -std=c++20

Configuration: gcc 12.1.1, nvc++ 22.5-0, CUDA 11.7.

Thanks SD57,

Looks like the issue only occurs with GNU 12.1 which was just released a bit ago. Best guess that they changed something in the STL which is tripping up our compiler.

I filed a problem report, TPR #32066, and sent it engineering for investigation.

-Mat