tree-core.h (enum omp_clause_code): Add OMP_CLAUSE__CONDTEMP_.
commit6c7ae8c56f9341f180e097d5eb7ba05cb8eec413
authorJakub Jelinek <jakub@redhat.com>
Fri, 24 May 2019 21:31:59 +0000 (24 23:31 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 24 May 2019 21:31:59 +0000 (24 23:31 +0200)
tree425965042d935027e8cc7045b383f6b7b6f714f9
parent09b4000c7c5b359ec62b5d621daf6ab95233ce10
tree-core.h (enum omp_clause_code): Add OMP_CLAUSE__CONDTEMP_.

* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE__CONDTEMP_.
* tree.h (OMP_CLAUSE_DECL): Use OMP_CLAUSE__CONDTEMP_ instead of
OMP_CLAUSE__REDUCTEMP_.
* tree.c (omp_clause_num_ops, omp_clause_code_name): Add
OMP_CLAUSE__CONDTEMP_.
(walk_tree_1): Handle OMP_CLAUSE__CONDTEMP_.
* tree-pretty-print.c (dump_omp_clause): Likewise.
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Likewise.
* gimplify.c (enum gimplify_omp_var_data): Use hexadecimal constants
instead of decimal.  Add GOVD_LASTPRIVATE_CONDITIONAL.
(gimplify_scan_omp_clauses): Don't reject lastprivate conditional
on OMP_FOR.
(gimplify_omp_for): Warn and disable conditional modifier from
lastprivate on loop iterators.
* omp-general.h (struct omp_for_data): Add lastprivate_conditional
member.
* omp-general.c (omp_extract_for_data): Initialize it.
* omp-low.c (struct omp_context): Add lastprivate_conditional_map
member.
(delete_omp_context): Delete it.
(lower_lastprivate_conditional_clauses): New function.
(lower_lastprivate_clauses): Add BODY_P and CSTMT_LIST arguments,
handle lastprivate conditional clauses.
(lower_reduction_clauses): Add CLIST argument, emit it into
the critical section if any.
(lower_omp_sections): Adjust lower_lastprivate_clauses and
lower_reduction_clauses callers.
(lower_omp_for_lastprivate): Add CLIST argument, pass it through
to lower_lastprivate_clauses.
(lower_omp_for): Call lower_lastprivate_conditional_clauses, adjust
lower_omp_for_lastprivate and lower_reduction_clauses callers, emit
clist into a critical section if not emitted there already by
lower_reduction_clauses.
(lower_omp_taskreg, lower_omp_teams): Adjust lower_reduction_clauses
callers.
(lower_omp_1): Handle GIMPLE_ASSIGNs storing into lastprivate
conditional variables.
* omp-expand.c (determine_parallel_type): Punt if OMP_CLAUSE__CONDTEMP_
clause is present.
(expand_omp_for_generic, expand_omp_for_static_nochunk,
expand_omp_for_static_chunk): Handle lastprivate conditional.
(expand_omp_for): Handle fd.lastprivate_conditional like
fd.have_reductemp.
gcc/testsuite/
* c-c++-common/gomp/lastprivate-conditional-2.c (foo): Don't expect
sorry for omp for.
* c-c++-common/gomp/lastprivate-conditional-3.c: New test.
libgomp/
* testsuite/libgomp.c-c++-common/lastprivate-conditional-1.c: New test.
* testsuite/libgomp.c-c++-common/lastprivate-conditional-2.c: New test.

From-SVN: r271610
17 files changed:
gcc/ChangeLog
gcc/gimplify.c
gcc/omp-expand.c
gcc/omp-general.c
gcc/omp-general.h
gcc/omp-low.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/gomp/lastprivate-conditional-2.c
gcc/testsuite/c-c++-common/gomp/lastprivate-conditional-3.c [new file with mode: 0644]
gcc/tree-core.h
gcc/tree-nested.c
gcc/tree-pretty-print.c
gcc/tree.c
gcc/tree.h
libgomp/ChangeLog
libgomp/testsuite/libgomp.c-c++-common/lastprivate-conditional-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c-c++-common/lastprivate-conditional-2.c [new file with mode: 0644]