OSDN Git Service

2006-04-03 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / omp-low.c
index 38d4224..41b4093 100644 (file)
@@ -3,7 +3,7 @@
    marshalling to implement data sharing and copying clauses.
    Contributed by Diego Novillo <dnovillo@redhat.com>
 
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -47,7 +47,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
    phases.  The first phase scans the function looking for OMP statements
    and then for variables that must be replaced to satisfy data sharing
    clauses.  The second phase expands code for the constructs, as well as
-   re-gimplifing things when variables have been replaced with complex
+   re-gimplifying things when variables have been replaced with complex
    expressions.
 
    Final code generation is done by pass_expand_omp.  The flowgraph is
@@ -2042,7 +2042,7 @@ expand_parallel_call (struct omp_region *region, basic_block bb, tree ws_args)
   clauses = OMP_PARALLEL_CLAUSES (region->entry);
   push_gimplify_context ();
 
-  /* Determine what flavour of GOMP_parallel_start we will be
+  /* Determine what flavor of GOMP_parallel_start we will be
      emitting.  */
   start_ix = BUILT_IN_GOMP_PARALLEL_START;
   if (is_combined_parallel (region))
@@ -2430,6 +2430,8 @@ expand_omp_for_generic (struct omp_region *region,
 
   istart0 = create_tmp_var (long_integer_type_node, ".istart0");
   iend0 = create_tmp_var (long_integer_type_node, ".iend0");
+  TREE_ADDRESSABLE (istart0) = 1;
+  TREE_ADDRESSABLE (iend0) = 1;
 
   l0 = create_artificial_label ();
   l1 = create_artificial_label ();
@@ -3331,7 +3333,7 @@ build_omp_regions (void)
 
 /* Main entry point for expanding OMP-GIMPLE into runtime calls.  */
 
-static void
+static unsigned int
 execute_expand_omp (void)
 {
   build_omp_regions ();
@@ -3350,6 +3352,7 @@ execute_expand_omp (void)
       root_omp_region = NULL;
       omp_regions = NULL;
     }
+  return 0;
 }
 
 static bool
@@ -3461,6 +3464,9 @@ lower_omp_sections (tree *stmt_p, omp_context *ctx)
   new_body = alloc_stmt_list ();
   append_to_statement_list (ilist, &new_body);
   append_to_statement_list (stmt, &new_body);
+  /* ??? The OMP_RETURN doesn't logically belong here, but in
+     expand_omp_sections we expect this marker to be where the
+     individual sections join after completing the loop.  */
   append_to_statement_list (region_exit, &new_body);
   append_to_statement_list (olist, &new_body);
   append_to_statement_list (dlist, &new_body);
@@ -3607,9 +3613,9 @@ lower_omp_single (tree *stmt_p, omp_context *ctx)
     lower_omp_single_simple (single_stmt, &BIND_EXPR_BODY (bind));
 
   append_to_statement_list (dlist, &BIND_EXPR_BODY (bind));
+  maybe_catch_exception (&BIND_EXPR_BODY (bind));
   t = make_node (OMP_RETURN_EXPR);
   append_to_statement_list (t, &BIND_EXPR_BODY (bind));
-  maybe_catch_exception (&BIND_EXPR_BODY (bind));
   pop_gimplify_context (bind);
 
   BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
@@ -3644,9 +3650,9 @@ lower_omp_master (tree *stmt_p, omp_context *ctx)
 
   x = build1 (LABEL_EXPR, void_type_node, lab);
   gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+  maybe_catch_exception (&BIND_EXPR_BODY (bind));
   x = make_node (OMP_RETURN_EXPR);
   append_to_statement_list (x, &BIND_EXPR_BODY (bind));
-  maybe_catch_exception (&BIND_EXPR_BODY (bind));
   pop_gimplify_context (bind);
 
   BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
@@ -3680,9 +3686,9 @@ lower_omp_ordered (tree *stmt_p, omp_context *ctx)
   x = built_in_decls[BUILT_IN_GOMP_ORDERED_END];
   x = build_function_call_expr (x, NULL);
   gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+  maybe_catch_exception (&BIND_EXPR_BODY (bind));
   x = make_node (OMP_RETURN_EXPR);
   append_to_statement_list (x, &BIND_EXPR_BODY (bind));
-  maybe_catch_exception (&BIND_EXPR_BODY (bind));
   pop_gimplify_context (bind);
 
   BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
@@ -4105,7 +4111,7 @@ lower_omp (tree *stmt_p, omp_context *ctx)
 \f
 /* Main entry point.  */
 
-static void
+static unsigned int
 execute_lower_omp (void)
 {
   all_contexts = splay_tree_new (splay_tree_compare_pointers, 0,
@@ -4122,6 +4128,7 @@ execute_lower_omp (void)
       splay_tree_delete (all_contexts);
       all_contexts = NULL;
     }
+  return 0;
 }
 
 static bool