aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2012-09-20 16:35:40 +0000
committerMartin Jambor <mjambor@suse.cz>2012-09-20 16:35:40 +0000
commita704de3f6db56790106a88d3787b918841bb5536 (patch)
treebd0847507cf2cc8fc2505732d6abf2f60dd73989 /gcc/omp-low.c
parent61e2370527462cc82b24fbd91f145361b9b5ff4f (diff)
2012-09-20 Martin Jambor <mjambor@suse.cz>
* function.c (push_cfun): Check old current_function_decl matches old cfun, set new current_function_decl to the decl of the new cfun. (push_struct_function): Likewise. (pop_cfun): Likewise. (allocate_struct_function): Move call to invoke_set_current_function_hook to the end of the function. * cfgexpand.c (estimated_stack_frame_size): Do not set and restore current_function_decl. * cgraph.c (cgraph_release_function_body): Likewise. * cgraphunit.c (cgraph_process_new_functions): Likewise. (cgraph_add_new_function): Likewise. (cgraph_analyze_function): Likewise. (assemble_thunk): Set cfun to NULL at the end. (expand_function): Move call to set_cfun downwards. * gimple-low.c (record_vars_into): Only check current_function_decl before possibly doing push_cfun. * gimplify.c (gimplify_function_tree): Do not set and restore current_function_decl. * ipa-inline-analysis.c (compute_inline_parameters): Likewise. (inline_analyze_function): Likewise. * ipa-prop.c (ipa_analyze_node): Likewise. * ipa-pure-const.c (analyze_function): Likewise. * lto-streamer-in.c (lto_input_function_body): Do not set current_function_decl. * lto-streamer-out.c (output_function): Do not set and restore current_function_decl. * omp-low.c (finalize_task_copyfn): Likewise. (expand_omp_taskreg): Likewise. (create_task_copyfn): Likewise, move push_cfun up quite a bit. * passes.c (dump_passes): Do not set and restore current_function_decl. (do_per_function): Likewise. (do_per_function_toporder): Likewise. * trans-mem.c (ipa_tm_scan_irr_function): Likewise. (ipa_tm_transform_transaction): Likewise. (ipa_tm_transform_clone): Likewise. (ipa_tm_execute): Likewise. * tree-emutls.c (lower_emutls_function_body): Likewise. * tree-inline.c (initialize_cfun): Do not call pop_cfun. (tree_function_versioning): Do not call push_cfun, do not set and restore current_function_decl. Remove assert checking consistency of cfun and current_function_decl. * tree-profile.c (tree_profiling): Do not set and restore current_function_decl. * tree-sra.c (convert_callers_for_node): Do not set current_function_decl. (convert_callers): Do not restore current_function_decl. (modify_function): Do not set current_function_decl. * tree-ssa-structalias.c (ipa_pta_execute): Do not set and restore current_function_decl. fortran/ * trans-decl.c (gfc_get_extern_function_decl): Push NULL cfun. Do not set and restore current_function_decl. (gfc_init_coarray_decl): Do not set and restore current_function_decl. lto/ * lto.c (lto_materialize_function): Call push_struct_function and pop_cfun. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@191577 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 9474167ce6d..4d32fb6d35d 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -1243,7 +1243,7 @@ static void
finalize_task_copyfn (gimple task_stmt)
{
struct function *child_cfun;
- tree child_fn, old_fn;
+ tree child_fn;
gimple_seq seq = NULL, new_seq;
gimple bind;
@@ -1257,9 +1257,7 @@ finalize_task_copyfn (gimple task_stmt)
DECL_STRUCT_FUNCTION (child_fn)->curr_properties
= cfun->curr_properties & ~PROP_loops;
- old_fn = current_function_decl;
push_cfun (child_cfun);
- current_function_decl = child_fn;
bind = gimplify_body (child_fn, false);
gimple_seq_add_stmt (&seq, bind);
new_seq = maybe_catch_exception (seq);
@@ -1271,7 +1269,6 @@ finalize_task_copyfn (gimple task_stmt)
}
gimple_set_body (child_fn, seq);
pop_cfun ();
- current_function_decl = old_fn;
cgraph_add_new_function (child_fn, false);
}
@@ -3388,7 +3385,6 @@ expand_omp_taskreg (struct omp_region *region)
basic_block entry_bb, exit_bb, new_bb;
struct function *child_cfun;
tree child_fn, block, t;
- tree save_current;
gimple_stmt_iterator gsi;
gimple entry_stmt, stmt;
edge e;
@@ -3588,8 +3584,6 @@ expand_omp_taskreg (struct omp_region *region)
/* Fix the callgraph edges for child_cfun. Those for cfun will be
fixed in a following pass. */
push_cfun (child_cfun);
- save_current = current_function_decl;
- current_function_decl = child_fn;
if (optimize)
optimize_omp_library_calls (entry_stmt);
rebuild_cgraph_edges ();
@@ -3610,7 +3604,6 @@ expand_omp_taskreg (struct omp_region *region)
}
if (gimple_in_ssa_p (cfun))
update_ssa (TODO_update_ssa);
- current_function_decl = save_current;
pop_cfun ();
}
@@ -6456,7 +6449,7 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
/* Populate the function. */
push_gimplify_context (&gctx);
- current_function_decl = child_fn;
+ push_cfun (child_cfun);
bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
TREE_SIDE_EFFECTS (bind) = 1;
@@ -6503,8 +6496,6 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
else
tcctx.cb.decl_map = NULL;
- push_cfun (child_cfun);
-
arg = DECL_ARGUMENTS (child_fn);
TREE_TYPE (arg) = build_pointer_type (record_type);
sarg = DECL_CHAIN (arg);
@@ -6662,7 +6653,6 @@ create_task_copyfn (gimple task_stmt, omp_context *ctx)
pop_gimplify_context (NULL);
BIND_EXPR_BODY (bind) = list;
pop_cfun ();
- current_function_decl = ctx->cb.src_fn;
}
/* Lower the OpenMP parallel or task directive in the current statement