struct S { int s; }; template <typename T> void foo (T &x, T &y) { #pragma omp for simd for (T i = x; i < y; i++) // { dg-error "used with class iteration variable" } ; #pragma omp parallel for simd for (T i = x; i < y; i++) // { dg-error "used with class iteration variable" } ; #pragma omp target teams distribute parallel for simd for (T i = x; i < y; i++) // { dg-error "used with class iteration variable" } ; #pragma omp target teams distribute simd for (T i = x; i < y; i++) // { dg-error "used with class iteration variable" } ; } void bar () { S x, y; foo <S> (x, y); } ICEs because during instantiation it is harder to find out the inner stmt has been removed and remove the stmts combined/composited with it.
Author: jakub Date: Thu Sep 10 07:35:56 2015 New Revision: 227611 URL: https://gcc.gnu.org/viewcvs?rev=227611&root=gcc&view=rev Log: PR c++/67523 * gimplify.c (gimplify_omp_for): If inner stmt is not found for combined loop, assert seen_error () and return GS_ERROR. * g++.dg/gomp/pr67523.C: New test. Added: trunk/gcc/testsuite/g++.dg/gomp/pr67523.C Modified: trunk/gcc/ChangeLog trunk/gcc/gimplify.c trunk/gcc/testsuite/ChangeLog
Author: jakub Date: Thu Sep 10 07:41:34 2015 New Revision: 227618 URL: https://gcc.gnu.org/viewcvs?rev=227618&root=gcc&view=rev Log: PR c++/67523 * gimplify.c (gimplify_omp_for): If inner stmt is not found for combined loop, assert seen_error () and return GS_ERROR. * g++.dg/gomp/pr67523.C: New test. Added: branches/gcc-5-branch/gcc/testsuite/g++.dg/gomp/pr67523.C Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/gimplify.c branches/gcc-5-branch/gcc/testsuite/ChangeLog
Fixed for 5.3+.