diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-05-17 15:40:27 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-05-17 15:40:27 +0200 |
commit | 2c16eb3157f86ae561468c540caf8eb326106b5f (patch) | |
tree | d14eeb859d38591bdd83f3754a627ba21c4d5fae /gcc | |
parent | 1815462a6e53465c404f8a5f6116891492d4b50b (diff) | |
download | gcc-2c16eb3157f86ae561468c540caf8eb326106b5f.zip gcc-2c16eb3157f86ae561468c540caf8eb326106b5f.tar.gz gcc-2c16eb3157f86ae561468c540caf8eb326106b5f.tar.bz2 |
openmp: Add support for inoutset depend-kind
This patch adds support for inoutset depend-kind in depend
clauses. It is very similar to the in depend-kind in that
a task with a dependency with that depend-kind is dependent
on all previously created sibling tasks with matching address
unless they have the same depend-kind.
In the in depend-kind case everything is dependent except
for in -> in dependency, for inoutset everything is
dependent except for inoutset -> inoutset dependency.
mutexinoutset is also similar (everything is dependent except
for mutexinoutset -> mutexinoutset dependency), but there is
also the additional restriction that only one task with
mutexinoutset for each address can be scheduled at once (i.e.
mutual exclusitivty). For now we support mutexinoutset
the same as inout/out, but the inoutset support is full.
In order not to bump the ABI for dependencies each time
(we've bumped it already once, the old ABI supports only
inout/out and in depend-kind, the new ABI supports
inout/out, mutexinoutset, in and depobj), this patch arranges
for inoutset to be at least for the time being always handled
as if it was specified through depobj even when it is not.
So it uses the new ABI for that and inoutset are represented
like depobj - pointer to a pair of pointers where the first one
will be the actual address of the object mentioned in depend
clause and second pointer will be (void *) GOMP_DEPEND_INOUTSET.
2022-05-17 Jakub Jelinek <jakub@redhat.com>
gcc/
* tree-core.h (enum omp_clause_depend_kind): Add
OMP_CLAUSE_DEPEND_INOUTSET.
* tree-pretty-print.cc (dump_omp_clause): Handle
OMP_CLAUSE_DEPEND_INOUTSET.
* gimplify.cc (gimplify_omp_depend): Likewise.
* omp-low.cc (lower_depend_clauses): Likewise.
gcc/c-family/
* c-omp.cc (c_finish_omp_depobj): Handle
OMP_CLAUSE_DEPEND_INOUTSET.
gcc/c/
* c-parser.cc (c_parser_omp_clause_depend): Parse
inoutset depend-kind.
(c_parser_omp_depobj): Likewise.
gcc/cp/
* parser.cc (cp_parser_omp_clause_depend): Parse
inoutset depend-kind.
(cp_parser_omp_depobj): Likewise.
* cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle
OMP_CLAUSE_DEPEND_INOUTSET.
gcc/testsuite/
* c-c++-common/gomp/all-memory-1.c (boo): Add test with
inoutset depend-kind.
* c-c++-common/gomp/all-memory-2.c (boo): Likewise.
* c-c++-common/gomp/depobj-1.c (f1): Likewise.
(f2): Adjusted expected diagnostics.
* g++.dg/gomp/depobj-1.C (f4): Adjust expected diagnostics.
include/
* gomp-constants.h (GOMP_DEPEND_INOUTSET): Define.
libgomp/
* libgomp.h (struct gomp_task_depend_entry): Change is_in type
from bool to unsigned char.
* task.c (gomp_task_handle_depend): Handle GOMP_DEPEND_INOUTSET.
Ignore dependencies where
task->depend[i].is_in && task->depend[i].is_in == ent->is_in
rather than just task->depend[i].is_in && ent->is_in. Remember
whether GOMP_DEPEND_IN loop is needed and guard the loop with that
conditional.
(gomp_task_maybe_wait_for_dependencies): Handle GOMP_DEPEND_INOUTSET.
Ignore dependencies where elem.is_in && elem.is_in == ent->is_in
rather than just elem.is_in && ent->is_in.
* testsuite/libgomp.c-c++-common/depend-1.c (test): Add task with
inoutset depend-kind.
* testsuite/libgomp.c-c++-common/depend-2.c (test): Likewise.
* testsuite/libgomp.c-c++-common/depend-3.c (test): Likewise.
* testsuite/libgomp.c-c++-common/depend-inoutset-1.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/c-omp.cc | 4 | ||||
-rw-r--r-- | gcc/c/c-parser.cc | 10 | ||||
-rw-r--r-- | gcc/cp/cxx-pretty-print.cc | 3 | ||||
-rw-r--r-- | gcc/cp/parser.cc | 8 | ||||
-rw-r--r-- | gcc/gimplify.cc | 100 | ||||
-rw-r--r-- | gcc/omp-low.cc | 44 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/all-memory-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/all-memory-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/depobj-1.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/depobj-1.C | 2 | ||||
-rw-r--r-- | gcc/tree-core.h | 1 | ||||
-rw-r--r-- | gcc/tree-pretty-print.cc | 3 |
12 files changed, 158 insertions, 26 deletions
diff --git a/gcc/c-family/c-omp.cc b/gcc/c-family/c-omp.cc index 01ef4ee..66d17a2 100644 --- a/gcc/c-family/c-omp.cc +++ b/gcc/c-family/c-omp.cc @@ -738,6 +738,7 @@ c_finish_omp_depobj (location_t loc, tree depobj, case OMP_CLAUSE_DEPEND_OUT: case OMP_CLAUSE_DEPEND_INOUT: case OMP_CLAUSE_DEPEND_MUTEXINOUTSET: + case OMP_CLAUSE_DEPEND_INOUTSET: kind = OMP_CLAUSE_DEPEND_KIND (clause); t = OMP_CLAUSE_DECL (clause); gcc_assert (t); @@ -796,6 +797,9 @@ c_finish_omp_depobj (location_t loc, tree depobj, case OMP_CLAUSE_DEPEND_MUTEXINOUTSET: k = GOMP_DEPEND_MUTEXINOUTSET; break; + case OMP_CLAUSE_DEPEND_INOUTSET: + k = GOMP_DEPEND_INOUTSET; + break; case OMP_CLAUSE_DEPEND_LAST: k = -1; break; diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc index 51a0725..8df8f60 100644 --- a/gcc/c/c-parser.cc +++ b/gcc/c/c-parser.cc @@ -16067,7 +16067,7 @@ c_parser_omp_clause_affinity (c_parser *parser, tree list) depend ( depend-modifier , depend-kind: variable-list ) depend-kind: - in | out | inout | mutexinoutset | depobj + in | out | inout | mutexinoutset | depobj | inoutset depend-modifier: iterator ( iterators-definition ) */ @@ -16099,6 +16099,8 @@ c_parser_omp_clause_depend (c_parser *parser, tree list) kind = OMP_CLAUSE_DEPEND_IN; else if (strcmp ("inout", p) == 0) kind = OMP_CLAUSE_DEPEND_INOUT; + else if (strcmp ("inoutset", p) == 0) + kind = OMP_CLAUSE_DEPEND_INOUTSET; else if (strcmp ("mutexinoutset", p) == 0) kind = OMP_CLAUSE_DEPEND_MUTEXINOUTSET; else if (strcmp ("out", p) == 0) @@ -19063,12 +19065,14 @@ c_parser_omp_depobj (c_parser *parser) kind = OMP_CLAUSE_DEPEND_INOUT; else if (!strcmp ("mutexinoutset", p2)) kind = OMP_CLAUSE_DEPEND_MUTEXINOUTSET; + else if (!strcmp ("inoutset", p2)) + kind = OMP_CLAUSE_DEPEND_INOUTSET; } if (kind == OMP_CLAUSE_DEPEND_SOURCE) { clause = error_mark_node; - error_at (c2_loc, "expected %<in%>, %<out%>, %<inout%> or " - "%<mutexinoutset%>"); + error_at (c2_loc, "expected %<in%>, %<out%>, %<inout%>, " + "%<mutexinoutset%> or %<inoutset%>"); } c_parens.skip_until_found_close (parser); } diff --git a/gcc/cp/cxx-pretty-print.cc b/gcc/cp/cxx-pretty-print.cc index 4f9a090..7e4db2e 100644 --- a/gcc/cp/cxx-pretty-print.cc +++ b/gcc/cp/cxx-pretty-print.cc @@ -2139,6 +2139,9 @@ cxx_pretty_printer::statement (tree t) case OMP_CLAUSE_DEPEND_MUTEXINOUTSET: pp_cxx_ws_string (this, " update(mutexinoutset)"); break; + case OMP_CLAUSE_DEPEND_INOUTSET: + pp_cxx_ws_string (this, " update(inoutset)"); + break; case OMP_CLAUSE_DEPEND_LAST: pp_cxx_ws_string (this, " destroy"); break; diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 7d94e47..24585c1 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -39446,6 +39446,8 @@ cp_parser_omp_clause_depend (cp_parser *parser, tree list, location_t loc) kind = OMP_CLAUSE_DEPEND_IN; else if (strcmp ("inout", p) == 0) kind = OMP_CLAUSE_DEPEND_INOUT; + else if (strcmp ("inoutset", p) == 0) + kind = OMP_CLAUSE_DEPEND_INOUTSET; else if (strcmp ("mutexinoutset", p) == 0) kind = OMP_CLAUSE_DEPEND_MUTEXINOUTSET; else if (strcmp ("out", p) == 0) @@ -41745,12 +41747,14 @@ cp_parser_omp_depobj (cp_parser *parser, cp_token *pragma_tok) kind = OMP_CLAUSE_DEPEND_INOUT; else if (!strcmp ("mutexinoutset", p2)) kind = OMP_CLAUSE_DEPEND_MUTEXINOUTSET; + else if (!strcmp ("inoutset", p2)) + kind = OMP_CLAUSE_DEPEND_INOUTSET; } if (kind == OMP_CLAUSE_DEPEND_SOURCE) { clause = error_mark_node; - error_at (c2_loc, "expected %<in%>, %<out%>, %<inout%> or " - "%<mutexinoutset%>"); + error_at (c2_loc, "expected %<in%>, %<out%>, %<inout%>, " + "%<mutexinoutset%> or %<inoutset%>"); } if (!c_parens.require_close (parser)) cp_parser_skip_to_closing_parenthesis (parser, diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 2f6d995..260993b 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -8270,9 +8270,9 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) { tree c; gimple *g; - size_t n[4] = { 0, 0, 0, 0 }; - bool unused[4]; - tree counts[4] = { NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE }; + size_t n[5] = { 0, 0, 0, 0, 0 }; + bool unused[5]; + tree counts[5] = { NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE }; tree last_iter = NULL_TREE, last_count = NULL_TREE; size_t i, j; location_t first_loc = UNKNOWN_LOCATION; @@ -8295,6 +8295,9 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) case OMP_CLAUSE_DEPEND_DEPOBJ: i = 3; break; + case OMP_CLAUSE_DEPEND_INOUTSET: + i = 4; + break; case OMP_CLAUSE_DEPEND_SOURCE: case OMP_CLAUSE_DEPEND_SINK: continue; @@ -8400,14 +8403,14 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) else n[i]++; } - for (i = 0; i < 4; i++) + for (i = 0; i < 5; i++) if (counts[i]) break; - if (i == 4) + if (i == 5) return 0; tree total = size_zero_node; - for (i = 0; i < 4; i++) + for (i = 0; i < 5; i++) { unused[i] = counts[i] == NULL_TREE && n[i] == 0; if (counts[i] == NULL_TREE) @@ -8423,9 +8426,12 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) if (gimplify_expr (&total, pre_p, NULL, is_gimple_val, fb_rvalue) == GS_ERROR) return 2; - bool is_old = unused[1] && unused[3]; + bool is_old = unused[1] && unused[3] && unused[4]; tree totalpx = size_binop (PLUS_EXPR, unshare_expr (total), size_int (is_old ? 1 : 4)); + if (!unused[4]) + totalpx = size_binop (PLUS_EXPR, totalpx, + size_binop (MULT_EXPR, counts[4], size_int (2))); tree type = build_array_type (ptr_type_node, build_index_type (totalpx)); tree array = create_tmp_var_raw (type); TREE_ADDRESSABLE (array) = 1; @@ -8471,11 +8477,11 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) gimplify_and_add (tem, pre_p); } - tree cnts[4]; - for (j = 4; j; j--) + tree cnts[6]; + for (j = 5; j; j--) if (!unused[j - 1]) break; - for (i = 0; i < 4; i++) + for (i = 0; i < 5; i++) { if (i && (i >= j || unused[i - 1])) { @@ -8499,6 +8505,15 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) } gimple_seq_add_stmt (pre_p, g); } + if (unused[4]) + cnts[5] = NULL_TREE; + else + { + tree t = size_binop (PLUS_EXPR, total, size_int (5)); + cnts[5] = create_tmp_var (sizetype); + g = gimple_build_assign (cnts[i], t); + gimple_seq_add_stmt (pre_p, g); + } last_iter = NULL_TREE; tree last_bind = NULL_TREE; @@ -8521,6 +8536,9 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) case OMP_CLAUSE_DEPEND_DEPOBJ: i = 3; break; + case OMP_CLAUSE_DEPEND_INOUTSET: + i = 4; + break; case OMP_CLAUSE_DEPEND_SOURCE: case OMP_CLAUSE_DEPEND_SINK: continue; @@ -8625,14 +8643,42 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) return 2; if (TREE_VALUE (t) != null_pointer_node) TREE_VALUE (t) = build_fold_addr_expr (TREE_VALUE (t)); + if (i == 4) + { + r = build4 (ARRAY_REF, ptr_type_node, array, cnts[i], + NULL_TREE, NULL_TREE); + tree r2 = build4 (ARRAY_REF, ptr_type_node, array, cnts[5], + NULL_TREE, NULL_TREE); + r2 = build_fold_addr_expr_with_type (r2, ptr_type_node); + tem = build2_loc (OMP_CLAUSE_LOCATION (c), MODIFY_EXPR, + void_type_node, r, r2); + append_to_statement_list_force (tem, last_body); + tem = build2_loc (OMP_CLAUSE_LOCATION (c), MODIFY_EXPR, + void_type_node, cnts[i], + size_binop (PLUS_EXPR, cnts[i], + size_int (1))); + append_to_statement_list_force (tem, last_body); + i = 5; + } r = build4 (ARRAY_REF, ptr_type_node, array, cnts[i], NULL_TREE, NULL_TREE); tem = build2_loc (OMP_CLAUSE_LOCATION (c), MODIFY_EXPR, void_type_node, r, TREE_VALUE (t)); append_to_statement_list_force (tem, last_body); + if (i == 5) + { + r = build4 (ARRAY_REF, ptr_type_node, array, + size_binop (PLUS_EXPR, cnts[i], size_int (1)), + NULL_TREE, NULL_TREE); + tem = build_int_cst (ptr_type_node, GOMP_DEPEND_INOUTSET); + tem = build2_loc (OMP_CLAUSE_LOCATION (c), MODIFY_EXPR, + void_type_node, r, tem); + append_to_statement_list_force (tem, last_body); + } tem = build2_loc (OMP_CLAUSE_LOCATION (c), MODIFY_EXPR, void_type_node, cnts[i], - size_binop (PLUS_EXPR, cnts[i], size_int (1))); + size_binop (PLUS_EXPR, cnts[i], + size_int (1 + (i == 5)))); append_to_statement_list_force (tem, last_body); TREE_VALUE (t) = null_pointer_node; } @@ -8656,12 +8702,38 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) if (gimplify_expr (&OMP_CLAUSE_DECL (c), pre_p, NULL, is_gimple_val, fb_rvalue) == GS_ERROR) return 2; + if (i == 4) + { + r = build4 (ARRAY_REF, ptr_type_node, array, cnts[i], + NULL_TREE, NULL_TREE); + tree r2 = build4 (ARRAY_REF, ptr_type_node, array, cnts[5], + NULL_TREE, NULL_TREE); + r2 = build_fold_addr_expr_with_type (r2, ptr_type_node); + tem = build2 (MODIFY_EXPR, void_type_node, r, r2); + gimplify_and_add (tem, pre_p); + g = gimple_build_assign (cnts[i], size_binop (PLUS_EXPR, + cnts[i], + size_int (1))); + gimple_seq_add_stmt (pre_p, g); + i = 5; + } r = build4 (ARRAY_REF, ptr_type_node, array, cnts[i], NULL_TREE, NULL_TREE); tem = build2 (MODIFY_EXPR, void_type_node, r, OMP_CLAUSE_DECL (c)); gimplify_and_add (tem, pre_p); - g = gimple_build_assign (cnts[i], size_binop (PLUS_EXPR, cnts[i], - size_int (1))); + if (i == 5) + { + r = build4 (ARRAY_REF, ptr_type_node, array, + size_binop (PLUS_EXPR, cnts[i], size_int (1)), + NULL_TREE, NULL_TREE); + tem = build_int_cst (ptr_type_node, GOMP_DEPEND_INOUTSET); + tem = build2 (MODIFY_EXPR, void_type_node, r, tem); + append_to_statement_list_force (tem, last_body); + gimplify_and_add (tem, pre_p); + } + g = gimple_build_assign (cnts[i], + size_binop (PLUS_EXPR, cnts[i], + size_int (1 + (i == 5)))); gimple_seq_add_stmt (pre_p, g); } } @@ -8685,7 +8757,7 @@ gimplify_omp_depend (tree *list_p, gimple_seq *pre_p) else { tree prev = size_int (5); - for (i = 0; i < 4; i++) + for (i = 0; i < 5; i++) { if (unused[i]) continue; diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index 8aebaee..b97e0e9 100644 --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -12304,7 +12304,7 @@ lower_depend_clauses (tree *pclauses, gimple_seq *iseq, gimple_seq *oseq) { tree c, clauses; gimple *g; - size_t cnt[4] = { 0, 0, 0, 0 }, idx = 2, i; + size_t cnt[5] = { 0, 0, 0, 0, 0 }, idx = 2, i; clauses = omp_find_clause (*pclauses, OMP_CLAUSE_DEPEND); gcc_assert (clauses); @@ -12328,16 +12328,20 @@ lower_depend_clauses (tree *pclauses, gimple_seq *iseq, gimple_seq *oseq) case OMP_CLAUSE_DEPEND_DEPOBJ: cnt[3]++; break; + case OMP_CLAUSE_DEPEND_INOUTSET: + cnt[4]++; + break; case OMP_CLAUSE_DEPEND_SOURCE: case OMP_CLAUSE_DEPEND_SINK: /* FALLTHRU */ default: gcc_unreachable (); } - if (cnt[1] || cnt[3]) + if (cnt[1] || cnt[3] || cnt[4]) idx = 5; - size_t total = cnt[0] + cnt[1] + cnt[2] + cnt[3]; - tree type = build_array_type_nelts (ptr_type_node, total + idx); + size_t total = cnt[0] + cnt[1] + cnt[2] + cnt[3] + cnt[4]; + size_t inoutidx = total + idx; + tree type = build_array_type_nelts (ptr_type_node, total + idx + 2 * cnt[4]); tree array = create_tmp_var (type); TREE_ADDRESSABLE (array) = 1; tree r = build4 (ARRAY_REF, ptr_type_node, array, size_int (0), NULL_TREE, @@ -12358,7 +12362,7 @@ lower_depend_clauses (tree *pclauses, gimple_seq *iseq, gimple_seq *oseq) g = gimple_build_assign (r, build_int_cst (ptr_type_node, cnt[i])); gimple_seq_add_stmt (iseq, g); } - for (i = 0; i < 4; i++) + for (i = 0; i < 5; i++) { if (cnt[i] == 0) continue; @@ -12386,10 +12390,21 @@ lower_depend_clauses (tree *pclauses, gimple_seq *iseq, gimple_seq *oseq) if (i != 3) continue; break; + case OMP_CLAUSE_DEPEND_INOUTSET: + if (i != 4) + continue; + break; default: gcc_unreachable (); } tree t = OMP_CLAUSE_DECL (c); + if (i == 4) + { + t = build4 (ARRAY_REF, ptr_type_node, array, + size_int (inoutidx), NULL_TREE, NULL_TREE); + t = build_fold_addr_expr (t); + inoutidx += 2; + } t = fold_convert (ptr_type_node, t); gimplify_expr (&t, iseq, NULL, is_gimple_val, fb_rvalue); r = build4 (ARRAY_REF, ptr_type_node, array, size_int (idx++), @@ -12398,6 +12413,25 @@ lower_depend_clauses (tree *pclauses, gimple_seq *iseq, gimple_seq *oseq) gimple_seq_add_stmt (iseq, g); } } + if (cnt[4]) + for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND + && OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_INOUTSET) + { + tree t = OMP_CLAUSE_DECL (c); + t = fold_convert (ptr_type_node, t); + gimplify_expr (&t, iseq, NULL, is_gimple_val, fb_rvalue); + r = build4 (ARRAY_REF, ptr_type_node, array, size_int (idx++), + NULL_TREE, NULL_TREE); + g = gimple_build_assign (r, t); + gimple_seq_add_stmt (iseq, g); + t = build_int_cst (ptr_type_node, GOMP_DEPEND_INOUTSET); + r = build4 (ARRAY_REF, ptr_type_node, array, size_int (idx++), + NULL_TREE, NULL_TREE); + g = gimple_build_assign (r, t); + gimple_seq_add_stmt (iseq, g); + } + c = build_omp_clause (UNKNOWN_LOCATION, OMP_CLAUSE_DEPEND); OMP_CLAUSE_DEPEND_KIND (c) = OMP_CLAUSE_DEPEND_LAST; OMP_CLAUSE_DECL (c) = build_fold_addr_expr (array); diff --git a/gcc/testsuite/c-c++-common/gomp/all-memory-1.c b/gcc/testsuite/c-c++-common/gomp/all-memory-1.c index 5d63e0d..0fb4570 100644 --- a/gcc/testsuite/c-c++-common/gomp/all-memory-1.c +++ b/gcc/testsuite/c-c++-common/gomp/all-memory-1.c @@ -49,4 +49,6 @@ boo (void) ; #pragma omp task depend(mutexinoutset: omp_all_memory) /* { dg-error "'omp_all_memory' used with 'depend' kind other than 'out' or 'inout'" } */ ; + #pragma omp task depend(inoutset: omp_all_memory) /* { dg-error "'omp_all_memory' used with 'depend' kind other than 'out' or 'inout'" } */ + ; } diff --git a/gcc/testsuite/c-c++-common/gomp/all-memory-2.c b/gcc/testsuite/c-c++-common/gomp/all-memory-2.c index 6f5d31b..99b5945 100644 --- a/gcc/testsuite/c-c++-common/gomp/all-memory-2.c +++ b/gcc/testsuite/c-c++-common/gomp/all-memory-2.c @@ -52,4 +52,6 @@ boo (void) ; #pragma omp task depend(mutexinoutset: omp_all_memory) ; + #pragma omp task depend(inoutset: omp_all_memory) + ; } diff --git a/gcc/testsuite/c-c++-common/gomp/depobj-1.c b/gcc/testsuite/c-c++-common/gomp/depobj-1.c index 688371b..77fd971 100644 --- a/gcc/testsuite/c-c++-common/gomp/depobj-1.c +++ b/gcc/testsuite/c-c++-common/gomp/depobj-1.c @@ -21,6 +21,9 @@ f1 (void) ; #pragma omp depobj(pdepobj[0]) depend(mutexinoutset:a) #pragma omp depobj(*pdepobj) destroy + #pragma omp depobj(depobja[0]) depend(inoutset: a) + #pragma omp depobj(depobja[0]) update(mutexinoutset) + #pragma omp depobj(depobja[0]) update(inoutset) } void @@ -38,7 +41,7 @@ f2 (void) #pragma omp depobj (a) destroy /* { dg-error "type of 'depobj' expression is not 'omp_depend_t'" } */ #pragma omp depobj (depobj) depend(depobj:a) /* { dg-error "does not have 'omp_depend_t' type in 'depend' clause with 'depobj' dependence type" } */ #pragma omp depobj (depobj) depend(depobj:*depobjb) /* { dg-error "'depobj' dependence type specified in 'depend' clause on 'depobj' construct" } */ - #pragma omp depobj (depobj) update(foobar) /* { dg-error "expected 'in', 'out', 'inout' or 'mutexinoutset'" } */ + #pragma omp depobj (depobj) update(foobar) /* { dg-error "expected 'in', 'out', 'inout', 'mutexinoutset' or 'inoutset'" } */ #pragma omp depobj (depobj) depend(in: *depobja) /* { dg-error "should not have 'omp_depend_t' type in 'depend' clause with dependence type" } */ #pragma omp depobj (depobj) depend(in: a) depend(in: b) /* { dg-error "expected" } */ #pragma omp depobj (depobj) depend(in: a) update(out) /* { dg-error "expected" } */ diff --git a/gcc/testsuite/g++.dg/gomp/depobj-1.C b/gcc/testsuite/g++.dg/gomp/depobj-1.C index 6004f1e..cb091a1 100644 --- a/gcc/testsuite/g++.dg/gomp/depobj-1.C +++ b/gcc/testsuite/g++.dg/gomp/depobj-1.C @@ -83,7 +83,7 @@ f4 (void) #pragma omp depobj (a) destroy // { dg-error "type of 'depobj' expression is not 'omp_depend_t'" } #pragma omp depobj (depobj) depend(depobj:a) // { dg-error "does not have 'omp_depend_t' type in 'depend' clause with 'depobj' dependence type" } #pragma omp depobj (depobj) depend(depobj:*depobjb) // { dg-error "'depobj' dependence type specified in 'depend' clause on 'depobj' construct" } - #pragma omp depobj (depobj) update(foobar) // { dg-error "expected 'in', 'out', 'inout' or 'mutexinoutset'" } + #pragma omp depobj (depobj) update(foobar) // { dg-error "expected 'in', 'out', 'inout', 'mutexinoutset' or 'inoutset'" } #pragma omp depobj (depobj) depend(in: *depobja) // { dg-error "should not have 'omp_depend_t' type in 'depend' clause with dependence type" } #pragma omp depobj (depobj) depend(in: a) depend(in: b) // { dg-error "expected" } #pragma omp depobj (depobj) depend(in: a) update(out) // { dg-error "expected" } diff --git a/gcc/tree-core.h b/gcc/tree-core.h index 93258e3..2383b57 100644 --- a/gcc/tree-core.h +++ b/gcc/tree-core.h @@ -1527,6 +1527,7 @@ enum omp_clause_depend_kind OMP_CLAUSE_DEPEND_OUT, OMP_CLAUSE_DEPEND_INOUT, OMP_CLAUSE_DEPEND_MUTEXINOUTSET, + OMP_CLAUSE_DEPEND_INOUTSET, OMP_CLAUSE_DEPEND_SOURCE, OMP_CLAUSE_DEPEND_SINK, OMP_CLAUSE_DEPEND_DEPOBJ, diff --git a/gcc/tree-pretty-print.cc b/gcc/tree-pretty-print.cc index d7615aa..333ac23 100644 --- a/gcc/tree-pretty-print.cc +++ b/gcc/tree-pretty-print.cc @@ -804,6 +804,9 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags) case OMP_CLAUSE_DEPEND_MUTEXINOUTSET: name = "mutexinoutset"; break; + case OMP_CLAUSE_DEPEND_INOUTSET: + name = "inoutset"; + break; case OMP_CLAUSE_DEPEND_SOURCE: pp_string (pp, "source)"); return; |