http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48588
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-04-18 20:56:02 UTC --- The following seems to mostly work. I think some double resolving could happen - thus, one might need to tweak resolve_all_program_units. Paul & Mikael: What do you think? Test-suite failures with the patch: gfortran.dg/entry_17.f90 (Extra -pedantic warnings), gfortran.dg/pr41011.f, gfortran.dg/auto_char_len_4.f90, gfortran.dg/func_decl_4.f90, gfortran.dg/generic_actual_arg.f90, gfortran.dg/global_references_1.f90, gfortran.dg/hollerith8.f90, gfortran.dg/bounds_temporaries_1.f90, gfortran.dg/integer_exponentiation_2.f90, gfortran.dg/g77/19990218-0.f, gfortran.dg/g77/970625-2.f, gfortran.dg/whole_file_16.f90, gfortran.dg/whole_file_18.f90, gfortran.dg/whole_file_2.f90, gfortran.dg/whole_file_20.f03) --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -4411,6 +4411,8 @@ prog_units: else gfc_global_ns_list = gfc_current_ns; + gfc_resolve (gfc_current_ns); + next = gfc_current_ns; pop_state ();