re PR fortran/35474 (Reading module file with COMMON and EQUIVALENCE)

2008-03-09  Paul Thomas  <pault@gcc.gnu.org>

	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  <pault@gcc.gnu.org>

	PR fortran/35474
	* gfortran.dg/module_commons_2.f90 : New test.

From-SVN: r133063
This commit is contained in:
Paul Thomas 2008-03-09 19:38:51 +00:00
parent 802e3f8c81
commit 81c109530c
4 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-03-09 Paul Thomas <pault@gcc.gnu.org>
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 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* invoke.texi (Error and Warning Options): Document

View File

@ -2310,6 +2310,12 @@ mio_symtree_ref (gfc_symtree **stp)
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)

View File

@ -1,3 +1,8 @@
2008-03-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35474
* gfortran.dg/module_commons_2.f90: New test.
2008-03-09 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/frame_overflow.adb: Improve portability.

View File

@ -0,0 +1,21 @@
! { dg-do compile }
! Tests the fix for PR35474, in which the PRIVATE statement would
! cause the error Internal Error at (1): free_pi_tree(): Unresolved fixup
! This arose because the symbol for 'i' emanating from the COMMON was
! not being fixed-up as the EQUIVALENCE was built.
!
! Contributed by FX Coudert <fxcoudert@gcc.gnu.org>
!
module h5global
integer i
integer j
common /c/ i
equivalence (i, j)
private
end module h5global
program bug
use h5global
end
! { dg-final { cleanup-modules "h5global" } }