[Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE
--- Comment #5 from pault at gcc dot gnu dot org 2008-03-09 19:39 --- Subject: Bug 35474 Author: pault Date: Sun Mar 9 19:38:51 2008 New Revision: 133063 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133063 Log: 2008-03-09 Paul Thomas <[EMAIL PROTECTED]> PR fortran/35474 * module.c (mio_symtree_ref): After providing a symbol for a missing equivalence member, resolve and NULL the fixups. 2008-03-09 Paul Thomas <[EMAIL PROTECTED]> PR fortran/35474 * gfortran.dg/module_commons_2.f90 : New test. Added: trunk/gcc/testsuite/gfortran.dg/module_commons_2.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35474
[Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE
--- 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
[Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE
--- Comment #3 from pault at gcc dot gnu dot org 2008-03-08 15:11 --- (In reply to comment #2) > Paul, do you have an idea? > > The ICE happens when reading the .mod for p->u.wsym.sym->name == "i" in > free_pi_tree: > if (p->fixup != NULL) > gfc_internal_error ("free_pi_tree(): Unresolved fixup"); > > I got somehow lost in module.c when trying to track 'fixup'. See comment 1 for > your patch which caused the regression. Still, I cannot see anything which is > obviously wrong. > > Just for fun, I set p->fixup = NULL in mio_symtree_ref (see your patch), then > one gets the error that COMMON 'c' does not exist. > I have started work on this, as a bit of light relief. Doing the latter, prevents any members from being added to the COMMON and so it fails to come into existence. 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. Paul -- pault at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |pault at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2008-03-05 15:08:55 |2008-03-08 15:11:14 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35474
[Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE
--- Comment #2 from burnus at gcc dot gnu dot org 2008-03-06 19:03 --- Paul, do you have an idea? The ICE happens when reading the .mod for p->u.wsym.sym->name == "i" in free_pi_tree: if (p->fixup != NULL) gfc_internal_error ("free_pi_tree(): Unresolved fixup"); I got somehow lost in module.c when trying to track 'fixup'. See comment 1 for your patch which caused the regression. Still, I cannot see anything which is obviously wrong. Just for fun, I set p->fixup = NULL in mio_symtree_ref (see your patch), then one gets the error that COMMON 'c' does not exist. -- burnus at gcc dot gnu dot org changed: What|Removed |Added CC||pault at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35474
[Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE
--- Comment #1 from burnus at gcc dot gnu dot org 2008-03-05 15:32 --- Possibly caused by the following patch. It fails for me around 30/31 May. Patch: http://gcc.gnu.org/ml/fortran/2007-05/msg00504.html r125216 | pault | 2007-05-31 09:45:50 +0200 (Thu, 31 May 2007) | 13 lines 2007-05-31 Paul Thomas <[EMAIL PROTECTED]> PR fortran/32103 * module.c (mio_symtree_ref): If an equivalence group member is not used, give it a hidden symbol and set the pointer_info. (load_equiv): Only free the equivalence if none of the members are used. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35474
[Bug fortran/35474] [4.3/4.4 regression] Reading module file with COMMON and EQUIVALENCE
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2008-03-05 15:08:55 date|| Target Milestone|--- |4.3.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35474