diff options
author | Martin Jambor <mjambor@suse.cz> | 2013-08-06 14:48:53 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2013-08-06 14:48:53 +0200 |
commit | 15682f2418221ee45ebf9fd2c4803fb179060c42 (patch) | |
tree | 54d423cab2471b50ef6202932602d8e48f3f22b2 /gcc/fortran | |
parent | 6ffd1096cf7620eea04f99693c32601e9312cd8c (diff) | |
download | gcc-15682f2418221ee45ebf9fd2c4803fb179060c42.zip gcc-15682f2418221ee45ebf9fd2c4803fb179060c42.tar.gz gcc-15682f2418221ee45ebf9fd2c4803fb179060c42.tar.bz2 |
re PR fortran/57987 (Fortran finalizers considered extern-inline by middle-end)
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.
From-SVN: r201526
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 18 |
2 files changed, 16 insertions, 8 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7a9fe6e..bcd91a9 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2013-08-06 Martin Jambor <mjambor@suse.cz> + + PR fortran/57987 + * trans-decl.c (gfc_generate_function_code): Never call + cgraph_finalize_function on nested functions. + 2013-08-06 Janus Weil <janus@gcc.gnu.org> PR fortran/57306 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 43f401d..1708931 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); |