summaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-decl.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-06 12:48:53 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-06 12:48:53 +0000
commit1f7747bdd19378ccc7df852c1f4693f197373428 (patch)
tree54d423cab2471b50ef6202932602d8e48f3f22b2 /gcc/fortran/trans-decl.c
parent7407ba0b769ad434b2787b3dfb67cd5e44b80e3e (diff)
downloadgcc-1f7747bdd19378ccc7df852c1f4693f197373428.tar.gz
2013-08-06 Martin Jambor <mjambor@suse.cz>
PR fortran/57987 * cgraphunit.c (cgraph_finalize_function): Assert that nested function is not re-finalized. Rename second parameter to no_collect. fortran/ * trans-decl.c (gfc_generate_function_code): Never call cgraph_finalize_function on nested functions. testsuite/ * gfortran.dg/pr57987.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201526 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-decl.c')
-rw-r--r--gcc/fortran/trans-decl.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 43f401d83d4..17089316602 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -5643,14 +5643,16 @@ gfc_generate_function_code (gfc_namespace * ns)
}
current_function_decl = old_context;
- if (decl_function_context (fndecl) && gfc_option.coarray != GFC_FCOARRAY_LIB
- && has_coarray_vars)
- /* Register this function with cgraph just far enough to get it
- added to our parent's nested function list.
- If there are static coarrays in this function, the nested _caf_init
- function has already called cgraph_create_node, which also created
- the cgraph node for this function. */
- (void) cgraph_create_node (fndecl);
+ if (decl_function_context (fndecl))
+ {
+ /* Register this function with cgraph just far enough to get it
+ added to our parent's nested function list.
+ If there are static coarrays in this function, the nested _caf_init
+ function has already called cgraph_create_node, which also created
+ the cgraph node for this function. */
+ if (!has_coarray_vars || gfc_option.coarray != GFC_FCOARRAY_LIB)
+ (void) cgraph_create_node (fndecl);
+ }
else
cgraph_finalize_function (fndecl, true);