[Patch, gfortran] PR17917 - gfortran ICE on "equivalence"

Paul Thomas paulthomas2@wanadoo.fr
Thu Aug 18 10:27:00 GMT 2005


:ADDPATCH <fortran>:

This version of the fix for module equivalences builds upon the patch 
posted in http://gcc.gnu.org/ml/fortran/2005-06/msg00307.html

This time it works correctly! The multiple local equivalences are 
eliminated and are replaced by single external equivalences.

The patch consists of four elements:

(i) The new functions in module.c have been ported from g95. write_equiv 
has been modified to attach a name to each module equivalence. I have 
chosen <module_name>.eq.<number>.
(ii) trans-decl.c has been modified to prevent equivalenced symbols that 
have a backend_decl from being caught by the assertion in 
gfc_create_module_variable.
(iii) The module equivalences have a name, which triggers the creation 
of a gfc_common_header. This, when passed to create common, ensures that 
the equivalences are treated in the same way as common blocks; ie. they 
become external and public.
(iv) gfc_equiv has the module field added in gfortran.h

The test case tests the equivalences are transmitted between procedures, 
that renamed equivalence symbols are dealt with and that common block 
equivalences are not broken by the patch. I have tested that the loader 
does the right thing when the module and the subroutine foo are compiled 
separately from the main program; ie. that the equivalences really are 
external.

Bubblestrapped and regtested on FC3/Athlon 1700.

OK for mainline and 4.0?

Paul T

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: module_equivalences_patch.txt
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050818/9e664c72/attachment.txt>


More information about the Fortran mailing list