[Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE

pault at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Mar 8 20:35:00 GMT 2008



------- Comment #4 from pault at gcc dot gnu dot org  2008-03-08 20:34 -------
(In reply to comment #3)
> (In reply to comment #2)

> Oddly, reverting my patch for 32103 by hand does not get rid of the fault:) I
> am beginning to think that we need fixups for the common block references to
> the symbols... Anyway, I'll make a start on it.
> 

That turns out to be spot on.  The patch below is going on to regtest in just a
moment.

Paul

Index: gcc/fortran/module.c
===================================================================
*** gcc/fortran/module.c        (revision 132798)
--- gcc/fortran/module.c        (working copy)
*************** mio_symtree_ref (gfc_symtree **stp)
*** 2310,2315 ****
--- 2310,2321 ----
          p->u.rsym.symtree->n.sym = p->u.rsym.sym;
          p->u.rsym.symtree->n.sym->refs++;
          p->u.rsym.referenced = 1;
+
+         /* If the symbol is PRIVATE and in COMMON, load_commons will
+            generate a fixup symbol, which must be associated.  */
+         if (p->fixup)
+           resolve_fixups (p->fixup, p->u.rsym.sym);
+         p->fixup = NULL;
        }

        if (p->type == P_UNKNOWN)


-- 


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



More information about the Gcc-bugs mailing list