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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Clauses on Combined and Composite Constructs
section says:
"If the task reduction-modifier is specified, the effect is as if it only
modifies the behavior of the reduction clause on the innermost leaf
construct that accepts the modifier."
and c-omp.c (c_omp_split_clauses) implements that, first it does some
diagnostics in the if (OMP_CLAUSE_REDUCTION_TASK (clauses)) and later on
does not copy OMP_CLAUSE_REDUCTION_TASK to the duplicates of the clause.
task modifier is allowed only on parallel, worksharing-loop and sections (and
scope, but that isn't combined with anything) and is disallowed on anything
combined with simd or loop, so effectively we know that the innermost construct
will handle it and the others will not have the flag set.

Reply via email to