http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54997
--- Comment #4 from janus at gcc dot gnu.org 2012-10-20 21:46:12 UTC --- The following removes the warning for s3: Index: gcc/fortran/trans-decl.c =================================================================== --- gcc/fortran/trans-decl.c (revision 192619) +++ gcc/fortran/trans-decl.c (working copy) @@ -1854,6 +1854,9 @@ build_function_decl (gfc_symbol * sym, bool global || sym->attr.public_used)) TREE_PUBLIC (fndecl) = 1; + if (sym->attr.referenced) + TREE_USED (fndecl) = 1; + attributes = add_attributes_to_decl (attr, NULL_TREE); decl_attributes (&fndecl, attributes, 0); but it also removes the warning on procedures which are really unused :(