This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33541] gfortran wrongly imports renamed-use-associated symbol unrenamed
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Nov 2007 15:10:37 -0000
- Subject: [Bug fortran/33541] gfortran wrongly imports renamed-use-associated symbol unrenamed
- References: <bug-33541-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from pault at gcc dot gnu dot org 2007-11-19 15:10 -------
(In reply to comment #5)
> Off to generics and operators now!
Ahhh... I have run into a serious problem here. It transpires that renaming is
not accomplished for generic interfaces by keeping the use-name symbol with
multiple symtrees, each with a local-name. Instead, the symtree and the symbol
have the local-name. This breaks the mechanism that I evolved above.
The DEC Manual puts the rules rather nicely:
If more than one USE statement for a given module appears in a scoping unit,
the following rules apply:
If one USE statement does not have the ONLY option, all public entities in the
module are accessible, and any rename- lists and only-lists are interpreted as
a single, concatenated rename-list.
If all the USE statements have ONLY options, all the only-lists are interpreted
as a single, concatenated only-list. Only those entities named in one or more
of the only-lists are accessible.
This, I think, shows the way forward. ie. In matching the USE statements, we
only build up the rename-list and flag the presence of a USE statement without
an ONLY. Then, at the last USE statement, we process all the referenced .mod
files just once, using the concatenated rename-list as an only-list or a rename
list, according to what we have seen.
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33541