https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102504
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:d3e7bb15e28c554bf4484a912f3b9c18c60ec68f commit r12-3955-gd3e7bb15e28c554bf4484a912f3b9c18c60ec68f Author: Jakub Jelinek <ja...@redhat.com> Date: Wed Sep 29 10:17:52 2021 +0200 openmp: Disallow reduction with var private in containing parallel even on scope [PR102504] The standard has a restriction: "A list item that appears in a reduction clause of a scope construct must be shared in the parallel region to which a corresponding scope region binds." similar to the restriction for worksharing constructs, but we were checking it only on worksharing constructs and not for scope and ICEd later on during omp expansion. 2021-09-29 Jakub Jelinek <ja...@redhat.com> PR middle-end/102504 * gimplify.c (gimplify_scan_omp_clauses): Use omp_check_private even in OMP_SCOPE clauses, not just on worksharing construct clauses. * c-c++-common/gomp/scope-4.c: New test.