This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE
- 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: 8 Mar 2008 20:34:40 -0000
- Subject: [Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE
- References: <bug-35474-10259@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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