------- Comment #16 from burnus at gcc dot gnu dot org 2010-07-16 14:21 ------- (In reply to comment #15) > I wonder whether the middle-end will not mind different types (the "recycled" > decl will use backend_decl and its type from wherever it has been generated, > and the current function will likely have a different type).
I am not sure whether I understand your concern. This is about recycling the decl of a module variable (sym->attr.flavor == FL_VARIABLE) which should have the same type everywhere. Thus, from that side there should be no problem. The only potential issue I see is: use module type(t) :: x x = y ! where "y" is a module variable of type "t" where "x" has locally been declared - and thus might have a different type decl than the module variable. I think one should check this, but I think that does not make the current patch wrong. > Plus there is -fno-whole-file (unless we want to make -fwhole-file default and > remove -fno-whole-file for 4.6). My idea is to change at some point during 4.6 to using -fwhole-file by default - though I would not yet remove -fno-whole-file, yet. But the ultimate goal is to remove -fno-whole-file and add some new flag (-fpermissive) for the few cases where one wants to disable compilations errors due to fwhole-file diagnostics. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44945