https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108749
Bug ID: 108749 Summary: [OpenMP][C/C++/Fortran] inscan reduction modifier rejected for combined/composite constructs of simd/for/do Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: openmp, rejects-valid Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- This applies to C, C++ and Fortran likewise. test.c:6:37: error: ‘inscan’ ‘reduction’ clause on construct other than ‘for’, ‘simd’, ‘for simd’, ‘parallel for’, ‘parallel for simd’ 6 | #pragma omp target simd reduction (inscan, *:r) | ^ OpenMP 5.0 had the following: "A reduction clause with the *inscan* reduction-modifier may only appear on a worksharing-loop construct, a worksharing-loop SIMD construct, a simd construct, a parallel worksharing-loop construct or a parallel worksharing-loop SIMD construct." But, a bit confusingly, it also had: "If a construct to which the *inscan* reduction-modifier is applied is combined with the *target* construct, the effect is as if the same list item also appears in a map clause with a map-type of tofrom." The latter implying that a combined construct is also permitted - while the former rules it out. * * * OpenMP 5.1 seemingly fixed this while 5.2 removed constructs with 'distribute'. In any case, OpenMP 5.2 reads as follows: "A reduction clause with the *inscan* reduction-modifier may only appear on a worksharing-loop construct, a simd construct or a combined or composite construct for which any of the aforementioned constructs is a constituent construct and distribute is not a constituent construct." — ["5.5.8 reduction Clause" under "Restrictions to the reduction clause are as follows:" (7th bullet), [136:1-4]] * * * I think this currently implies that the following ones should be supported besides the exsisting '(parallel) {do|for} (simd)' and 'simd'. OMP_MASKED_TASKLOOP_SIMD OMP_MASTER_TASKLOOP_SIMD OMP_PARALLEL_MASKED_TASKLOOP_SIMD OMP_PARALLEL_MASTER_TASKLOOP_SIMD OMP_TARGET_PARALLEL_DO OMP_TARGET_PARALLEL_DO_SIMD OMP_TARGET_SIMD OMP_TASKLOOP_SIMD