------- Comment #3 from sme at cs dot toronto dot edu  2010-07-16 16:04 -------
I've investigated further, and can reproduce it, but with one more condition
that I didn't mention in the original bugreport. 
Basically, it happens when we have two modules, both defining a subroutine with
the same name, where one happens to use the other (with a renaming).
For example:


The module m_dropdead defines an interface 'die'.
The module m_die also defines an interface 'die'.

So far, so good, and both compile fine.
However the subroutines in m_die use the die interface from m_dropdead:
     use m_dropdead, only : ddie => die

Not a problem so far.

But then, when I attempt to compile other files that use m_die, the compiler
gets confused. For example, when compiling m_IndexBin_char, we get to the line:
   use m_die,   only : die
and the compiler complains that m_die doesn't have a die routine. It looks like
a compiler bug - somehow or other the remapping to ddie in m_die has messed up
the symbol table beyond the scope of the subroutine it was used in.

I'm attaching three files that demonstrate the bug.  If you remove the line
that's commented out in m_die, and run them through gfortran, you should see it
trip up when compiling m_IndexBin_char

BTW I'm running gcc 4.3.0
On Mac OS X 10.5.8.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44957

Reply via email to