diff options
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); } } |