The following code worked for version 4.3 and 4.4 as of 9-28: MODULE HDF5 USE H5GLOBAL END MODULE HDF5 MODULE H5GLOBAL IMPLICIT NONE INTEGER :: H5P_flags INTEGER :: H5P_DEFAULT_F EQUIVALENCE(H5P_flags, H5P_DEFAULT_F) END MODULE H5GLOBAL PROGRAM fortranlibtest USE HDF5 IMPLICIT NONE INTEGER :: ii ii = H5P_DEFAULT_F END PROGRAM fortranlibtest
The current version of 4.4 and 4.3 (Nov. 11) fails to compile the code with the error: gfortran43 H5f90global.o HDF5.o fortranlib_test.o -o test fortranlib_test.o(.text+0x19): In function `MAIN__': : undefined reference to `__h5global_MOD_h5p_default_f' collect2: ld returned 1 exit status *** Error code 1 4.2 compiles the code without a problem. NOTE: (1) If I remove the line EQUIVALENCE(H5P_flags, H5P_DEFAULT_F) it compiles fine. (2) If I move the contents of H5GLOBAL into the HDF5 module i.e. MODULE HDF5 IMPLICIT NONE INTEGER :: H5P_flags INTEGER :: H5P_DEFAULT_F EQUIVALENCE(H5P_flags, H5P_DEFAULT_F) END MODULE HDF5 it compiles fine. -- Summary: equivalence and nested modules broken Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: brtnfld at hdfgroup dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38171