http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Component|middle-end |fortran --- Comment #7 from janus at gcc dot gnu.org 2012-09-15 17:41:29 UTC --- (In reply to comment #6) > * It seems as if the TREE_USED part should be handled on the Fortran FE side > for both (PRIVATE) module variables and module procedures Here is a patch which should set TREE_USED for all procedure calls: Index: gcc/fortran/trans-expr.c =================================================================== --- gcc/fortran/trans-expr.c (revision 191303) +++ gcc/fortran/trans-expr.c (working copy) @@ -2455,6 +2455,8 @@ conv_function_val (gfc_se * se, gfc_symbol * sym, if (!sym->backend_decl) sym->backend_decl = gfc_get_extern_function_decl (sym); + TREE_USED (sym->backend_decl) = 1; + tmp = sym->backend_decl; if (sym->attr.cray_pointee) It makes the bogus warning on comment 0 go away.