This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/20363] interface body has incorrect scope
- From: "Tobias dot Schlueter at physik dot uni-muenchen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jul 2005 13:22:01 -0000
- Subject: [Bug fortran/20363] interface body has incorrect scope
- References: <20050307183348.20363.paulthomas2@wanadoo.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From Tobias dot Schlueter at physik dot uni-muenchen dot de 2005-07-27 13:21 -------
Subject: Re: interface body has incorrect scope
Quoting erik dot edelmann at iki dot fi <gcc-bugzilla@gcc.gnu.org>:
> I've taken a look at "another compiler" (i.e. g95). The difference is in
> (gfc|g95)_match_interface(). While we do
>
> case INTERFACE_GENERIC:
>
> <...>
>
> current_interface.sym = gfc_new_block = sym;
>
> g95 does:
>
> case INTERFACE_GENERIC:
>
> <...>
>
> g95_new_block = NULL;
>
> The result of this is that in find_special(), when we get to the point
>
> if (s->state != COMP_INTERFACE || s->sym == NULL)
> goto normal; /* Nameless interface */
>
> (or corresponding point in gfortran source code), g95 will 'goto normal',
> while
> we continue. In other words; g95 treats generic interfaces as nameless
> interfaces. This brings me to a question: what is a "named interface"? I
> had
> assumed that it would the same thing as a generic interface, but in g95 code
> it
> is apperantly not.
(I'm at the office so wrapping is weird, my e-mail address is weird and I don't
have the standard nor the source handy)
IIRC in g95 generic interface names are not part of the usual symbol tree, but
instead they're stored completely apart, so that the symbol doesn't get in the
way as it does in our case, and therefore the check in find_special can remain
the same. Therefore it's unfortunately not clear if the behavior with your
patch is equivalent to g95's.
I couldn't think of anything that breaks with your patch, which leaves us with
either the option of applying your patch (and then having to remember reverting
your change if someone finds time to overhaul symbol handling) or overhauling
symbol handling right away :-(
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20363