http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57987
Bug ID: 57987 Summary: Fortran finalizers considered extern-inline by middle-end Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jamborm at gcc dot gnu.org When looking at PR 57904, I found out that inliner refused to even consider __final_test2_T/0 because, according to the dump, "redefined extern inline functions are not considered for inlining." When I looked at why, I realized that the function is "finalized" (by cgraph_finalize_function) twice. Once directly from front-end and second time from un-nesting nested functions. I asked Honza about this and he claims that front-ends should not do that, despite the confusing parameter of cgraph_finalize_function. (It's best to try this whith -fno-ipa-cp because of PR 57904 itself and because it's slightly easier to follow, but is not necessary to see the problem).