+2008-06-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36523
+ * cgraphunit.c (cgraph_process_new_functions): Don't clear
+ node->needed and node->reachable.
+ * cgraphbuild.c (record_reference): Handle OMP_PARALLEL and OMP_TASK.
+ * omp-low.c (delete_omp_context): Call finalize_task_copyfn.
+ (expand_task_call): Don't call expand_task_copyfn.
+ (expand_task_copyfn): Renamed to...
+ (finalize_task_copyfn): ... this.
+
2008-06-19 Jan Hubicka <jh@suse.cz>
* builtins.c (expand_builtin_nonlocal_goto): Stabilize r_sp before
}
break;
+ case OMP_PARALLEL:
+ if (flag_unit_at_a_time)
+ {
+ if (OMP_PARALLEL_FN (*tp))
+ cgraph_mark_needed_node (cgraph_node (OMP_PARALLEL_FN (*tp)));
+ }
+ break;
+
+ case OMP_TASK:
+ if (flag_unit_at_a_time)
+ {
+ if (OMP_TASK_FN (*tp))
+ cgraph_mark_needed_node (cgraph_node (OMP_TASK_FN (*tp)));
+ if (OMP_TASK_COPYFN (*tp))
+ cgraph_mark_needed_node (cgraph_node (OMP_TASK_COPYFN (*tp)));
+ }
+ break;
+
default:
/* Save some cycles by not walking types and declaration as we
won't find anything useful there anyway. */
return ctx;
}
+static void maybe_catch_exception (tree *stmt_p);
+
+/* Finalize task copyfn. */
+
+static void
+finalize_task_copyfn (tree task_stmt)
+{
+ struct function *child_cfun;
+ tree child_fn, old_fn;
+
+ child_fn = OMP_TASK_COPYFN (task_stmt);
+ if (child_fn == NULL_TREE)
+ return;
+
+ child_cfun = DECL_STRUCT_FUNCTION (child_fn);
+
+ /* Inform the callgraph about the new function. */
+ DECL_STRUCT_FUNCTION (child_fn)->curr_properties
+ = cfun->curr_properties;
+
+ old_fn = current_function_decl;
+ push_cfun (child_cfun);
+ current_function_decl = child_fn;
+ gimplify_body (&DECL_SAVED_TREE (child_fn), child_fn, false);
+ maybe_catch_exception (&BIND_EXPR_BODY (DECL_SAVED_TREE (child_fn)));
+ pop_cfun ();
+ current_function_decl = old_fn;
+
+ cgraph_add_new_function (child_fn, false);
+}
+
/* Destroy a omp_context data structures. Called through the splay tree
value delete callback. */
DECL_ABSTRACT_ORIGIN (t) = NULL;
}
+ if (is_task_ctx (ctx))
+ finalize_task_copyfn (ctx->stmt);
+
XDELETE (ctx);
}
}
-static void maybe_catch_exception (tree *stmt_p);
-
-
-/* Finalize task copyfn. */
-
-static void
-expand_task_copyfn (tree task_stmt)
-{
- struct function *child_cfun;
- tree child_fn, old_fn;
-
- child_fn = OMP_TASK_COPYFN (task_stmt);
- child_cfun = DECL_STRUCT_FUNCTION (child_fn);
-
- /* Inform the callgraph about the new function. */
- DECL_STRUCT_FUNCTION (child_fn)->curr_properties
- = cfun->curr_properties;
-
- old_fn = current_function_decl;
- push_cfun (child_cfun);
- current_function_decl = child_fn;
- gimplify_body (&DECL_SAVED_TREE (child_fn), child_fn, false);
- maybe_catch_exception (&BIND_EXPR_BODY (DECL_SAVED_TREE (child_fn)));
- pop_cfun ();
- current_function_decl = old_fn;
-
- cgraph_add_new_function (child_fn, false);
-}
-
/* Build the function call to GOMP_task to actually
generate the task operation. BB is the block where to insert the code. */
clauses = OMP_TASK_CLAUSES (entry_stmt);
- if (OMP_TASK_COPYFN (entry_stmt))
- expand_task_copyfn (entry_stmt);
-
c = find_omp_clause (clauses, OMP_CLAUSE_IF);
if (c)
cond = gimple_boolify (OMP_CLAUSE_IF_EXPR (c));