From 95782571f3bcd00cca47233cc07b927c24d400ef Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 2 May 2014 19:43:40 +0200 Subject: gimplify.c (gimplify_adjust_omp_clauses_1): Handle GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE. * gimplify.c (gimplify_adjust_omp_clauses_1): Handle GOVD_FIRSTPRIVATE | GOVD_LASTPRIVATE. (gimplify_adjust_omp_clauses): Simd region is never directly nested in combined parallel. Instead, for linear with copyin/copyout, if in combined for simd loop, make decl firstprivate/lastprivate on OMP_FOR. * omp-low.c (expand_omp_for_generic, expand_omp_for_static_nochunk, expand_omp_for_static_chunk): When setting endvar, also set fd->loop.v to the same value. libgomp/ * testsuite/libgomp.c/simd-10.c: New test. * testsuite/libgomp.c/simd-11.c: New test. * testsuite/libgomp.c/simd-12.c: New test. * testsuite/libgomp.c/simd-13.c: New test. From-SVN: r210009 --- libgomp/testsuite/libgomp.c/simd-13.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 libgomp/testsuite/libgomp.c/simd-13.c (limited to 'libgomp/testsuite/libgomp.c/simd-13.c') diff --git a/libgomp/testsuite/libgomp.c/simd-13.c b/libgomp/testsuite/libgomp.c/simd-13.c new file mode 100644 index 0000000..7c817b7 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/simd-13.c @@ -0,0 +1,18 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +int +main () +{ + int k = 0, i, s = 0; + #pragma omp parallel for simd linear(k : 3) reduction(+: s) schedule (static, 16) + for (i = 0; i < 128; i++) + { + k = k + 3; + s = s + k; + } + if (s != 128 * 129 / 2 * 3) __builtin_abort (); + return 0; +} -- cgit v1.1