public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] openmp: Add support for inoutset depend-kind
@ 2022-05-17 13:55 Jakub Jelinek
  2022-05-18  9:02 ` [Patch] OpenMP: Add Fortran support for inoutset depend-kind (was: openmp: Add support for inoutset depend-kind) Tobias Burnus
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2022-05-17 13:55 UTC (permalink / raw)
  To: gcc-patches

Hi!

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.

Bootstrapped/regtested on x86_64-linux and i686-linux, committed
to trunk.

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.

--- gcc/tree-core.h.jj	2022-05-17 09:00:46.753995662 +0200
+++ gcc/tree-core.h	2022-05-17 11:19:00.901120286 +0200
@@ -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,
--- gcc/tree-pretty-print.cc.jj	2022-05-17 09:00:46.794995110 +0200
+++ gcc/tree-pretty-print.cc	2022-05-17 11:19:00.902120273 +0200
@@ -804,6 +804,9 @@ dump_omp_clause (pretty_printer *pp, tre
 	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;
--- gcc/gimplify.cc.jj	2022-05-17 09:00:46.563998222 +0200
+++ gcc/gimplify.cc	2022-05-17 11:19:00.890120434 +0200
@@ -8270,9 +8270,9 @@ gimplify_omp_depend (tree *list_p, gimpl
 {
   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, gimpl
 	  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, gimpl
 	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, gimpl
   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, gimpl
       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, gimpl
 	}
       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, gimpl
 	  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, gimpl
 	      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, gimpl
 	    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, gimpl
   else
     {
       tree prev = size_int (5);
-      for (i = 0; i < 4; i++)
+      for (i = 0; i < 5; i++)
 	{
 	  if (unused[i])
 	    continue;
--- gcc/omp-low.cc.jj	2022-05-17 09:00:46.569998141 +0200
+++ gcc/omp-low.cc	2022-05-17 11:19:00.900120300 +0200
@@ -12304,7 +12304,7 @@ lower_depend_clauses (tree *pclauses, gi
 {
   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, gi
 	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, gi
       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, gi
 		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, gi
 	    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);
--- gcc/c-family/c-omp.cc.jj	2022-05-17 09:00:46.048005173 +0200
+++ gcc/c-family/c-omp.cc	2022-05-17 11:19:00.901120286 +0200
@@ -738,6 +738,7 @@ c_finish_omp_depobj (location_t loc, tre
 	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, tre
     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;
--- gcc/c/c-parser.cc.jj	2022-05-17 09:00:46.440999879 +0200
+++ gcc/c/c-parser.cc	2022-05-17 11:19:00.899120313 +0200
@@ -16067,7 +16067,7 @@ c_parser_omp_clause_affinity (c_parser *
    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 *pa
 	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);
 	    }
--- gcc/cp/parser.cc.jj	2022-05-17 09:00:46.526998720 +0200
+++ gcc/cp/parser.cc	2022-05-17 11:19:00.896120354 +0200
@@ -39446,6 +39446,8 @@ cp_parser_omp_clause_depend (cp_parser *
 	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,
 		    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,
--- gcc/cp/cxx-pretty-print.cc.jj	2022-05-17 09:00:46.496999124 +0200
+++ gcc/cp/cxx-pretty-print.cc	2022-05-17 11:19:00.896120354 +0200
@@ -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;
--- gcc/testsuite/c-c++-common/gomp/all-memory-1.c.jj	2022-05-12 08:30:53.472434375 +0200
+++ gcc/testsuite/c-c++-common/gomp/all-memory-1.c	2022-05-17 11:22:29.295311157 +0200
@@ -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'" } */
+  ;
 }
--- gcc/testsuite/c-c++-common/gomp/all-memory-2.c.jj	2022-05-12 08:30:53.472434375 +0200
+++ gcc/testsuite/c-c++-common/gomp/all-memory-2.c	2022-05-17 11:23:01.090882557 +0200
@@ -52,4 +52,6 @@ boo (void)
   ;
   #pragma omp task depend(mutexinoutset: omp_all_memory)
   ;
+  #pragma omp task depend(inoutset: omp_all_memory)
+  ;
 }
--- gcc/testsuite/c-c++-common/gomp/depobj-1.c.jj	2022-05-17 09:00:46.652997023 +0200
+++ gcc/testsuite/c-c++-common/gomp/depobj-1.c	2022-05-17 11:25:31.464855522 +0200
@@ -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" } */
--- gcc/testsuite/g++.dg/gomp/depobj-1.C.jj	2022-05-17 09:00:46.694996456 +0200
+++ gcc/testsuite/g++.dg/gomp/depobj-1.C	2022-05-17 11:19:00.896120354 +0200
@@ -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" }
--- include/gomp-constants.h.jj	2022-05-17 09:00:46.861994207 +0200
+++ include/gomp-constants.h	2022-05-17 11:19:00.902120273 +0200
@@ -328,6 +328,7 @@ enum gomp_map_kind
 #define GOMP_DEPEND_OUT			2
 #define GOMP_DEPEND_INOUT		3
 #define GOMP_DEPEND_MUTEXINOUTSET	4
+#define GOMP_DEPEND_INOUTSET		5
 
 /* HSA specific data structures.  */
 
--- libgomp/libgomp.h.jj	2022-05-17 09:00:46.916993467 +0200
+++ libgomp/libgomp.h	2022-05-17 11:19:00.902120273 +0200
@@ -536,8 +536,8 @@ struct gomp_task_depend_entry
   struct gomp_task_depend_entry *prev;
   /* Task that provides the dependency in ADDR.  */
   struct gomp_task *task;
-  /* Depend entry is of type "IN".  */
-  bool is_in;
+  /* Depend entry is of type "IN" (1) or "INOUTSET" (2).  */
+  unsigned char is_in;
   bool redundant;
   bool redundant_out;
 };
--- libgomp/task.c.jj	2022-05-17 09:00:46.970992739 +0200
+++ libgomp/task.c	2022-05-17 11:19:00.903120259 +0200
@@ -197,6 +197,7 @@ gomp_task_handle_depend (struct gomp_tas
       /* ndepend - nout - nmutexinoutset - nin is # of depobjs */
       size_t normal = nout + nmutexinoutset + nin;
       size_t n = 0;
+      bool has_in = false;
       for (i = normal; i < ndepend; i++)
 	{
 	  void **d = (void **) (uintptr_t) depend[5 + i];
@@ -209,6 +210,8 @@ gomp_task_handle_depend (struct gomp_tas
 	    case GOMP_DEPEND_MUTEXINOUTSET:
 	      break;
 	    case GOMP_DEPEND_IN:
+	    case GOMP_DEPEND_INOUTSET:
+	      has_in = true;
 	      continue;
 	    default:
 	      gomp_fatal ("unknown omp_depend_t dependence type %d",
@@ -222,14 +225,17 @@ gomp_task_handle_depend (struct gomp_tas
 	  task->depend[n].addr = depend[5 + i];
 	  task->depend[n++].is_in = i >= nout + nmutexinoutset;
 	}
-      for (i = normal; i < ndepend; i++)
-	{
-	  void **d = (void **) (uintptr_t) depend[5 + i];
-	  if ((uintptr_t) d[1] != GOMP_DEPEND_IN)
-	    continue;
-	  task->depend[n].addr = d[0];
-	  task->depend[n++].is_in = 1;
-	}
+      if (has_in)
+	for (i = normal; i < ndepend; i++)
+	  {
+	    void **d = (void **) (uintptr_t) depend[5 + i];
+	    if ((uintptr_t) d[1] != GOMP_DEPEND_IN
+		&& (uintptr_t) d[1] != GOMP_DEPEND_INOUTSET)
+	      continue;
+	    task->depend[n].addr = d[0];
+	    task->depend[n++].is_in
+	      = 1 + ((uintptr_t) d[1] == GOMP_DEPEND_INOUTSET);
+	  }
     }
   task->num_dependees = 0;
   if (__builtin_expect (parent->depend_all_memory && ndepend, false))
@@ -381,8 +387,10 @@ gomp_task_handle_depend (struct gomp_tas
 
 	      last = ent;
 
-	      /* depend(in:...) doesn't depend on earlier depend(in:...).  */
-	      if (task->depend[i].is_in && ent->is_in)
+	      /* depend(in:...) doesn't depend on earlier depend(in:...).
+		 Similarly depend(inoutset:...) doesn't depend on earlier
+		 depend(inoutset:...).  */
+	      if (task->depend[i].is_in && task->depend[i].is_in == ent->is_in)
 		continue;
 
 	      if (!ent->is_in)
@@ -1890,6 +1898,9 @@ gomp_task_maybe_wait_for_dependencies (v
 	    case GOMP_DEPEND_MUTEXINOUTSET:
 	      elem.is_in = 0;
 	      break;
+	    case GOMP_DEPEND_INOUTSET:
+	      elem.is_in = 2;
+	      break;
 	    default:
 	      gomp_fatal ("unknown omp_depend_t dependence type %d",
 			  (int) (uintptr_t) d[1]);
@@ -1928,7 +1939,7 @@ gomp_task_maybe_wait_for_dependencies (v
 	}
       ent = htab_find (task->depend_hash, &elem);
       for (; ent; ent = ent->next)
-	if (elem.is_in && ent->is_in)
+	if (elem.is_in && elem.is_in == ent->is_in)
 	  continue;
 	else
 	  {
--- libgomp/testsuite/libgomp.c-c++-common/depend-1.c.jj	2022-05-12 08:30:53.473434361 +0200
+++ libgomp/testsuite/libgomp.c-c++-common/depend-1.c	2022-05-17 15:05:35.812599494 +0200
@@ -48,6 +48,11 @@ test (int ifval)
       usleep (5000);
       b[4] = 48;
     }
+    #pragma omp task shared(b) depend(inoutset: b[5])
+    {
+      usleep (5000);
+      b[5] = 49;
+    }
     /* None of the above tasks depend on each other.
        The following task depends on all but the a[4] = 46; one.  */
     #pragma omp task shared(a, b) depend(out: omp_all_memory) private(i) if(ifval)
@@ -55,7 +60,7 @@ test (int ifval)
       if (a[0] != 42 || a[1] != 43 || a[2] != 44 || a[3] != 45
 	  || a[5] != 5 || a[6] != 6 || a[7] != 7
 	  || b[0] != 47 || b[1] != 2 || b[2] != 4 || b[3] != 6
-	  || b[4] != 48 || b[5] != 10 || b[6] != 12 || b[7] != 14)
+	  || b[4] != 48 || b[5] != 49 || b[6] != 12 || b[7] != 14)
 	abort ();
       for (i = 0; i < 8; ++i)
 	if (i != 4)
--- libgomp/testsuite/libgomp.c-c++-common/depend-2.c.jj	2022-05-12 08:30:53.473434361 +0200
+++ libgomp/testsuite/libgomp.c-c++-common/depend-2.c	2022-05-17 12:58:42.509467650 +0200
@@ -52,6 +52,11 @@ test (int ifval)
       usleep (5000);
       b[4] = 48;
     }
+    #pragma omp task shared(b) depend(inoutset: b[5])
+    {
+      usleep (5000);
+      b[5] = 49;
+    }
     /* None of the above tasks depend on each other.
        The following task depends on all but the a[4] = 46; one.  */
     #pragma omp task shared(a, b) depend(depobj: d1) private(i) if(ifval)
@@ -59,7 +64,7 @@ test (int ifval)
       if (a[0] != 42 || a[1] != 43 || a[2] != 44 || a[3] != 45
 	  || a[5] != 5 || a[6] != 6 || a[7] != 7
 	  || b[0] != 47 || b[1] != 2 || b[2] != 4 || b[3] != 6
-	  || b[4] != 48 || b[5] != 10 || b[6] != 12 || b[7] != 14)
+	  || b[4] != 48 || b[5] != 49 || b[6] != 12 || b[7] != 14)
 	abort ();
       for (i = 0; i < 8; ++i)
 	if (i != 4)
--- libgomp/testsuite/libgomp.c-c++-common/depend-3.c.jj	2022-05-12 08:30:53.473434361 +0200
+++ libgomp/testsuite/libgomp.c-c++-common/depend-3.c	2022-05-17 13:00:03.427375956 +0200
@@ -48,6 +48,11 @@ main ()
       usleep (5000);
       b[4] = 48;
     }
+    #pragma omp task shared(b) depend(inoutset: b[5])
+    {
+      usleep (5000);
+      b[5] = 49;
+    }
     /* None of the above tasks depend on each other.
        The following task depends on all but the a[4] = 46; one.  */
     #pragma omp task shared(a, b) depend(iterator (j=0:7), inout: omp_all_memory) private(i)
@@ -55,7 +60,7 @@ main ()
       if (a[0] != 42 || a[1] != 43 || a[2] != 44 || a[3] != 45
 	  || a[5] != 5 || a[6] != 6 || a[7] != 7
 	  || b[0] != 47 || b[1] != 2 || b[2] != 4 || b[3] != 6
-	  || b[4] != 48 || b[5] != 10 || b[6] != 12 || b[7] != 14)
+	  || b[4] != 48 || b[5] != 49 || b[6] != 12 || b[7] != 14)
 	abort ();
       for (i = 0; i < 8; ++i)
 	if (i != 4)
--- libgomp/testsuite/libgomp.c-c++-common/depend-inoutset-1.c.jj	2022-05-17 13:45:20.133711784 +0200
+++ libgomp/testsuite/libgomp.c-c++-common/depend-inoutset-1.c	2022-05-17 15:20:54.597215874 +0200
@@ -0,0 +1,164 @@
+#include <omp.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int
+main ()
+{
+  int a[8] = {};
+  omp_depend_t d1, d2;
+  #pragma omp depobj (d1) depend(inoutset: a)
+  #pragma omp depobj (d2) depend(inout: a)
+  #pragma omp depobj (d2) update(inoutset)
+  #pragma omp parallel
+  {
+    #pragma omp barrier
+    #pragma omp master
+    {
+    #pragma omp task shared(a) depend(out: a)
+    {
+      usleep (5000);
+      a[0] = 1; a[1] = 2; a[2] = 3; a[3] = 4;
+    }
+    /* The above task needs to finish first.  */
+    #pragma omp task shared(a) depend(in: a)
+    {
+      if (a[0] != 1 || a[1] != 2 || a[2] != 3 || a[3] != 4)
+	abort ();
+      usleep (5000);
+      a[4] = 42;
+    }
+    #pragma omp task shared(a) depend(in: a)
+    {
+      if (a[0] != 1 || a[1] != 2 || a[2] != 3 || a[3] != 4)
+	abort ();
+      usleep (5000);
+      a[5] = 43;
+    }
+    #pragma omp task shared(a) depend(in: a)
+    {
+      if (a[0] != 1 || a[1] != 2 || a[2] != 3 || a[3] != 4)
+	abort ();
+      usleep (5000);
+      a[6] = 44;
+    }
+    #pragma omp task shared(a) depend(in: a)
+    {
+      if (a[0] != 1 || a[1] != 2 || a[2] != 3 || a[3] != 4)
+	abort ();
+      usleep (5000);
+      a[7] = 45;
+    }
+    /* The above 4 tasks can be scheduled in any order but need to wait
+       for the depend(out: a) task.  */
+    #pragma omp task shared(a) depend(inoutset: a)
+    {
+      if (a[4] != 42 || a[5] != 43 || a[6] != 44 || a[7] != 45)
+	abort ();
+      usleep (5000);
+      a[0] = 42;
+    }
+    #pragma omp task shared(a) depend(iterator(i=1:3:2), inoutset: a)
+    {
+      if (a[4] != 42 || a[5] != 43 || a[6] != 44 || a[7] != 45)
+	abort ();
+      usleep (5000);
+      a[1] = 43;
+    }
+    #pragma omp task shared(a) depend(depobj: d1)
+    {
+      if (a[4] != 42 || a[5] != 43 || a[6] != 44 || a[7] != 45)
+	abort ();
+      usleep (5000);
+      a[2] = 44;
+    }
+    #pragma omp task shared(a) depend(depobj: d2)
+    {
+      if (a[4] != 42 || a[5] != 43 || a[6] != 44 || a[7] != 45)
+	abort ();
+      usleep (5000);
+      a[3] = 45;
+    }
+    /* The above 4 tasks can be scheduled in any order but need to wait
+       for all the above depend(in: a) tasks.  */
+    #pragma omp task shared(a) depend(in: a)
+    {
+      if (a[0] != 42 || a[1] != 43 || a[2] != 44 || a[3] != 45)
+	abort ();
+      usleep (5000);
+      a[4] = 46;
+    }
+    #pragma omp task shared(a) depend(in: a)
+    {
+      if (a[0] != 42 || a[1] != 43 || a[2] != 44 || a[3] != 45)
+	abort ();
+      usleep (5000);
+      a[5] = 47;
+    }
+    #pragma omp task shared(a) depend(in: a)
+    {
+      if (a[0] != 42 || a[1] != 43 || a[2] != 44 || a[3] != 45)
+	abort ();
+      usleep (5000);
+      a[6] = 48;
+    }
+    #pragma omp task shared(a) depend(in: a)
+    {
+      if (a[0] != 42 || a[1] != 43 || a[2] != 44 || a[3] != 45)
+	abort ();
+      usleep (5000);
+      a[7] = 49;
+    }
+    /* The above 4 tasks can be scheduled in any order but need to wait
+       for all the above depend(inoutset: a),
+       depend(iterator(i=1:3:2), inoutset: a), depend(depobj: d1) and
+       depend(depobj: d2) tasks.  */
+    #pragma omp task shared(a) depend(inoutset: a)
+    {
+      if (a[4] != 46|| a[5] != 47 || a[6] != 48 || a[7] != 49)
+	abort ();
+      usleep (5000);
+      a[0] = 50;
+    }
+    /* The above task needs to wait for all the above 4 depend(in: a)
+       tasks.  */
+    #pragma omp task shared(a) depend(out: a)
+    {
+      if (a[0] != 50 || a[4] != 46|| a[5] != 47 || a[6] != 48 || a[7] != 49)
+	abort ();
+      usleep (5000);
+      a[0] = 51;
+    }
+    /* The above task needs to wait for the above depend(inoutset: a) task.  */
+    #pragma omp task shared(a) depend(inoutset: a)
+    {
+      if (a[0] != 51 || a[4] != 46|| a[5] != 47 || a[6] != 48 || a[7] != 49)
+	abort ();
+      usleep (5000);
+      a[0] = 52;
+    }
+    /* The above task needs to wait for the above depend(out: a) task.  */
+    #pragma omp task shared(a) depend(mutexinoutset: a)
+    {
+      if (a[0] != 52 || a[4] != 46|| a[5] != 47 || a[6] != 48 || a[7] != 49)
+	abort ();
+      usleep (5000);
+      a[0] = 53;
+    }
+    /* The above task needs to wait for the above depend(inoutset: a) task.  */
+    #pragma omp task shared(a) depend(inoutset: a)
+    {
+      if (a[0] != 53 || a[4] != 46|| a[5] != 47 || a[6] != 48 || a[7] != 49)
+	abort ();
+      usleep (5000);
+      a[0] = 54;
+    }
+    /* The above task needs to wait for the above
+       depend(mutexinoutset: a) task.  */
+    }
+  }
+  if (a[0] != 54 || a[1] != 43 || a[2] != 44 || a[3] != 45
+      || a[4] != 46|| a[5] != 47 || a[6] != 48 || a[7] != 49)
+    abort ();
+  return 0;
+}

	Jakub


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Patch] OpenMP: Add Fortran support for inoutset depend-kind (was: openmp: Add support for inoutset depend-kind)
  2022-05-17 13:55 [committed] openmp: Add support for inoutset depend-kind Jakub Jelinek
@ 2022-05-18  9:02 ` Tobias Burnus
  2022-05-18  9:22   ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Burnus @ 2022-05-18  9:02 UTC (permalink / raw)
  To: Jakub Jelinek, gcc-patches, fortran

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

On 17.05.22 15:55, Jakub Jelinek via Gcc-patches wrote:
> This patch adds support for inoutset depend-kind in depend
> clauses.

While this patch adds the Fortran FE bits and converts the C/C++
testcase changes for Fortran.

Bootstrapped/regtested on x86_64-linux.
OK for trunk?

Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: omp-inoutset-f90.diff --]
[-- Type: text/x-patch, Size: 19977 bytes --]

OpenMP: Add Fortran support for inoutset depend-kind

Fortran additions to the C/C++ + ME/libgomp commit
r13-556-g2c16eb3157f86ae561468c540caf8eb326106b5f

gcc/fortran/ChangeLog:

	* gfortran.h (enum gfc_omp_depend_op): Add OMP_DEPEND_INOUTSET.
	(gfc_omp_clauses): Enlarge ENUM_BITFIELD.
	* dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle
	'inoutset' depend modifier.
	* openmp.cc (gfc_match_omp_clauses, gfc_match_omp_depobj): Likewise.
	* trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj):
	Likewise.

libgomp/ChangeLog:

	* libgomp.texi (OpenMP 5.1): Set 'inoutset' to Y.
	(OpenMP Context Selectors): Add missing comma.
	* testsuite/libgomp.fortran/depend-5.f90: Add inoutset test.
	* testsuite/libgomp.fortran/depend-6.f90: Likewise.
	* testsuite/libgomp.fortran/depend-7.f90: Likewise.
	* testsuite/libgomp.fortran/depend-inoutset-1.f90: New test.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/all-memory-1.f90: Add inoutset test.
	* gfortran.dg/gomp/all-memory-2.f90: Likewise.
	* gfortran.dg/gomp/depobj-1.f90: Likewise.
	* gfortran.dg/gomp/depobj-2.f90: Likewise.

 gcc/fortran/dump-parse-tree.cc                     |   2 +
 gcc/fortran/gfortran.h                             |   3 +-
 gcc/fortran/openmp.cc                              |  12 +-
 gcc/fortran/trans-openmp.cc                        |   4 +
 gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90    |   3 +
 gcc/testsuite/gfortran.dg/gomp/all-memory-2.f90    |   3 +
 gcc/testsuite/gfortran.dg/gomp/depobj-1.f90        |   3 +
 gcc/testsuite/gfortran.dg/gomp/depobj-2.f90        |   6 +-
 libgomp/libgomp.texi                               |   4 +-
 libgomp/testsuite/libgomp.fortran/depend-5.f90     |   8 +-
 libgomp/testsuite/libgomp.fortran/depend-6.f90     |   8 +-
 libgomp/testsuite/libgomp.fortran/depend-7.f90     |   8 +-
 .../libgomp.fortran/depend-inoutset-1.f90          | 170 +++++++++++++++++++++
 13 files changed, 221 insertions(+), 13 deletions(-)

diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index a32992035a2..4e8986bd599 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -1379,6 +1379,7 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
 	  case OMP_DEPEND_IN: fputs ("in:", dumpfile); break;
 	  case OMP_DEPEND_OUT: fputs ("out:", dumpfile); break;
 	  case OMP_DEPEND_INOUT: fputs ("inout:", dumpfile); break;
+	  case OMP_DEPEND_INOUTSET: fputs ("inoutset:", dumpfile); break;
 	  case OMP_DEPEND_DEPOBJ: fputs ("depobj:", dumpfile); break;
 	  case OMP_DEPEND_MUTEXINOUTSET:
 	    fputs ("mutexinoutset:", dumpfile);
@@ -1898,6 +1899,7 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
 	case OMP_DEPEND_IN: deptype = "IN"; break;
 	case OMP_DEPEND_OUT: deptype = "OUT"; break;
 	case OMP_DEPEND_INOUT: deptype = "INOUT"; break;
+	case OMP_DEPEND_INOUTSET: deptype = "INOUTSET"; break;
 	case OMP_DEPEND_MUTEXINOUTSET: deptype = "MUTEXINOUTSET"; break;
 	default: gcc_unreachable ();
 	}
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 1bce2833139..5d970bc1df0 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1271,6 +1271,7 @@ enum gfc_omp_depend_op
   OMP_DEPEND_IN,
   OMP_DEPEND_OUT,
   OMP_DEPEND_INOUT,
+  OMP_DEPEND_INOUTSET,
   OMP_DEPEND_MUTEXINOUTSET,
   OMP_DEPEND_DEPOBJ,
   OMP_DEPEND_SINK_FIRST,
@@ -1540,7 +1541,7 @@ typedef struct gfc_omp_clauses
   ENUM_BITFIELD (gfc_omp_memorder) fail:3;
   ENUM_BITFIELD (gfc_omp_cancel_kind) cancel:3;
   ENUM_BITFIELD (gfc_omp_proc_bind_kind) proc_bind:3;
-  ENUM_BITFIELD (gfc_omp_depend_op) depobj_update:3;
+  ENUM_BITFIELD (gfc_omp_depend_op) depobj_update:4;
   ENUM_BITFIELD (gfc_omp_bind_type) bind:2;
   ENUM_BITFIELD (gfc_omp_at_type) at:2;
   ENUM_BITFIELD (gfc_omp_severity_type) severity:2;
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index 3061e5297b7..63fd4dd2767 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -1915,7 +1915,9 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
 		break;
 	      m = MATCH_YES;
 	      gfc_omp_depend_op depend_op = OMP_DEPEND_OUT;
-	      if (gfc_match ("inout") == MATCH_YES)
+	      if (gfc_match ("inoutset") == MATCH_YES)
+		depend_op = OMP_DEPEND_INOUTSET;
+	      else if (gfc_match ("inout") == MATCH_YES)
 		depend_op = OMP_DEPEND_INOUT;
 	      else if (gfc_match ("in") == MATCH_YES)
 		depend_op = OMP_DEPEND_IN;
@@ -3805,7 +3807,9 @@ gfc_match_omp_depobj (void)
   if (gfc_match ("update ( ") == MATCH_YES)
     {
       c = gfc_get_omp_clauses ();
-      if (gfc_match ("inout )") == MATCH_YES)
+      if (gfc_match ("inoutset )") == MATCH_YES)
+	c->depobj_update = OMP_DEPEND_INOUTSET;
+      else if (gfc_match ("inout )") == MATCH_YES)
 	c->depobj_update = OMP_DEPEND_INOUT;
       else if (gfc_match ("in )") == MATCH_YES)
 	c->depobj_update = OMP_DEPEND_IN;
@@ -3815,8 +3819,8 @@ gfc_match_omp_depobj (void)
 	c->depobj_update = OMP_DEPEND_MUTEXINOUTSET;
       else
 	{
-	  gfc_error ("Expected IN, OUT, INOUT, MUTEXINOUTSET followed by "
-		     "%<)%> at %C");
+	  gfc_error ("Expected IN, OUT, INOUT, INOUTSET or MUTEXINOUTSET "
+		     "followed by %<)%> at %C");
 	  goto error;
 	}
     }
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index 7633aee755c..e1907a46d5a 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -2937,6 +2937,9 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
 		  case OMP_DEPEND_INOUT:
 		    OMP_CLAUSE_DEPEND_KIND (node) = OMP_CLAUSE_DEPEND_INOUT;
 		    break;
+		  case OMP_DEPEND_INOUTSET:
+		    OMP_CLAUSE_DEPEND_KIND (node) = OMP_CLAUSE_DEPEND_INOUTSET;
+		    break;
 		  case OMP_DEPEND_MUTEXINOUTSET:
 		    OMP_CLAUSE_DEPEND_KIND (node)
 		      = OMP_CLAUSE_DEPEND_MUTEXINOUTSET;
@@ -5593,6 +5596,7 @@ gfc_trans_omp_depobj (gfc_code *code)
       case OMP_DEPEND_IN: k = GOMP_DEPEND_IN; break;
       case OMP_DEPEND_OUT: k = GOMP_DEPEND_OUT; break;
       case OMP_DEPEND_INOUT: k = GOMP_DEPEND_INOUT; break;
+      case OMP_DEPEND_INOUTSET: k = GOMP_DEPEND_INOUTSET; break;
       case OMP_DEPEND_MUTEXINOUTSET: k = GOMP_DEPEND_MUTEXINOUTSET; break;
       default: gcc_unreachable ();
       }
diff --git a/gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90 b/gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90
index 6d56473b1f3..f8f34f0c887 100644
--- a/gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/all-memory-1.f90
@@ -44,6 +44,9 @@ subroutine f6
   !$omp target depend(mutexinoutset : omp_all_memory )  ! { dg-error "'omp_all_memory' used with DEPEND kind other than OUT or INOUT" }
   ! !$omp end target
 
+  !$omp target depend(inoutset : omp_all_memory )  ! { dg-error "'omp_all_memory' used with DEPEND kind other than OUT or INOUT" }
+  ! !$omp end target
+
   !$omp target depend ( depobj : omp_all_memory)  ! { dg-error "'omp_all_memory' used with DEPEND kind other than OUT or INOUT" }
   !!$omp end target
 
diff --git a/gcc/testsuite/gfortran.dg/gomp/all-memory-2.f90 b/gcc/testsuite/gfortran.dg/gomp/all-memory-2.f90
index f7ee34fedc8..e7d51bef885 100644
--- a/gcc/testsuite/gfortran.dg/gomp/all-memory-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/all-memory-2.f90
@@ -45,6 +45,9 @@ subroutine f6
   !$omp target depend(mutexinoutset : omp_all_memory )
   ! !$omp end target
 
+  !$omp target depend(inoutset : omp_all_memory )
+  ! !$omp end target
+
  !$omp target depend ( depobj : omp_all_memory)
  !$omp end target
 
diff --git a/gcc/testsuite/gfortran.dg/gomp/depobj-1.f90 b/gcc/testsuite/gfortran.dg/gomp/depobj-1.f90
index 66cfb61060f..73734bbb07e 100644
--- a/gcc/testsuite/gfortran.dg/gomp/depobj-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/depobj-1.f90
@@ -22,4 +22,7 @@ subroutine f1
   !$omp task depend(mutexinoutset: a)
   !$omp end task
   !$omp depobj(depobj2) destroy
+  !$omp depobj(depobj1) depend(inoutset: a)
+  !$omp depobj(depobj1) update(mutexinoutset)
+  !$omp depobj(depobj1) update(inoutset)
 end subroutine f1
diff --git a/gcc/testsuite/gfortran.dg/gomp/depobj-2.f90 b/gcc/testsuite/gfortran.dg/gomp/depobj-2.f90
index 3ffd3d5d01b..cb67c3ce9d1 100644
--- a/gcc/testsuite/gfortran.dg/gomp/depobj-2.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/depobj-2.f90
@@ -23,9 +23,9 @@ subroutine f1
   !$omp depobj(depobj) depend(mutexinoutset : a)     ! OK
   !$omp depobj(depobj) depend(source)                ! { dg-error "DEPEND clause at .1. of OMP DEPOBJ construct shall not have dependence-type SOURCE, SINK or DEPOBJ" }
   !$omp depobj(depobj) depend(sink : i + 1)          ! { dg-error "DEPEND clause at .1. of OMP DEPOBJ construct shall not have dependence-type SOURCE, SINK or DEPOBJ" }
-  !$omp depobj(depobj) update(source)                ! { dg-error "Expected IN, OUT, INOUT, MUTEXINOUTSET followed by '\\)'" }
-  !$omp depobj(depobj) update(sink)                  ! { dg-error "Expected IN, OUT, INOUT, MUTEXINOUTSET followed by '\\)'" }
-  !$omp depobj(depobj) update(depobj)                ! { dg-error "Expected IN, OUT, INOUT, MUTEXINOUTSET followed by '\\)'" }
+  !$omp depobj(depobj) update(source)                ! { dg-error "Expected IN, OUT, INOUT, INOUTSET or MUTEXINOUTSET followed by '\\)'" }
+  !$omp depobj(depobj) update(sink)                  ! { dg-error "Expected IN, OUT, INOUT, INOUTSET or MUTEXINOUTSET followed by '\\)'" }
+  !$omp depobj(depobj) update(depobj)                ! { dg-error "Expected IN, OUT, INOUT, INOUTSET or MUTEXINOUTSET followed by '\\)'" }
 
   ! Valid in OpenMP 5.1:
   !$omp depobj(depobj5) depend(depobj: depobj3)      ! { dg-error "DEPEND clause at .1. of OMP DEPOBJ construct shall not have dependence-type SOURCE, SINK or DEPOBJ" }
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index 9f40bae1247..c9d01cd8a5c 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -306,7 +306,7 @@ The OpenMP 4.5 specification is fully supported.
 @item @code{nowait} clause in @code{taskwait} directive @tab N @tab
 @item Extensions to the @code{atomic} directive @tab Y @tab
 @item @code{seq_cst} clause on a @code{flush} construct @tab Y @tab
-@item @code{inoutset} argument to the @code{depend} clause @tab N @tab
+@item @code{inoutset} argument to the @code{depend} clause @tab Y @tab
 @item @code{private} and @code{firstprivate} argument to @code{default}
       clause in C and C++ @tab Y @tab
 @item @code{present} argument to @code{defaultmap} clause @tab N @tab
@@ -4279,7 +4279,7 @@ The following sections present notes on the offload-target specifics.
       @code{i586}, @code{i686}, @code{ia32}
       @tab @code{host}
       @tab See @code{-m...} flags in ``x86 Options'' (without @code{-m})
-@item @code{amdgcn} @code{gcn}
+@item @code{amdgcn}, @code{gcn}
       @tab @code{gpu}
       @tab See @code{-march=} in ``AMD GCN Options''
 @item @code{nvptx}
diff --git a/libgomp/testsuite/libgomp.fortran/depend-5.f90 b/libgomp/testsuite/libgomp.fortran/depend-5.f90
index a350e793623..b812b6dab53 100644
--- a/libgomp/testsuite/libgomp.fortran/depend-5.f90
+++ b/libgomp/testsuite/libgomp.fortran/depend-5.f90
@@ -59,6 +59,12 @@ subroutine test (ifval)
       call usleep (5000)
       b(4) = 48
     end block
+    !$omp task shared(b) depend(inoutset: b(5))
+    block
+      call usleep (5000)
+      b(5) = 49
+    end block
+
     ! None of the above tasks depend on each other.
     ! The following task depends on all but the a(4) = 46; one.
     !$omp task shared(a, b) depend(out: omp_all_memory) private(i) if(ifval)
@@ -66,7 +72,7 @@ subroutine test (ifval)
       if (a(0) /= 42 .or. a(1) /= 43 .or. a(2) /= 44 .or. a(3) /= 45       &
           .or. a(5) /= 5 .or. a(6) /= 6 .or. a(7) /= 7                     &
           .or. b(0) /= 47 .or. b(1) /= 2 .or. b(2) /= 4 .or. b(3) /= 6     &
-          .or. b(4) /= 48 .or. b(5) /= 10 .or. b(6) /= 12 .or. b(7) /= 14) &
+          .or. b(4) /= 48 .or. b(5) /= 49 .or. b(6) /= 12 .or. b(7) /= 14) &
         error stop
       do i = 0, 7
         if (i /= 4) &
diff --git a/libgomp/testsuite/libgomp.fortran/depend-6.f90 b/libgomp/testsuite/libgomp.fortran/depend-6.f90
index edea8571bba..b5032e98a2f 100644
--- a/libgomp/testsuite/libgomp.fortran/depend-6.f90
+++ b/libgomp/testsuite/libgomp.fortran/depend-6.f90
@@ -62,6 +62,12 @@ subroutine test (ifval)
       call usleep (5000)
       b(4) = 48
     end block
+    !$omp task shared(b) depend(inoutset: b(5))
+    block
+      call usleep (5000)
+      b(5) = 49
+    end block
+
     ! None of the above tasks depend on each other.
     ! The following task depends on all but the a(4) = 46; one.
     !$omp task shared(a, b) depend(depobj: d1) private(i) if(ifval)
@@ -69,7 +75,7 @@ subroutine test (ifval)
       if (a(0) /= 42 .or. a(1) /= 43 .or. a(2) /= 44 .or. a(3) /= 45       &
           .or. a(5) /= 5 .or. a(6) /= 6 .or. a(7) /= 7                     &
           .or. b(0) /= 47 .or. b(1) /= 2 .or. b(2) /= 4 .or. b(3) /= 6     &
-          .or. b(4) /= 48 .or. b(5) /= 10 .or. b(6) /= 12 .or. b(7) /= 14) &
+          .or. b(4) /= 48 .or. b(5) /= 49 .or. b(6) /= 12 .or. b(7) /= 14) &
         error stop
       do i = 0, 7
         if (i /= 4) &
diff --git a/libgomp/testsuite/libgomp.fortran/depend-7.f90 b/libgomp/testsuite/libgomp.fortran/depend-7.f90
index d3f3988f0da..771a59c50f0 100644
--- a/libgomp/testsuite/libgomp.fortran/depend-7.f90
+++ b/libgomp/testsuite/libgomp.fortran/depend-7.f90
@@ -57,6 +57,12 @@ program main
       call usleep (5000)
       b(4) = 48
     end block
+    !$omp task shared(b) depend(inoutset: b(5))
+    block
+      call usleep (5000)
+      b(5) = 49
+    end block
+
     ! None of the above tasks depend on each other.
     ! The following task depends on all but the a(4) = 46; one.
     !$omp task shared(a, b) depend(iterator (j=0:7), inout: omp_all_memory) private(i)
@@ -64,7 +70,7 @@ program main
       if (a(0) /= 42 .or. a(1) /= 43 .or. a(2) /= 44 .or. a(3) /= 45       &
           .or. a(5) /= 5 .or. a(6) /= 6 .or. a(7) /= 7                     &
           .or. b(0) /= 47 .or. b(1) /= 2 .or. b(2) /= 4 .or. b(3) /= 6     &
-          .or. b(4) /= 48 .or. b(5) /= 10 .or. b(6) /= 12 .or. b(7) /= 14) &
+          .or. b(4) /= 48 .or. b(5) /= 49 .or. b(6) /= 12 .or. b(7) /= 14) &
         error stop
       do i = 0, 7
         if (i /= 4) &
diff --git a/libgomp/testsuite/libgomp.fortran/depend-inoutset-1.f90 b/libgomp/testsuite/libgomp.fortran/depend-inoutset-1.f90
new file mode 100644
index 00000000000..46161c36cd2
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/depend-inoutset-1.f90
@@ -0,0 +1,170 @@
+! { dg-additional-sources my-usleep.c }
+! { dg-prune-output "command-line option '-fintrinsic-modules-path=.*' is valid for Fortran but not for C" }
+
+program main
+  use omp_lib
+  implicit none (type, external)
+
+  interface
+    subroutine usleep(t) bind(C, name="my_usleep")
+      use iso_c_binding
+      integer(c_int), value :: t
+    end subroutine
+  end interface
+
+  integer :: a(0:7) = 0
+  integer(omp_depend_kind) :: d1, d2
+
+  !$omp depobj (d1) depend(inoutset: a)
+  !$omp depobj (d2) depend(inout: a)
+  !$omp depobj (d2) update(inoutset)
+
+  !$omp parallel
+   !$omp barrier
+   !$omp master
+    !$omp task shared(a) depend(out: a)
+    block
+      call usleep (5000)
+      a(0) = 1; a(1) = 2; a(2) = 3; a(3) = 4
+    end block
+    ! The above task needs to finish first.
+    !$omp task shared(a) depend(in: a)
+    block
+      if (a(0) /= 1 .or. a(1) /= 2 .or. a(2) /= 3 .or. a(3) /= 4) &
+        error stop
+      call usleep (5000)
+      a(4) = 42
+    end block
+    !$omp task shared(a) depend(in: a)
+    block
+      if (a(0) /= 1 .or. a(1) /= 2 .or. a(2) /= 3 .or. a(3) /= 4) &
+        error stop
+      call usleep (5000);
+      a(5) = 43
+    end block
+    !$omp task shared(a) depend(in: a)
+    block
+      if (a(0) /= 1 .or. a(1) /= 2 .or. a(2) /= 3 .or. a(3) /= 4) &
+        error stop
+      call usleep (5000)
+      a(6) = 44
+    end block
+    !$omp task shared(a) depend(in: a)
+    block
+      if (a(0) /= 1 .or. a(1) /= 2 .or. a(2) /= 3 .or. a(3) /= 4) &
+        error stop
+      call usleep (5000)
+      a(7) = 45
+    end block
+    ! The above 4 tasks can be scheduled in any order but need to wait
+    ! for the depend(out: a) task.
+    !$omp task shared(a) depend(inoutset: a)
+    block
+      if (a(4) /= 42 .or. a(5) /= 43 .or. a(6) /= 44 .or. a(7) /= 45) &
+        error stop
+      call usleep (5000)
+      a(0) = 42
+    end block
+    !$omp task shared(a) depend(iterator(i=1:3:2), inoutset: a)
+    block
+      if (a(4) /= 42 .or. a(5) /= 43 .or. a(6) /= 44 .or. a(7) /= 45) &
+        error stop
+      call usleep (5000)
+      a(1) = 43
+    end block
+    !$omp task shared(a) depend(depobj: d1)
+    block
+      if (a(4) /= 42 .or. a(5) /= 43 .or. a(6) /= 44 .or. a(7) /= 45) &
+        error stop
+      call usleep (5000)
+      a(2) = 44
+    end block
+    !$omp task shared(a) depend(depobj: d2)
+    block
+      if (a(4) /= 42 .or. a(5) /= 43 .or. a(6) /= 44 .or. a(7) /= 45) &
+        error stop
+      call usleep (5000)
+      a(3) = 45
+    end block
+    ! The above 4 tasks can be scheduled in any order but need to wait
+    ! for all the above depend(in: a) tasks.
+    !$omp task shared(a) depend(in: a)
+    block
+      if (a(0) /= 42 .or. a(1) /= 43 .or. a(2) /= 44 .or. a(3) /= 45) &
+        error stop
+      call usleep (5000)
+      a(4) = 46
+    end block
+    !$omp task shared(a) depend(in: a)
+    block
+      if (a(0) /= 42 .or. a(1) /= 43 .or. a(2) /= 44 .or. a(3) /= 45) &
+        error stop
+      call usleep (5000)
+      a(5) = 47
+    end block
+    !$omp task shared(a) depend(in: a)
+    block
+      if (a(0) /= 42 .or. a(1) /= 43 .or. a(2) /= 44 .or. a(3) /= 45) &
+        error stop
+      call usleep (5000)
+      a(6) = 48
+    end block
+    !$omp task shared(a) depend(in: a)
+    block
+      if (a(0) /= 42 .or. a(1) /= 43 .or. a(2) /= 44 .or. a(3) /= 45) &
+        error stop
+      call usleep (5000)
+      a(7) = 49
+    end block
+    ! The above 4 tasks can be scheduled in any order but need to wait
+    ! for all the above depend(inoutset: a),
+    !  depend(iterator(i=1:3:2), inoutset: a), depend(depobj: d1) and
+    !  depend(depobj: d2) tasks.
+    !$omp task shared(a) depend(inoutset: a)
+    block
+      if (a(4) /= 46.or. a(5) /= 47 .or. a(6) /= 48 .or. a(7) /= 49) &
+        error stop
+      call usleep (5000)
+      a(0) = 50
+    end block
+    ! The above task needs to wait for all the above 4 depend(in: a)
+    ! tasks.
+    !$omp task shared(a) depend(out: a)
+    block
+      if (a(0) /= 50 .or. a(4) /= 46.or. a(5) /= 47 .or. a(6) /= 48 .or. a(7) /= 49) &
+        error stop
+      call usleep (5000)
+      a(0) = 51
+    end block
+    ! The above task needs to wait for the above depend(inoutset: a) task.
+    !$omp task shared(a) depend(inoutset: a)
+    block
+      if (a(0) /= 51 .or. a(4) /= 46.or. a(5) /= 47 .or. a(6) /= 48 .or. a(7) /= 49) &
+        error stop
+      call usleep (5000)
+      a(0) = 52
+    end block
+    ! The above task needs to wait for the above depend(out: a) task.
+    !$omp task shared(a) depend(mutexinoutset: a)
+    block
+      if (a(0) /= 52 .or. a(4) /= 46.or. a(5) /= 47 .or. a(6) /= 48 .or. a(7) /= 49) &
+        error stop
+      call usleep (5000)
+      a(0) = 53
+    end block
+    ! The above task needs to wait for the above depend(inoutset: a) task.
+    !$omp task shared(a) depend(inoutset: a)
+    block
+      if (a(0) /= 53 .or. a(4) /= 46.or. a(5) /= 47 .or. a(6) /= 48 .or. a(7) /= 49) &
+        error stop
+      call usleep (5000)
+      a(0) = 54
+    end block
+    ! The above task needs to wait for the above
+    ! depend(mutexinoutset: a) task.
+   !$omp end master
+  !$omp end parallel
+  if (a(0) /= 54 .or. a(1) /= 43 .or. a(2) /= 44 .or. a(3) /= 45 &
+      .or. a(4) /= 46.or. a(5) /= 47 .or. a(6) /= 48 .or. a(7) /= 49) &
+    error stop
+end

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] OpenMP: Add Fortran support for inoutset depend-kind (was: openmp: Add support for inoutset depend-kind)
  2022-05-18  9:02 ` [Patch] OpenMP: Add Fortran support for inoutset depend-kind (was: openmp: Add support for inoutset depend-kind) Tobias Burnus
@ 2022-05-18  9:22   ` Jakub Jelinek
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2022-05-18  9:22 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc-patches, fortran

On Wed, May 18, 2022 at 11:02:27AM +0200, Tobias Burnus wrote:
> OpenMP: Add Fortran support for inoutset depend-kind
> 
> Fortran additions to the C/C++ + ME/libgomp commit
> r13-556-g2c16eb3157f86ae561468c540caf8eb326106b5f
> 
> gcc/fortran/ChangeLog:
> 
> 	* gfortran.h (enum gfc_omp_depend_op): Add OMP_DEPEND_INOUTSET.
> 	(gfc_omp_clauses): Enlarge ENUM_BITFIELD.
> 	* dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle
> 	'inoutset' depend modifier.
> 	* openmp.cc (gfc_match_omp_clauses, gfc_match_omp_depobj): Likewise.
> 	* trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj):
> 	Likewise.
> 
> libgomp/ChangeLog:
> 
> 	* libgomp.texi (OpenMP 5.1): Set 'inoutset' to Y.
> 	(OpenMP Context Selectors): Add missing comma.
> 	* testsuite/libgomp.fortran/depend-5.f90: Add inoutset test.
> 	* testsuite/libgomp.fortran/depend-6.f90: Likewise.
> 	* testsuite/libgomp.fortran/depend-7.f90: Likewise.
> 	* testsuite/libgomp.fortran/depend-inoutset-1.f90: New test.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gfortran.dg/gomp/all-memory-1.f90: Add inoutset test.
> 	* gfortran.dg/gomp/all-memory-2.f90: Likewise.
> 	* gfortran.dg/gomp/depobj-1.f90: Likewise.
> 	* gfortran.dg/gomp/depobj-2.f90: Likewise.

Ok, thanks.

	Jakub


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-18  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17 13:55 [committed] openmp: Add support for inoutset depend-kind Jakub Jelinek
2022-05-18  9:02 ` [Patch] OpenMP: Add Fortran support for inoutset depend-kind (was: openmp: Add support for inoutset depend-kind) Tobias Burnus
2022-05-18  9:22   ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).