[fortran,patch] Don't write common more than once in a module file (PR 30285)

FX Coudert fxcoudert@gmail.com
Sat Nov 10 09:32:00 GMT 2007


PR 30285 is about deeply nested module files containing commons,  
which take a huge amount of memory when they're read back (and loads  
of disk space, but that's not so much of a problem). This commonly  
happens with MPICH and openmpi, and leads some people to run out of  
memory when compiling mpi-enabled programs.

The problem is that we write each common name more than once (a  
number of times that grows exponentially with the nesting). I tried  
to change the way we load modules, to avoid creating these duplicate  
symbols, but the diagnostics code for commons with binding labels  
requires this creation of multiple symbols, so I went for something  
that is a bit of a hack: we get rid of duplicate common names  
(specificaly: duplicate pairs of name and binding label) when writing  
the module files, by creating a list of them as we go through and  
checking them against that list.

I agree it's not a perfect solution, but I couldn't make it work in  
any other way (see the PR for a tentative patch), and I think it's  
worth committing now, as it's a serious problem for our users.  
Regtested on x86_64-linux, OK to commit?

FX



:ADDPATCH fortran:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30285.ChangeLog
Type: application/octet-stream
Size: 226 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071110/6b8224d4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr30285.diff
Type: application/octet-stream
Size: 2387 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071110/6b8224d4/attachment-0001.obj>


More information about the Fortran mailing list