diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-06-24 09:53:52 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-06-24 09:53:52 +0200 |
commit | 56ad0e3820fa6f21e603e83c6e0908d39915463a (patch) | |
tree | 8eeccb0956a7e6b8abafc24234634fa3736769cf /gcc/omp-low.c | |
parent | b46ebd6c7beaf55974973de0f02d39299b733bc9 (diff) | |
download | gcc-56ad0e3820fa6f21e603e83c6e0908d39915463a.zip gcc-56ad0e3820fa6f21e603e83c6e0908d39915463a.tar.gz gcc-56ad0e3820fa6f21e603e83c6e0908d39915463a.tar.bz2 |
gimplify.c (gimplify_omp_for): For #pragma omp for simd iterator not mentioned in clauses use private clause if...
* gimplify.c (gimplify_omp_for): For #pragma omp for simd iterator
not mentioned in clauses use private clause if the iterator is
declared in #pragma omp for simd, and when adding lastprivate
instead, add it to the outer #pragma omp for too. Diagnose
if the variable is private in outer context. For simd collapse > 1
loops, replace all iterators with temporaries.
* omp-low.c (lower_rec_input_clauses): Handle LINEAR clause the
same even in collapse > 1 loops.
gcc/c/
* c-parser.c (c_parser_omp_for_loop): For
#pragma omp parallel for simd move lastprivate clause from parallel
to for rather than simd.
gcc/cp/
* parser.c (cp_parser_omp_for_loop): For
#pragma omp parallel for simd move lastprivate clause from parallel
to for rather than simd.
libgomp/
* testsuite/libgomp.c/for-2.c: Define SC to static for
#pragma omp for simd testing.
* testsuite/libgomp.c/for-2.h (SC): Define if not defined.
(N(f5), N(f6), N(f7), N(f8), N(f10), N(f12), N(f14)): Use
SC macro.
* testsuite/libgomp.c/simd-14.c: New test.
* testsuite/libgomp.c/simd-15.c: New test.
* testsuite/libgomp.c/simd-16.c: New test.
* testsuite/libgomp.c/simd-17.c: New test.
* testsuite/libgomp.c++/for-10.C: Define SC to static for
#pragma omp for simd testing.
* testsuite/libgomp.c++/simd10.C: New test.
* testsuite/libgomp.c++/simd11.C: New test.
* testsuite/libgomp.c++/simd12.C: New test.
* testsuite/libgomp.c++/simd13.C: New test.
From-SVN: r211930
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index adbd0eb..e70970e 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -3421,24 +3421,20 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, OMP_CLAUSE__LOOPTEMP_); gcc_assert (c); tree l = OMP_CLAUSE_DECL (c); - if (fd->collapse == 1) - { - tree n1 = fd->loop.n1; - tree step = fd->loop.step; - tree itype = TREE_TYPE (l); - if (POINTER_TYPE_P (itype)) - itype = signed_type_for (itype); - l = fold_build2 (MINUS_EXPR, itype, l, n1); - if (TYPE_UNSIGNED (itype) - && fd->loop.cond_code == GT_EXPR) - l = fold_build2 (TRUNC_DIV_EXPR, itype, - fold_build1 (NEGATE_EXPR, - itype, l), - fold_build1 (NEGATE_EXPR, - itype, step)); - else - l = fold_build2 (TRUNC_DIV_EXPR, itype, l, step); - } + tree n1 = fd->loop.n1; + tree step = fd->loop.step; + tree itype = TREE_TYPE (l); + if (POINTER_TYPE_P (itype)) + itype = signed_type_for (itype); + l = fold_build2 (MINUS_EXPR, itype, l, n1); + if (TYPE_UNSIGNED (itype) + && fd->loop.cond_code == GT_EXPR) + l = fold_build2 (TRUNC_DIV_EXPR, itype, + fold_build1 (NEGATE_EXPR, itype, l), + fold_build1 (NEGATE_EXPR, + itype, step)); + else + l = fold_build2 (TRUNC_DIV_EXPR, itype, l, step); t = fold_build2 (MULT_EXPR, stept, fold_convert (stept, l), t); if (POINTER_TYPE_P (TREE_TYPE (x))) |