This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tuples] openmp and misc API changes


[Diego, see below]

Phew... With this patch, we have almost the entire openmp pass
converted, but untested, so I'm sure there's plenty of work left.  This
is the pass from hell, and we haven't even merged gomp3 stuff.

There are a handful of new API calls.

	- gimple_seq_alloc_with_stmt
		- Allocate a new sequence that contains one statement.

	- gimple_bind_add_stmt
		- Append a statement to a bind's body.

	- gimple_bind_add_seq
		- Same, but append a sequence.


	- gimple_omp_section_set_last
		- Set the flag.

	- gimple_omp_parallel_set_combined_p
		- Set the flag.

I'll be working on the 10 remaining fixme's in omp-low.c, and then I'll
enable the pass and start working on run-time regressions.

Diego, it would be really useful for me to enable the pass, thus causing
a gazillion openmp run-time regressions, and then attacking the
regressions bit by bit.  It would be too painful to work on all
regressions at once before I enable the pass.  Can I do that, once I fix
all the openmp fixme's?

Aldy

	* omp-low.c (lower_rec_input_clauses): Remove fixme and
	ATTRIBUTE_UNUSED.
	(lower_lastprivate_clauses): Same.
	(lower_reduction_clauses): Same.
	(lower_copyprivate_clauses): Same.
	(lower_send_clauses): Same.
	(lower_send_shared_vars): Same.
	(maybe_catch_exception): Convert to tuples.
	(lower_omp_sections): Same.
	(lower_omp_single_simple): Same.
	(lower_omp_single_copy): Same.
	(lower_omp_single): Same.
	(lower_omp_master): Same.
	(lower_omp_ordered): Same.
	(lower_omp_critical): Same.
	(lower_omp_for_lastprivate): Same.
	(lower_omp_for): Same.
	(check_combined_parallel): Same.
	(lower_omp_parallel): Same.
	(lower_omp_1): Same.
	(execute_lower_omp): Enable.
	* gimple-dummy.c: Remove dummy functions for lower_omp_*.
	* gimple-low.c (lower_omp_directive): Convert to tuples.
	(lower_stmt): Remove fixme.
	* gimple.h (gimple_seq_alloc_with_stmt): New.
	(gimple_omp_section_set_last): New.
	(gimple_omp_parallel_set_combined_p): New.
	(gimple_bind_add_stmt): New.
	(gimple_bind_add_seq): New.
	* tree-cfg.c (verify_node_sharing): Fix typo in comment.

Index: omp-low.c
===================================================================
--- omp-low.c	(revision 134414)
+++ omp-low.c	(working copy)
@@ -1691,7 +1691,7 @@ omp_reduction_init (tree clause, tree ty
    private variables.  Initialization statements go in ILIST, while calls
    to destructors go in DLIST.  */
 
-/*FIXME tuples*/ ATTRIBUTE_UNUSED static void
+static void
 lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
 			 omp_context *ctx)
 {
@@ -1928,7 +1928,7 @@ lower_rec_input_clauses (tree clauses, g
    both parallel and workshare constructs.  PREDICATE may be NULL if it's
    always true.   */
 
-/*FIXME tuples*/ ATTRIBUTE_UNUSED static void
+static void
 lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *stmt_list,
 			    omp_context *ctx)
 {
@@ -1984,7 +1984,7 @@ lower_lastprivate_clauses (tree clauses,
 
 /* Generate code to implement the REDUCTION clauses.  */
 
-/*FIXME tuples*/ ATTRIBUTE_UNUSED static void
+static void
 lower_reduction_clauses (tree clauses, gimple_seq *stmt_seqp, omp_context *ctx)
 {
   gimple_seq sub_seq = NULL;
@@ -2073,7 +2073,7 @@ lower_reduction_clauses (tree clauses, g
 
 /* Generate code to implement the COPYPRIVATE clauses.  */
 
-/*FIXME tuples*/ ATTRIBUTE_UNUSED static void
+static void
 lower_copyprivate_clauses (tree clauses, gimple_seq *slist, gimple_seq *rlist,
 			    omp_context *ctx)
 {
@@ -2111,7 +2111,7 @@ lower_copyprivate_clauses (tree clauses,
 /* Generate code to implement the clauses, FIRSTPRIVATE, COPYIN, LASTPRIVATE,
    and REDUCTION from the sender (aka parent) side.  */
 
-/*FIXME tuples*/ ATTRIBUTE_UNUSED static void
+static void
 lower_send_clauses (tree clauses, gimple_seq *ilist, gimple_seq *olist,
     		    omp_context *ctx)
 {
@@ -2191,7 +2191,7 @@ lower_send_clauses (tree clauses, gimple
    This is trickier, since OMP_PARALLEL_CLAUSES doesn't list things that
    got automatically shared.  */
 
-/*FIXME tuples*/ ATTRIBUTE_UNUSED static void
+static void
 lower_send_shared_vars (gimple_seq *ilist, gimple_seq *olist, omp_context *ctx)
 {
   tree var, ovar, nvar, f, x;
@@ -2414,35 +2414,31 @@ expand_parallel_call (struct omp_region 
 }
 
 
-  /* FIXME tuples */
-#if 0
-/* If exceptions are enabled, wrap *STMT_P in a MUST_NOT_THROW catch
-   handler.  This prevents programs from violating the structured
-   block semantics with throws.  */
+/* If exceptions are enabled, wrap the statements in BODY in a MUST_NOT_THROW
+   catch handler and return it.  This prevents programs from violating the
+   structured block semantics with throws.  */
 
-static void
-maybe_catch_exception (tree *stmt_p)
+static gimple_seq
+maybe_catch_exception (gimple_seq body)
 {
-  tree f, t;
+  gimple f, t;
 
   if (!flag_exceptions)
-    return;
+    return NULL;
 
   if (lang_protect_cleanup_actions)
     t = lang_protect_cleanup_actions ();
   else
-    t = build_call_expr (built_in_decls[BUILT_IN_TRAP], 0);
-  f = build2 (EH_FILTER_EXPR, void_type_node, NULL, NULL);
-  EH_FILTER_MUST_NOT_THROW (f) = 1;
-  gimplify_and_add (t, &EH_FILTER_FAILURE (f));
-  
-  t = build2 (TRY_CATCH_EXPR, void_type_node, *stmt_p, NULL);
-  append_to_statement_list (f, &TREE_OPERAND (t, 1));
+    t = gimple_build_call (built_in_decls[BUILT_IN_TRAP], 0);
+
+  f = gimple_build_eh_filter (NULL, gimple_seq_alloc_with_stmt (t));
+  gimple_eh_filter_set_must_not_throw (f, true);
 
-  *stmt_p = NULL;
-  append_to_statement_list (t, stmt_p);
+  t = gimple_build_try (body, gimple_seq_alloc_with_stmt (f),
+      			GIMPLE_TRY_CATCH);
+
+ return gimple_seq_alloc_with_stmt (t);
 }
-#endif
 
 /* Chain all the DECLs in LIST by their TREE_CHAIN fields.  */
 
@@ -4340,106 +4336,103 @@ struct gimple_opt_pass pass_expand_omp =
   TODO_dump_func			/* todo_flags_finish */
  }
 };
-
-/* FIXME tuples.  */
-#if 0
 
 /* Routines to lower OpenMP directives into OMP-GIMPLE.  */
 
-/* Lower the OpenMP sections directive in *STMT_P.  */
+/* Lower the OpenMP sections directive in the current statement.  */
 
 static void
-lower_omp_sections (tree *stmt_p, omp_context *ctx)
+lower_omp_sections (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  tree new_stmt, stmt, body, bind, block, ilist, olist, new_body, control;
-  tree t, dlist;
-  tree_stmt_iterator tsi;
+  tree block, control;
+  gimple_stmt_iterator tgsi;
   unsigned i, len;
+  gimple stmt, new_stmt, bind, t;
+  gimple_seq ilist, dlist, olist, new_body, body;
 
-  stmt = *stmt_p;
+  stmt = gsi_stmt (*gsi_p);
 
   push_gimplify_context ();
 
   dlist = NULL;
   ilist = NULL;
-  lower_rec_input_clauses (OMP_SECTIONS_CLAUSES (stmt), &ilist, &dlist, ctx);
+  lower_rec_input_clauses (gimple_omp_sections_clauses (stmt),
+      			   &ilist, &dlist, ctx);
 
-  tsi = tsi_start (OMP_SECTIONS_BODY (stmt));
-  for (len = 0; !tsi_end_p (tsi); len++, tsi_next (&tsi))
+  tgsi = gsi_start (gimple_omp_body (stmt));
+  for (len = 0; !gsi_end_p (tgsi); len++, gsi_next (&tgsi))
     continue;
 
-  tsi = tsi_start (OMP_SECTIONS_BODY (stmt));
-  body = alloc_stmt_list ();
-  for (i = 0; i < len; i++, tsi_next (&tsi))
+  tgsi = gsi_start (gimple_omp_body (stmt));
+  body = NULL;
+  for (i = 0; i < len; i++, gsi_next (&tgsi))
     {
       omp_context *sctx;
-      tree sec_start, sec_end;
+      gimple sec_start;
 
-      sec_start = tsi_stmt (tsi);
+      sec_start = gsi_stmt (tgsi);
       sctx = maybe_lookup_ctx (sec_start);
       gcc_assert (sctx);
 
-      append_to_statement_list (sec_start, &body);
+      gimple_seq_add_stmt (&body, sec_start);
 
-      lower_omp (&OMP_SECTION_BODY (sec_start), sctx);
-      append_to_statement_list (OMP_SECTION_BODY (sec_start), &body);
-      OMP_SECTION_BODY (sec_start) = NULL;
+      lower_omp (gimple_omp_body (sec_start), sctx);
+      gimple_seq_add_seq (&body, gimple_omp_body (sec_start));
+      gimple_omp_set_body (sec_start, NULL);
 
       if (i == len - 1)
 	{
-	  tree l = alloc_stmt_list ();
-	  lower_lastprivate_clauses (OMP_SECTIONS_CLAUSES (stmt), NULL,
+	  gimple_seq l = NULL;
+	  lower_lastprivate_clauses (gimple_omp_sections_clauses (stmt), NULL,
 				     &l, ctx);
-	  append_to_statement_list (l, &body);
-	  OMP_SECTION_LAST (sec_start) = 1;
+	  gimple_seq_add_seq (&body, l);
+	  gimple_omp_section_set_last (sec_start);
 	}
       
-      sec_end = make_node (OMP_RETURN);
-      append_to_statement_list (sec_end, &body);
+      gimple_seq_add_stmt (&body, gimple_build_omp_return (false));
     }
 
   block = make_node (BLOCK);
-  bind = build3 (BIND_EXPR, void_type_node, NULL, body, block);
+  bind = gimple_build_bind (NULL, body, block);
 
-  olist = NULL_TREE;
-  lower_reduction_clauses (OMP_SECTIONS_CLAUSES (stmt), &olist, ctx);
+  olist = NULL;
+  lower_reduction_clauses (gimple_omp_sections_clauses (stmt), &olist, ctx);
 
-  pop_gimplify_context (NULL_TREE);
+  pop_gimplify_context (NULL);
   record_vars_into (ctx->block_vars, ctx->cb.dst_fn);
 
-  new_stmt = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
-  TREE_SIDE_EFFECTS (new_stmt) = 1;
-
-  new_body = alloc_stmt_list ();
-  append_to_statement_list (ilist, &new_body);
-  append_to_statement_list (stmt, &new_body);
-  append_to_statement_list (make_node (OMP_SECTIONS_SWITCH), &new_body);
-  append_to_statement_list (bind, &new_body);
+  new_body = NULL;
+  gimple_seq_add_seq (&new_body, ilist);
+  gimple_seq_add_stmt (&new_body, stmt);
+  /* FIXME tuples: We need a gimple_build_omp_sections_switch.
+  gimple_seq_add_stmt (&new_body, gimple_build_omp_sections_switch ());
+  */
+  gimple_seq_add_stmt (&new_body, bind);
 
   control = create_tmp_var (unsigned_type_node, ".section");
-  t = build2 (GIMPLE_OMP_CONTINUE, void_type_node, control, control);
+  t = gimple_build_omp_continue (control, control);
   gimple_omp_sections_set_control (stmt, control);
-  append_to_statement_list (t, &new_body);
+  gimple_seq_add_stmt (&new_body, t);
 
-  append_to_statement_list (olist, &new_body);
-  append_to_statement_list (dlist, &new_body);
+  gimple_seq_add_seq (&new_body, olist);
+  gimple_seq_add_seq (&new_body, dlist);
 
-  maybe_catch_exception (&new_body);
+  new_body = maybe_catch_exception (new_body);
 
-  t = make_node (OMP_RETURN);
-  OMP_RETURN_NOWAIT (t) = !!find_omp_clause (OMP_SECTIONS_CLAUSES (stmt),
-					     OMP_CLAUSE_NOWAIT);
-  append_to_statement_list (t, &new_body);
+  t = gimple_build_omp_return
+        (!!find_omp_clause (gimple_omp_sections_clauses (stmt),
+			    OMP_CLAUSE_NOWAIT));
+  gimple_seq_add_stmt (&new_body, t);
 
-  BIND_EXPR_BODY (new_stmt) = new_body;
-  OMP_SECTIONS_BODY (stmt) = NULL;
+  new_stmt = gimple_build_bind (NULL, new_body, NULL);
+  gimple_omp_set_body (stmt, NULL);
 
-  *stmt_p = new_stmt;
+  gsi_replace (gsi_p, new_stmt, true);
 }
 
 
 /* A subroutine of lower_omp_single.  Expand the simple form of
-   an OMP_SINGLE, without a copyprivate clause:
+   a GIMPLE_OMP_SINGLE, without a copyprivate clause:
 
      	if (GOMP_single_start ())
 	  BODY;
@@ -4450,19 +4443,25 @@ lower_omp_sections (tree *stmt_p, omp_co
   to a synchronization analysis pass.  */
 
 static void
-lower_omp_single_simple (tree single_stmt, tree *pre_p)
+lower_omp_single_simple (gimple single_stmt, gimple_seq *pre_p)
 {
-  tree t;
-
-  t = build_call_expr (built_in_decls[BUILT_IN_GOMP_SINGLE_START], 0);
-  t = build3 (COND_EXPR, void_type_node, t,
-	      OMP_SINGLE_BODY (single_stmt), NULL);
-  gimplify_and_add (t, pre_p);
+  tree flabel = create_artificial_label ();
+  gimple call, cond;
+  tree lhs;
+
+  lhs = create_tmp_var (boolean_type_node, NULL);
+  call = gimple_build_call (built_in_decls[BUILT_IN_GOMP_SINGLE_START], 0);
+  gimple_call_set_lhs (call, lhs);
+  gimple_seq_add_stmt (pre_p, call);
+  cond = gimple_build_cond (NE_EXPR, lhs, boolean_true_node, flabel, NULL);
+  gimple_seq_add_stmt (pre_p, cond);
+  gimple_seq_add_seq (pre_p, gimple_omp_body (single_stmt));
+  gimple_seq_add_stmt (pre_p, gimple_build_label (flabel));
 }
 
 
 /* A subroutine of lower_omp_single.  Expand the simple form of
-   an OMP_SINGLE, with a copyprivate clause:
+   a GIMPLE_OMP_SINGLE, with a copyprivate clause:
 
 	#pragma omp single copyprivate (a, b, c)
 
@@ -4491,9 +4490,10 @@ lower_omp_single_simple (tree single_stm
   to a synchronization analysis pass.  */
 
 static void
-lower_omp_single_copy (tree single_stmt, tree *pre_p, omp_context *ctx)
+lower_omp_single_copy (gimple single_stmt, gimple_seq *pre_p, omp_context *ctx)
 {
-  tree ptr_type, t, l0, l1, l2, copyin_seq;
+  tree ptr_type, t, l0, l1, l2;
+  gimple_seq copyin_seq;
 
   ctx->sender_decl = create_tmp_var (ctx->record_type, ".omp_copy_o");
 
@@ -4515,13 +4515,12 @@ lower_omp_single_copy (tree single_stmt,
 	      build_and_jump (&l0), build_and_jump (&l1));
   gimplify_and_add (t, pre_p);
 
-  t = build1 (LABEL_EXPR, void_type_node, l0);
-  gimplify_and_add (t, pre_p);
+  gimple_seq_add_stmt (pre_p, gimple_build_label (l0));
 
-  append_to_statement_list (OMP_SINGLE_BODY (single_stmt), pre_p);
+  gimple_seq_add_seq (pre_p, gimple_omp_body (single_stmt));
 
   copyin_seq = NULL;
-  lower_copyprivate_clauses (OMP_SINGLE_CLAUSES (single_stmt), pre_p,
+  lower_copyprivate_clauses (gimple_omp_single_clauses (single_stmt), pre_p,
 			      &copyin_seq, ctx);
 
   t = build_fold_addr_expr (ctx->sender_decl);
@@ -4531,135 +4530,134 @@ lower_omp_single_copy (tree single_stmt,
   t = build_and_jump (&l2);
   gimplify_and_add (t, pre_p);
 
-  t = build1 (LABEL_EXPR, void_type_node, l1);
-  gimplify_and_add (t, pre_p);
+  gimple_seq_add_stmt (pre_p, gimple_build_label (l1));
 
-  append_to_statement_list (copyin_seq, pre_p);
+  gimple_seq_add_seq (pre_p, copyin_seq);
 
-  t = build1 (LABEL_EXPR, void_type_node, l2);
-  gimplify_and_add (t, pre_p);
+  gimple_seq_add_stmt (pre_p, gimple_build_label (l2));
 }
 
 
 /* Expand code for an OpenMP single directive.  */
 
 static void
-lower_omp_single (tree *stmt_p, omp_context *ctx)
+lower_omp_single (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  tree t, bind, block, single_stmt = *stmt_p, dlist;
+  tree block;
+  gimple t, bind, single_stmt = gsi_stmt (*gsi_p);
+  gimple_seq bind_body, dlist;
 
   push_gimplify_context ();
 
-  block = make_node (BLOCK);
-  *stmt_p = bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
-  TREE_SIDE_EFFECTS (bind) = 1;
-
-  lower_rec_input_clauses (OMP_SINGLE_CLAUSES (single_stmt),
-			   &BIND_EXPR_BODY (bind), &dlist, ctx);
-  lower_omp (&OMP_SINGLE_BODY (single_stmt), ctx);
+  bind_body = NULL;
+  lower_rec_input_clauses (gimple_omp_single_clauses (single_stmt),
+			   &bind_body, &dlist, ctx);
+  lower_omp (gimple_omp_body (single_stmt), ctx);
 
-  append_to_statement_list (single_stmt, &BIND_EXPR_BODY (bind));
+  gimple_seq_add_stmt (&bind_body, single_stmt);
 
   if (ctx->record_type)
-    lower_omp_single_copy (single_stmt, &BIND_EXPR_BODY (bind), ctx);
+    lower_omp_single_copy (single_stmt, &bind_body, ctx);
   else
-    lower_omp_single_simple (single_stmt, &BIND_EXPR_BODY (bind));
+    lower_omp_single_simple (single_stmt, &bind_body);
 
-  OMP_SINGLE_BODY (single_stmt) = NULL;
+  gimple_omp_set_body (single_stmt, NULL);
 
-  append_to_statement_list (dlist, &BIND_EXPR_BODY (bind));
+  gimple_seq_add_seq (&bind_body, dlist);
 
-  maybe_catch_exception (&BIND_EXPR_BODY (bind));
+  bind_body = maybe_catch_exception (bind_body);
 
-  t = make_node (OMP_RETURN);
-  OMP_RETURN_NOWAIT (t) = !!find_omp_clause (OMP_SINGLE_CLAUSES (single_stmt),
-					     OMP_CLAUSE_NOWAIT);
-  append_to_statement_list (t, &BIND_EXPR_BODY (bind));
+  t = gimple_build_omp_return 
+        (!!find_omp_clause (gimple_omp_single_clauses (single_stmt),
+			    OMP_CLAUSE_NOWAIT));
+  gimple_seq_add_stmt (&bind_body, t);
+
+  block = make_node (BLOCK);
+  bind = gimple_build_bind (NULL, bind_body, block);
 
   pop_gimplify_context (bind);
 
-  BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
-  BLOCK_VARS (block) = BIND_EXPR_VARS (bind);
+  gimple_bind_set_vars (bind, ctx->block_vars);
+  BLOCK_VARS (block) = ctx->block_vars;
+  gsi_replace (gsi_p, bind, true);
 }
 
 
 /* Expand code for an OpenMP master directive.  */
 
 static void
-lower_omp_master (tree *stmt_p, omp_context *ctx)
+lower_omp_master (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  tree bind, block, stmt = *stmt_p, lab = NULL, x;
+  tree block, lab = NULL, x;
+  gimple stmt = gsi_stmt (*gsi_p), bind;
+  gimple_seq tseq;
 
   push_gimplify_context ();
 
   block = make_node (BLOCK);
-  *stmt_p = bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
-  TREE_SIDE_EFFECTS (bind) = 1;
-
-  append_to_statement_list (stmt, &BIND_EXPR_BODY (bind));
+  bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt),
+      				 block);
 
   x = build_call_expr (built_in_decls[BUILT_IN_OMP_GET_THREAD_NUM], 0);
   x = build2 (EQ_EXPR, boolean_type_node, x, integer_zero_node);
   x = build3 (COND_EXPR, void_type_node, x, NULL, build_and_jump (&lab));
-  gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+  tseq = NULL;
+  gimplify_and_add (x, &tseq);
+  gimple_bind_add_seq (bind, tseq);
+
+  lower_omp (gimple_omp_body (stmt), ctx);
+  gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
+  gimple_bind_add_seq (bind, gimple_omp_body (stmt));
+  gimple_omp_set_body (stmt, NULL);
 
-  lower_omp (&OMP_MASTER_BODY (stmt), ctx);
-  maybe_catch_exception (&OMP_MASTER_BODY (stmt));
-  append_to_statement_list (OMP_MASTER_BODY (stmt), &BIND_EXPR_BODY (bind));
-  OMP_MASTER_BODY (stmt) = NULL;
-
-  x = build1 (LABEL_EXPR, void_type_node, lab);
-  gimplify_and_add (x, &BIND_EXPR_BODY (bind));
-
-  x = make_node (OMP_RETURN);
-  OMP_RETURN_NOWAIT (x) = 1;
-  append_to_statement_list (x, &BIND_EXPR_BODY (bind));
+  gimple_bind_add_stmt (bind, gimple_build_label (lab));
+
+  gimple_bind_add_stmt (bind, gimple_build_omp_return (true));
 
   pop_gimplify_context (bind);
 
-  BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
-  BLOCK_VARS (block) = BIND_EXPR_VARS (bind);
+  gimple_bind_set_vars (bind, ctx->block_vars);
+  BLOCK_VARS (block) = ctx->block_vars;
+  gsi_replace (gsi_p, bind, true);
 }
 
 
 /* Expand code for an OpenMP ordered directive.  */
 
 static void
-lower_omp_ordered (tree *stmt_p, omp_context *ctx)
+lower_omp_ordered (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  tree bind, block, stmt = *stmt_p, x;
+  tree block;
+  gimple stmt = gsi_stmt (*gsi_p), bind, x;
 
   push_gimplify_context ();
 
   block = make_node (BLOCK);
-  *stmt_p = bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
-  TREE_SIDE_EFFECTS (bind) = 1;
-
-  append_to_statement_list (stmt, &BIND_EXPR_BODY (bind));
+  bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt),
+      				   block);
 
-  x = build_call_expr (built_in_decls[BUILT_IN_GOMP_ORDERED_START], 0);
-  gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+  x = gimple_build_call (built_in_decls[BUILT_IN_GOMP_ORDERED_START], 0);
+  gimple_bind_add_stmt (bind, x);
 
-  lower_omp (&OMP_ORDERED_BODY (stmt), ctx);
-  maybe_catch_exception (&OMP_ORDERED_BODY (stmt));
-  append_to_statement_list (OMP_ORDERED_BODY (stmt), &BIND_EXPR_BODY (bind));
-  OMP_ORDERED_BODY (stmt) = NULL;
+  lower_omp (gimple_omp_body (stmt), ctx);
+  gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
+  gimple_bind_add_seq (bind, gimple_omp_body (stmt));
+  gimple_omp_set_body (stmt, NULL);
 
-  x = build_call_expr (built_in_decls[BUILT_IN_GOMP_ORDERED_END], 0);
-  gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+  x = gimple_build_call (built_in_decls[BUILT_IN_GOMP_ORDERED_END], 0);
+  gimple_bind_add_stmt (bind, x);
 
-  x = make_node (OMP_RETURN);
-  OMP_RETURN_NOWAIT (x) = 1;
-  append_to_statement_list (x, &BIND_EXPR_BODY (bind));
+  gimple_bind_add_stmt (bind, gimple_build_omp_return (true));
 
   pop_gimplify_context (bind);
 
-  BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
-  BLOCK_VARS (block) = BIND_EXPR_VARS (bind);
+  gimple_bind_set_vars (bind, ctx->block_vars);
+  BLOCK_VARS (block) = gimple_bind_vars (bind);
+  gsi_replace (gsi_p, bind, true);
 }
 
 
-/* Gimplify an OMP_CRITICAL statement.  This is a relatively simple
+/* Gimplify a GIMPLE_OMP_CRITICAL statement.  This is a relatively simple
    substitution of a couple of function calls.  But in the NAMED case,
    requires that languages coordinate a symbol name.  It is therefore
    best put here in common code.  */
@@ -4668,12 +4666,14 @@ static GTY((param1_is (tree), param2_is 
   splay_tree critical_name_mutexes;
 
 static void
-lower_omp_critical (tree *stmt_p, omp_context *ctx)
+lower_omp_critical (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  tree bind, block, stmt = *stmt_p;
-  tree t, lock, unlock, name;
+  tree block;
+  tree name, lock, unlock;
+  gimple stmt = gsi_stmt (*gsi_p), bind;
+  gimple_seq tbody;
 
-  name = OMP_CRITICAL_NAME (stmt);
+  name = gimple_omp_critical_name (stmt);
   if (name)
     {
       tree decl;
@@ -4724,27 +4724,27 @@ lower_omp_critical (tree *stmt_p, omp_co
   push_gimplify_context ();
 
   block = make_node (BLOCK);
-  *stmt_p = bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
-  TREE_SIDE_EFFECTS (bind) = 1;
-
-  append_to_statement_list (stmt, &BIND_EXPR_BODY (bind));
-
-  gimplify_and_add (lock, &BIND_EXPR_BODY (bind));
+  bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt), block);
 
-  lower_omp (&OMP_CRITICAL_BODY (stmt), ctx);
-  maybe_catch_exception (&OMP_CRITICAL_BODY (stmt));
-  append_to_statement_list (OMP_CRITICAL_BODY (stmt), &BIND_EXPR_BODY (bind));
-  OMP_CRITICAL_BODY (stmt) = NULL;
+  tbody = gimple_bind_body (bind);
+  gimplify_and_add (lock, &tbody);
+  gimple_bind_set_body (bind, tbody);
+
+  lower_omp (gimple_omp_body (stmt), ctx);
+  gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
+  gimple_bind_add_seq (bind, gimple_omp_body (stmt));
+  gimple_omp_set_body (stmt, NULL);
+
+  tbody = gimple_bind_body (bind);
+  gimplify_and_add (unlock, &tbody);
+  gimple_bind_set_body (bind, tbody);
 
-  gimplify_and_add (unlock, &BIND_EXPR_BODY (bind));
-
-  t = make_node (OMP_RETURN);
-  OMP_RETURN_NOWAIT (t) = 1;
-  append_to_statement_list (t, &BIND_EXPR_BODY (bind));
+  gimple_bind_add_stmt (bind, gimple_build_omp_return (true));
 
   pop_gimplify_context (bind);
-  BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
-  BLOCK_VARS (block) = BIND_EXPR_VARS (bind);
+  gimple_bind_set_vars (bind, ctx->block_vars);
+  BLOCK_VARS (block) = gimple_bind_vars (bind);
+  gsi_replace (gsi_p, bind, true);
 }
 
 
@@ -4755,11 +4755,12 @@ lower_omp_critical (tree *stmt_p, omp_co
    *BODY_P.  */
 
 static void
-lower_omp_for_lastprivate (struct omp_for_data *fd, tree *body_p,
-			   tree *dlist, struct omp_context *ctx)
+lower_omp_for_lastprivate (struct omp_for_data *fd, gimple_seq *body_p,
+			   gimple_seq *dlist, struct omp_context *ctx)
 {
-  tree clauses, cond, stmts, vinit, t;
+  tree clauses, cond, vinit, t;
   enum tree_code cond_code;
+  gimple_seq stmts;
   
   cond_code = fd->cond_code;
   cond_code = cond_code == LT_EXPR ? GE_EXPR : LE_EXPR;
@@ -4775,12 +4776,12 @@ lower_omp_for_lastprivate (struct omp_fo
 
   cond = build2 (cond_code, boolean_type_node, fd->v, fd->n2);
 
-  clauses = OMP_FOR_CLAUSES (fd->for_stmt);
+  clauses = gimple_omp_for_clauses (fd->for_stmt);
   stmts = NULL;
   lower_lastprivate_clauses (clauses, cond, &stmts, ctx);
-  if (stmts != NULL)
+  if (!gimple_seq_empty_p (stmts))
     {
-      append_to_statement_list (stmts, dlist);
+      gimple_seq_add_seq (dlist, stmts);
 
       /* Optimize: v = 0; is usually cheaper than v = some_other_constant.  */
       vinit = fd->n1;
@@ -4800,32 +4801,31 @@ lower_omp_for_lastprivate (struct omp_fo
 /* Lower code for an OpenMP loop directive.  */
 
 static void
-lower_omp_for (tree *stmt_p, omp_context *ctx)
+lower_omp_for (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  tree t, stmt, ilist, dlist, new_stmt, *body_p, *rhs_p;
+  tree *rhs_p;
   struct omp_for_data fd;
-
-  stmt = *stmt_p;
+  gimple stmt = gsi_stmt (*gsi_p);
+  gimple_seq omp_for_body, body, dlist, ilist;
 
   push_gimplify_context ();
 
-  lower_omp (&OMP_FOR_PRE_BODY (stmt), ctx);
-  lower_omp (&OMP_FOR_BODY (stmt), ctx);
+  lower_omp (gimple_omp_for_pre_body (stmt), ctx);
+  lower_omp (gimple_omp_body (stmt), ctx);
 
   /* Move declaration of temporaries in the loop body before we make
      it go away.  */
-  if (TREE_CODE (OMP_FOR_BODY (stmt)) == BIND_EXPR)
-    record_vars_into (BIND_EXPR_VARS (OMP_FOR_BODY (stmt)), ctx->cb.dst_fn);
-
-  new_stmt = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
-  TREE_SIDE_EFFECTS (new_stmt) = 1;
-  body_p = &BIND_EXPR_BODY (new_stmt);
+  omp_for_body = gimple_omp_body (stmt);
+  if (gimple_code (gimple_seq_first_stmt (omp_for_body)) == GIMPLE_BIND)
+    record_vars_into (gimple_bind_vars (gimple_seq_first_stmt (omp_for_body)),
+		      ctx->cb.dst_fn);
 
   /* The pre-body and input clauses go before the lowered OMP_FOR.  */
   ilist = NULL;
   dlist = NULL;
-  append_to_statement_list (OMP_FOR_PRE_BODY (stmt), body_p);
-  lower_rec_input_clauses (OMP_FOR_CLAUSES (stmt), body_p, &dlist, ctx);
+  body = NULL;
+  gimple_seq_add_seq (&body, gimple_omp_for_pre_body (stmt));
+  lower_rec_input_clauses (gimple_omp_for_clauses (stmt), &body, &dlist, ctx);
 
   /* Lower the header expressions.  At this point, we can assume that
      the header is of the form:
@@ -4834,68 +4834,61 @@ lower_omp_for (tree *stmt_p, omp_context
 
      We just need to make sure that VAL1, VAL2 and VAL3 are lowered
      using the .omp_data_s mapping, if needed.  */
-  rhs_p = &GIMPLE_STMT_OPERAND (OMP_FOR_INIT (stmt), 1);
+  rhs_p = gimple_omp_for_initial_ptr (stmt);
   if (!is_gimple_min_invariant (*rhs_p))
-    *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
+    *rhs_p = get_formal_tmp_var (*rhs_p, &body);
 
-  rhs_p = &TREE_OPERAND (OMP_FOR_COND (stmt), 1);
+  rhs_p = gimple_omp_for_final_ptr (stmt);
   if (!is_gimple_min_invariant (*rhs_p))
-    *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
+    *rhs_p = get_formal_tmp_var (*rhs_p, &body);
 
-  rhs_p = &TREE_OPERAND (GIMPLE_STMT_OPERAND (OMP_FOR_INCR (stmt), 1), 1);
+  rhs_p = &TREE_OPERAND (GIMPLE_STMT_OPERAND (gimple_omp_for_incr (stmt),
+					      1), 1);
   if (!is_gimple_min_invariant (*rhs_p))
-    *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
+    *rhs_p = get_formal_tmp_var (*rhs_p, &body);
 
   /* Once lowered, extract the bounds and clauses.  */
   extract_omp_for_data (stmt, &fd);
 
-  lower_omp_for_lastprivate (&fd, body_p, &dlist, ctx);
+  lower_omp_for_lastprivate (&fd, &body, &dlist, ctx);
 
-  append_to_statement_list (stmt, body_p);
+  gimple_seq_add_stmt (&body, stmt);
+  gimple_seq_add_seq (&body, gimple_omp_body (stmt));
 
-  append_to_statement_list (OMP_FOR_BODY (stmt), body_p);
-
-  t = build2 (GIMPLE_OMP_CONTINUE, void_type_node, fd.v, fd.v);
-  append_to_statement_list (t, body_p);
+  gimple_seq_add_stmt (&body, gimple_build_omp_continue (fd.v, fd.v));
 
   /* After the loop, add exit clauses.  */
-  lower_reduction_clauses (OMP_FOR_CLAUSES (stmt), body_p, ctx);
-  append_to_statement_list (dlist, body_p);
+  lower_reduction_clauses (gimple_omp_for_clauses (stmt), &body, ctx);
+  gimple_seq_add_seq (&body, dlist);
 
-  maybe_catch_exception (body_p);
+  body = maybe_catch_exception (body);
 
   /* Region exit marker goes at the end of the loop body.  */
-  t = make_node (OMP_RETURN);
-  OMP_RETURN_NOWAIT (t) = fd.have_nowait;
-  append_to_statement_list (t, body_p);
+  gimple_seq_add_stmt (&body, gimple_build_omp_return (fd.have_nowait));
 
-  pop_gimplify_context (NULL_TREE);
+  pop_gimplify_context (NULL);
   record_vars_into (ctx->block_vars, ctx->cb.dst_fn);
 
-  OMP_FOR_BODY (stmt) = NULL_TREE;
-  OMP_FOR_PRE_BODY (stmt) = NULL_TREE;
-  *stmt_p = new_stmt;
+  gimple_omp_set_body (stmt, NULL);
+  gimple_omp_for_set_pre_body (stmt, NULL);
+  gsi_replace (gsi_p, gimple_build_bind (NULL, body, NULL), true);
 }
 
-/* Callback for walk_stmts.  Check if *TP only contains OMP_FOR
-   or OMP_PARALLEL.  */
+/* Callback for walk_stmts.  Check if the current statement only contains 
+   GIMPLE_OMP_FOR or GIMPLE_OMP_PARALLEL.  */
 
 static tree
-check_combined_parallel (tree *tp, int *walk_subtrees, void *data)
+check_combined_parallel (gimple_stmt_iterator *gsi_p,
+    			 bool *handled_ops_p ATTRIBUTE_UNUSED,
+    			 struct walk_stmt_info *wi)
 {
-  /* FIXME tuples.  This routine needs to be split up into two.  One
-     dealing with statements, to be used as a CALLBACK_STMT and the
-     other dealing with operands, to be used as a CALLBACK_OP.  Since
-     statements and operands are now of different types, we need the
-     two different callbacks.  */
-  struct walk_stmt_info *wi = data;
   int *info = wi->info;
+  gimple stmt = gsi_stmt (*gsi_p);
 
-  *walk_subtrees = 0;
-  switch (TREE_CODE (*tp))
+  switch (gimple_code (stmt))
     {
-    case OMP_FOR:
-    case OMP_SECTIONS:
+    case GIMPLE_OMP_FOR:
+    case GIMPLE_OMP_SECTIONS:
       *info = *info == 0 ? 1 : -1;
       break;
     default:
@@ -4911,86 +4904,81 @@ check_combined_parallel (tree *tp, int *
 static void
 lower_omp_parallel (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  tree clauses, par_bind, par_body, new_body, bind;
-  tree olist, ilist, par_olist, par_ilist;
+  tree clauses;
   tree child_fn, t;
   gimple stmt = gsi_stmt (*gsi_p);
+  gimple par_bind;
+  gimple_seq par_body, olist, ilist, par_olist, par_ilist, new_body;
 
   clauses = gimple_omp_parallel_clauses (stmt);
-  par_bind = gimple_omp_body (stmt);
-  par_body = BIND_EXPR_BODY (par_bind);
+  par_bind = gimple_seq_first_stmt (gimple_omp_body (stmt));
+  par_body = gimple_bind_body (par_bind);
   child_fn = ctx->cb.dst_fn;
-  if (!OMP_PARALLEL_COMBINED (stmt))
+  if (!gimple_omp_parallel_combined_p (stmt))
     {
       struct walk_stmt_info wi;
       int ws_num = 0;
 
-      /* FIXME tuples.  This needs to be changed to use the new
-	 walk_gimple_stmt routine.  */
       memset (&wi, 0, sizeof (wi));
       wi.info = &ws_num;
       wi.val_only = true;
-      walk_stmts (&wi, check_combined_parallel, NULL, &par_bind);
+      walk_gimple_seq (par_body, check_combined_parallel, NULL, &wi);
       if (ws_num == 1)
-	OMP_PARALLEL_COMBINED (stmt) = 1;
+	gimple_omp_parallel_set_combined_p (stmt);
     }
 
   push_gimplify_context ();
 
-  par_olist = NULL_TREE;
-  par_ilist = NULL_TREE;
+  par_olist = NULL;
+  par_ilist = NULL;
   lower_rec_input_clauses (clauses, &par_ilist, &par_olist, ctx);
-  lower_omp (&par_body, ctx);
+  lower_omp (par_body, ctx);
   lower_reduction_clauses (clauses, &par_olist, ctx);
 
   /* Declare all the variables created by mapping and the variables
      declared in the scope of the parallel body.  */
   record_vars_into (ctx->block_vars, child_fn);
-  record_vars_into (BIND_EXPR_VARS (par_bind), child_fn);
+  record_vars_into (gimple_bind_vars (par_bind), child_fn);
 
   if (ctx->record_type)
     {
       ctx->sender_decl = create_tmp_var (ctx->record_type, ".omp_data_o");
-      OMP_PARALLEL_DATA_ARG (stmt) = ctx->sender_decl;
+      gimple_omp_parallel_set_data_arg (stmt, ctx->sender_decl);
     }
 
-  olist = NULL_TREE;
-  ilist = NULL_TREE;
+  olist = NULL;
+  ilist = NULL;
   lower_send_clauses (clauses, &ilist, &olist, ctx);
   lower_send_shared_vars (&ilist, &olist, ctx);
 
   /* Once all the expansions are done, sequence all the different
-     fragments inside OMP_PARALLEL_BODY.  */
-  bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
-  append_to_statement_list (ilist, &BIND_EXPR_BODY (bind));
+     fragments inside GIMPLE_OMP_PARALLEL_BODY.  */
 
-  new_body = alloc_stmt_list ();
+  new_body = NULL;
 
   if (ctx->record_type)
     {
       t = build_fold_addr_expr (ctx->sender_decl);
       /* fixup_child_record_type might have changed receiver_decl's type.  */
       t = fold_convert (TREE_TYPE (ctx->receiver_decl), t);
-      t = build_gimple_modify_stmt (ctx->receiver_decl, t);
-      append_to_statement_list (t, &new_body);
+      gimple_seq_add_stmt (&new_body,
+	  		   gimple_build_assign (ctx->receiver_decl, t));
     }
 
-  append_to_statement_list (par_ilist, &new_body);
-  append_to_statement_list (par_body, &new_body);
-  append_to_statement_list (par_olist, &new_body);
-  maybe_catch_exception (&new_body);
-  t = make_node (OMP_RETURN);
-  append_to_statement_list (t, &new_body);
-  OMP_PARALLEL_BODY (stmt) = new_body;
+  gimple_seq_add_seq (&new_body, par_ilist);
+  gimple_seq_add_seq (&new_body, par_body);
+  gimple_seq_add_seq (&new_body, par_olist);
+  new_body = maybe_catch_exception (new_body);
+  gimple_seq_add_stmt (&new_body, gimple_build_omp_return (false));
+  gimple_omp_set_body (stmt, new_body);
 
-  append_to_statement_list (stmt, &BIND_EXPR_BODY (bind));
-  append_to_statement_list (olist, &BIND_EXPR_BODY (bind));
+  gimple_seq_add_stmt (&ilist, stmt);
+  gimple_seq_add_seq (&ilist, olist);
 
-  *stmt_p = bind;
+  gsi_replace (gsi_p, gimple_build_bind (NULL, ilist, NULL), true);
 
-  pop_gimplify_context (NULL_TREE);
+  pop_gimplify_context (NULL);
 }
-#endif /* tuples */
 
 /* Callback for lower_omp_1.  Return non-NULL if *tp needs to be
    regimplified.  */
@@ -5017,15 +5005,6 @@ lower_omp_regimplify_p (tree *tp, int *w
 static void
 lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 {
-  /* FIXME tuples */
-  extern void lower_omp_parallel(gimple_stmt_iterator *, omp_context *);
-  extern void lower_omp_for(gimple_stmt_iterator *, omp_context *);
-  extern void lower_omp_sections(gimple_stmt_iterator *, omp_context *);
-  extern void lower_omp_single(gimple_stmt_iterator *, omp_context *);
-  extern void lower_omp_master(gimple_stmt_iterator *, omp_context *);
-  extern void lower_omp_ordered(gimple_stmt_iterator *, omp_context *);
-  extern void lower_omp_critical(gimple_stmt_iterator *, omp_context *);
-
   gimple stmt = gsi_stmt (*gsi_p);
 
   if (gimple_has_location (stmt))
@@ -5036,7 +5015,7 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p
      confusing RTL expansion.  */
   if (errorcount && is_gimple_omp (stmt))
     {
-      gsi_replace (gsi_p, gimple_build_nop (), false);
+      gsi_replace (gsi_p, gimple_build_nop (), true);
       return;
     }
 
@@ -5066,6 +5045,10 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p
       break;
     case GIMPLE_OMP_PARALLEL:
       ctx = maybe_lookup_ctx (stmt);
+      {
+	debug_gimple_stmt (stmt);
+	exit(1);
+      }
       lower_omp_parallel (gsi_p, ctx);
       break;
     case GIMPLE_OMP_FOR:
@@ -5144,11 +5127,8 @@ execute_lower_omp (void)
   scan_omp (body, NULL);
   gcc_assert (parallel_nesting_level == 0);
 
-  /* FIXME tuples */
-#if 0
   if (all_contexts->root)
     lower_omp (body, NULL);
-#endif
 
   if (all_contexts)
     {
Index: gimple-dummy.c
===================================================================
--- gimple-dummy.c	(revision 134414)
+++ gimple-dummy.c	(working copy)
@@ -50,13 +50,6 @@ DUMMY_FN (vect_set_verbosity_level)
 DUMMY_FN (vectorize_loops)
 DUMMY_FN (remove_iv)
 DUMMY_FN (diagnose_omp_structured_block_errors)
-DUMMY_FN (lower_omp_parallel)
-DUMMY_FN (lower_omp_for)
-DUMMY_FN (lower_omp_sections)
-DUMMY_FN (lower_omp_single)
-DUMMY_FN (lower_omp_master)
-DUMMY_FN (lower_omp_ordered)
-DUMMY_FN (lower_omp_critical)
 
 
 /* Note that we should mark gimple_unreachable_1 with
Index: gimple-low.c
===================================================================
--- gimple-low.c	(revision 134414)
+++ gimple-low.c	(working copy)
@@ -240,22 +240,19 @@ lower_sequence (gimple_seq seq, struct l
 /* Lower the OpenMP directive statement pointed by GSI.  DATA is
    passed through the recursion.  */
 
-  /* FIXME tuples.  */
-#if 0
 static void
 lower_omp_directive (gimple_stmt_iterator *gsi, struct lower_data *data)
 {
   gimple stmt;
   
-  stmt = gsi_stmt (gsi);
+  stmt = gsi_stmt (*gsi);
 
-  lower_sequence (OMP_BODY (stmt), data);
+  lower_sequence (gimple_omp_body (stmt), data);
   gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
-  gsi_insert_before (gsi, OMP_BODY (stmt), GSI_SAME_STMT);
-  OMP_BODY (stmt) = NULL_TREE;
+  gsi_insert_seq_before (gsi, gimple_omp_body (stmt), GSI_SAME_STMT);
+  gimple_omp_set_body (stmt, NULL);
   gsi_remove (gsi, false);
 }
-#endif
 
 
 /* Lower statement TSI.  DATA is passed through the recursion.  */
@@ -328,12 +325,9 @@ lower_stmt (gimple_stmt_iterator *gsi, s
       }
       break;
 
-    /* FIXME tuples.  */
-#if 0
     case GIMPLE_OMP_PARALLEL:
       lower_omp_directive (gsi, data);
       return;
-#endif
 
     default:
       gcc_unreachable ();
Index: gimple.h
===================================================================
--- gimple.h	(revision 134414)
+++ gimple.h	(working copy)
@@ -189,6 +189,19 @@ gimple_seq_empty_p (const_gimple_seq s)
 }
 
 
+void gimple_seq_add_stmt (gimple_seq *, gimple);
+
+/* Allocate a new sequence and initialize its first element with STMT.  */
+
+static inline gimple_seq
+gimple_seq_alloc_with_stmt (gimple stmt)
+{
+  gimple_seq seq = NULL;
+  gimple_seq_add_stmt (&seq, stmt);
+  return seq;
+}
+
+
 /* Returns the sequence of statements in BB.  */
 
 static inline gimple_seq
@@ -608,7 +621,6 @@ gimple gimple_build_cdt (tree, tree);
 gimple gimple_build_omp_atomic_load (tree, tree);
 gimple gimple_build_omp_atomic_store (tree);
 enum gimple_statement_structure_enum gimple_statement_structure (gimple);
-void gimple_seq_add_stmt (gimple_seq *, gimple);
 enum gimple_statement_structure_enum gss_for_assign (enum tree_code);
 void sort_case_labels (VEC(tree,heap) *);
 void gimple_set_body (tree, gimple_seq);
@@ -1075,6 +1087,16 @@ gimple_omp_section_last_p (const_gimple 
 }
 
 
+/* Set the GF_OMP_SECTION_LAST flag on G.  */
+
+static inline void
+gimple_omp_section_set_last (gimple g)
+{
+  GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
+  g->gsbase.subcode |= GF_OMP_SECTION_LAST;
+}
+
+
 /* Return true if OMP parallel statement G has the
    GF_OMP_PARALLEL_COMBINED flag set.  */
 
@@ -1085,6 +1107,17 @@ gimple_omp_parallel_combined_p (const_gi
   return (gimple_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
 }
 
+
+/* Set the GF_OMP_PARALLEL_COMBINED field in G.  */
+
+static inline void
+gimple_omp_parallel_set_combined_p (gimple g)
+{
+  GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
+  g->gsbase.subcode |= GF_OMP_PARALLEL_COMBINED;
+}
+
+
 extern const char *const gimple_code_name[];
 
 
@@ -1929,6 +1962,26 @@ gimple_bind_set_body (gimple gs, gimple_
 }
 
 
+/* Append a statement to the end of a GIMPLE_BIND's body.  */
+
+static inline void
+gimple_bind_add_stmt (gimple gs, gimple stmt)
+{
+  GIMPLE_CHECK (gs, GIMPLE_BIND);
+  gimple_seq_add_stmt (&gs->gimple_bind.body, stmt);
+}
+
+
+/* Append a sequence of statements to the end of a GIMPLE_BIND's body.  */
+
+static inline void
+gimple_bind_add_seq (gimple gs, gimple_seq seq)
+{
+  GIMPLE_CHECK (gs, GIMPLE_BIND);
+  gimple_seq_add_seq (&gs->gimple_bind.body, seq);
+}
+
+
 /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
    GS.  This is analogous to the BIND_EXPR_BLOCK field in trees.  */
 
Index: tree-cfg.c
===================================================================
--- tree-cfg.c	(revision 134414)
+++ tree-cfg.c	(working copy)
@@ -3935,7 +3935,7 @@ tree_node_can_be_shared (tree t)
 }
 
 
-/* Called via gimple_walk_stmt.  Verify tree sharing.  */
+/* Called via walk_gimple_stmt.  Verify tree sharing.  */
 
 static tree
 verify_node_sharing (tree *tp, int *walk_subtrees, void *data)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]