In order to not trigger a compilation cascade, gfortran only overwrites a .mod file when its MD5 sum has changed. Seemingly, the mod-file versioning has the side effect that the MOD file is not overwritten if there are no other changes but the version number, which causes the version-mismatch error. I'm not sure whether this is a problem between 4.x and 4.(x+1) versions as the .mod file probably has changed in an incompatible way (different MD5 sum), but still it is annoying. Expected: If the version number does not match, the file is written nevertheless. (Maybe the error also occurs at a different place, I have not yet checked the source code.)
Confirmed. This scared the pants off me by apparently causing regressions and then a build failure in libgomp. Cheers Paul
Created attachment 17366 [details] Draft patch (untested, not even compiled)
Subject: Bug 39309 Author: burnus Date: Fri Feb 27 06:44:59 2009 New Revision: 144461 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144461 Log: 2009-02-27 Tobias Burnus <burnus@net-b.de> PR fortran/39309 * module.c (read_md5_from_module_file): Include mod version in had-changed test. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c
Subject: Bug 39309 Author: burnus Date: Fri Feb 27 07:45:47 2009 New Revision: 144462 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144462 Log: 2009-02-27 Tobias Burnus <burnus@net-b.de> PR fortran/39309 * module.c (read_md5_from_module_file): Add missing quote. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c
FIXED on the trunk.