This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/32526] [4.3 regression] Spurious error: Name 'x' at (1) is an ambiguous reference to 'x' from module 'y'



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]