[Patch, fortran] PR32103 - Module with equivalence draws "unsatisfied reference"

Paul Richard Thomas paul.richard.thomas@gmail.com
Wed May 30 14:06:00 GMT 2007


:ADDPATCH fortran:

This problem came about because module equivelance groups with one or
more unused members were cleared.  This being so, the remaining
members referenced variables in the module, rather than members of a
union representing the equivalence.  Even if that were not the case,
the missing, unused members carry offset information that is essential
to obtain the correct alignment.

The fix detects unused equivalence members, gives them a symtree with
a "unique name" that hides the symbol.  Whilst completely unused
equivalence groups are now cleared, the hidden symbols remain.  I was
unable to find a convenient, siple way of clearing the hidden symbols
and so decided to ignore them, since they get cleared up at the end of
compilation.

The testcase is an embellishment of the reporter's.

Regtested on x86_ia64/FC5 - OK for trunk?

Paul

2007-05-30  Paul Thomas  <pault@gcc.gnu.org>

	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.

2007-05-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/32103
	* gfortran.dg/module_equivalence_3.f90: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr32103.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070530/061b4df2/attachment.ksh>


More information about the Gcc-patches mailing list