http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46849
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-14 08:36:07 UTC --- (In reply to comment #4) > @@ -2717,7 +2717,7 @@ gfc_get_sym_tree (const char *name, gfc_namespace > if (ns == NULL) > - ns = gfc_current_ns; > + ns = gfc_find_proc_namespace (gfc_current_ns); That looks wrong. gfc_get_sym_tree is called several times in decl.c, match.c, parse.c and primary.c with NULL - I fear that this patch will cause symbols end up in the wrong name space. I think one should rather do something like the following - though one might need to be a bit more careful and restrict it, e.g., to procedures. --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -11784,7 +11784,7 @@ resolve_symbol (gfc_symbol *sym) for (ns = gfc_current_ns->parent; ns; ns = ns->parent) { symtree = gfc_find_symtree (ns->sym_root, sym->name); - if (symtree && symtree->n.sym->generic) + if (symtree) /* && symtree->n.sym->generic)*/ { this_symtree = gfc_find_symtree (gfc_current_ns->sym_root, sym->name);