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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Felix Köhler from comment #0)
> According to cppreference.com:
> "The behavior is non-deterministic if binary_op is not associative or not
> commutative. ... in other words, reduce behaves like std::accumulate except
> the elements of the range may be grouped and rearranged in arbitrary order."
> which seems to support the CLANG interpretation.

I think you read this wrong. this wording says it supports both.

That is:
If we have 1,2,3,1:
it can be done as:
(1 op 2) op (3 op 1)
or
((1 op 2) op 3) op 1
Or really any order or grouping.

Reply via email to