This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32526] [4.3 regression] Spurious error: Name 'x' at (1) is an ambiguous reference to 'x' from module 'y'
- 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: 4 Jul 2007 08:58:33 -0000
- Subject: [Bug fortran/32526] [4.3 regression] Spurious error: Name 'x' at (1) is an ambiguous reference to 'x' from module 'y'
- References: <bug-32526-14284@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from pault at gcc dot gnu dot org 2007-07-04 08:58 -------
(In reply to comment #4)
> > Adding Paul as CC.
This is indeed my doing - sorry. The cause is
PR fortran/31494
* match.c (gfc_match_call): If a host associated symbol is not
a subroutine, build a new symtree/symbol in the current name
space.
I have not understood why this is happening yet, in spite of hanging
diagnostics on both versions of gfc_match_call. The following fixes the
problem and bootstrap/regtests OK:
Index: gcc/fortran/module.c
===================================================================
*** gcc/fortran/module.c (revision 126214)
--- gcc/fortran/module.c (working copy)
*************** read_module (void)
*** 3574,3580 ****
if (st != NULL)
{
/* Check for ambiguous symbols. */
! if (st->n.sym != info->u.rsym.sym)
st->ambiguous = 1;
info->u.rsym.symtree = st;
}
--- 3574,3581 ----
if (st != NULL)
{
/* Check for ambiguous symbols. */
! if (st->n.sym != info->u.rsym.sym
! && !st->n.sym->attr.generic)
st->ambiguous = 1;
info->u.rsym.symtree = st;
}
However, I want to understand the necessity of this before submitting it. I
think that I am 24 hours away from this.
Paul
PS Michael, that's a very pretty fortran OO example - thanks for the report.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32526