aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2012-09-20 18:35:40 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2012-09-20 18:35:40 +0200
commitaf16bc762a0d806b2297013a56edcf7cd38cb25f (patch)
treebd0847507cf2cc8fc2505732d6abf2f60dd73989 /gcc/fortran
parentee6440f8d8ad3e2a015a50a598cb80669569da27 (diff)
downloadgcc-af16bc762a0d806b2297013a56edcf7cd38cb25f.zip
gcc-af16bc762a0d806b2297013a56edcf7cd38cb25f.tar.gz
gcc-af16bc762a0d806b2297013a56edcf7cd38cb25f.tar.bz2
function.c (push_cfun): Check old current_function_decl matches old cfun...
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. From-SVN: r191577
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-decl.c10
2 files changed, 7 insertions, 9 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3552ffc..2f405b8 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-20 Martin Jambor <mjambor@suse.cz>
+
+ * 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.
+
2012-09-17 Tobias Burnus <burnus@net-b.de>
PR fortran/54608
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 53c248d9..910b150 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1630,17 +1630,14 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
/* By construction, the external function cannot be
a contained procedure. */
locus old_loc;
- tree save_fn_decl = current_function_decl;
- current_function_decl = NULL_TREE;
gfc_save_backend_locus (&old_loc);
- push_cfun (cfun);
+ push_cfun (NULL);
gfc_create_function_decl (gsym->ns, true);
pop_cfun ();
gfc_restore_backend_locus (&old_loc);
- current_function_decl = save_fn_decl;
}
/* If the namespace has entries, the proc_name is the
@@ -4861,16 +4858,12 @@ add_argument_checking (stmtblock_t *block, gfc_symbol *sym)
void
gfc_init_coarray_decl (bool main_tu)
{
- tree save_fn_decl;
-
if (gfc_option.coarray != GFC_FCOARRAY_LIB)
return;
if (gfort_gvar_caf_this_image || gfort_gvar_caf_num_images)
return;
- save_fn_decl = current_function_decl;
- current_function_decl = NULL_TREE;
push_cfun (cfun);
gfort_gvar_caf_this_image
@@ -4906,7 +4899,6 @@ gfc_init_coarray_decl (bool main_tu)
pushdecl_top_level (gfort_gvar_caf_num_images);
pop_cfun ();
- current_function_decl = save_fn_decl;
}