------- Comment #28 from mikael at gcc dot gnu dot org 2010-08-18 14:40 ------- (In reply to comment #27) > This is a very good suggestion. I will have a think about how to implement it > and will come back to you. It is consistent with what I had in mind to > improve > the efficiency of module reading. ie. read_module proceeds as follows: > > (i) On encountering a USE statement, look for the module gsym. If it does not > exist, use read_module, as at present, to construct the namespace, without any > exclusions or renames; > (ii) In the current scope, create symtrees using the ONLY and the renames and > point to the symbols in the gsym namespace; > (iii) Subsequent USEs of the same module proceed by using the gsym namespace.
Hello, I have been trying a similar approach before. One problem you may encounter is that symbols have non-shareable parts. For examples symbol attributes such as access or use_rename can differ between symbols associated to the same entity. I tried to split gfc_symbol into an entity-specific part and a symbol-specific part but that led to huge changes throughout the frontend and to the associated regressions, so that I eventually gave up. A possible way might be to clone the symbol, and keep a pointer to the original one so that we can get the original backend_decl from it. Maybe you will have a different path and won't encounter this problem at all. Good luck anyway, that seems the way to go :-) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44945