http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42769
Mikael Morin <mikael at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mikael at gcc dot gnu.org --- Comment #31 from Mikael Morin <mikael at gcc dot gnu.org> 2011-02-23 23:08:18 UTC --- (In reply to comment #25) > This seems to be a module-loading bug. When reading the specific binding of > the > TBP 'get' from 'mod1' (which happens in module.c, mio_typebound_proc), we > expect to get the symbol 'my_get' from 'mod1', but instead we get 'my_get' > from > 'mod2'. > > My knowledge of the module-reading code is not sufficient to see where stuff > goes wrong. Maybe someone else can? This is not a module loading problem I think. It's true that the two `my_get' functions do conflict in the program namespace. One does not need to pass by the program namespace to resolve the typebound call however. That is, the gfc_typebound_proc.u.specific field should be a gfc_symbol, not a gfc_symtree. This way, even if that gfc_symbol is not accessible through a gfc_symtree in the program namespace, it is loaded anyway (and gets a unique symtree but this is an implementation detail) because it is needed in the gfc_typebound_proc struct. That being said, I suppose there is a reason for it to be a gfc_symtree, and not a gfc_symbol.