diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-24 07:53:52 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-24 07:53:52 +0000 |
commit | e471cc6fa22dd96c645987ad86fa6b469340242f (patch) | |
tree | 8eeccb0956a7e6b8abafc24234634fa3736769cf /gcc/c | |
parent | c3f3b68d345b6ce507570035196453a0aec6887c (diff) | |
download | gcc-e471cc6fa22dd96c645987ad86fa6b469340242f.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211930 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 13 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 0972fdebd24..c9372614122 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2014-06-24 Jakub Jelinek <jakub@redhat.com> + + * c-parser.c (c_parser_omp_for_loop): For + #pragma omp parallel for simd move lastprivate clause from parallel + to for rather than simd. + 2014-06-23 Marek Polacek <polacek@redhat.com> * c-typeck.c (parser_build_binary_op): Don't call diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index 5fecb488b6a..f83ccb07db4 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -11910,8 +11910,17 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code, tree l = build_omp_clause (OMP_CLAUSE_LOCATION (*c), OMP_CLAUSE_LASTPRIVATE); OMP_CLAUSE_DECL (l) = OMP_CLAUSE_DECL (*c); - OMP_CLAUSE_CHAIN (l) = clauses; - clauses = l; + if (code == OMP_SIMD) + { + OMP_CLAUSE_CHAIN (l) + = cclauses[C_OMP_CLAUSE_SPLIT_FOR]; + cclauses[C_OMP_CLAUSE_SPLIT_FOR] = l; + } + else + { + OMP_CLAUSE_CHAIN (l) = clauses; + clauses = l; + } OMP_CLAUSE_SET_CODE (*c, OMP_CLAUSE_SHARED); } } |