https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80853
Bug ID: 80853 Summary: [6/7/8 Regression] OpenMP ICE in build_outer_var_ref with array reduction Product: gcc Version: 7.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- void foo (int *p) { #pragma omp for reduction(+:p[:4]) for (int i = 0; i < 64; i++) { p[0] += i; p[1] += i / 2; p[2] += 2 * i; p[3] += 3 * i; } } ICEs with -fopenmp in both C and C++ starting with GCC 6 (when array reduction support has been introduced). For array reductions if the array section base is a pointer, we don't really need the pointer to be shared (and don't actually check that, unlike e.g. when the array section is array based), it is enough if what the points to is shared.