http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48174
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-19 23:26:22 UTC --- Hmm, I am surprised about this PR. The test case from comment 0 indicates that the FE generates the wrong declaration for the procedure (subroutine) itself. I was only aware about issues where the declaration of procedures with implicit interfaces caused problems (e.g. PR 40976, PR 33097, PR 44471). As the interface is explicitly known, it should be rather straight forward to fix this issue (contrary to the other PRs) ... Untested draft patch. (I am not sure about the if_source part, but I think leaving it as is should be best for the moment; the real solution for that part is to fix the issue outlined in the first paragraph.) --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -2618,7 +2618,7 @@ gfc_get_function_type (gfc_symbol * sym) if (typelist) typelist = chainon (typelist, void_list_node); - else if (sym->attr.is_main_program) + else if (sym->attr.if_source != IFSRC_UNKNOWN) typelist = void_list_node; if (alternate_return)