The code example I provided conforms to current standard Fortran whereas gfortran
has certain gaps in support toward the standard and there is an outstanding list of support requests at GCC Bugzilla.
If you seek “gfortran compataiility,” the comment in this thread applies. gfortran needs a growing team of dedicated FOSS volunteers to contribute to its development and resolve bugs. So the users who rely on gfortran
should seriously consider joining GCC as FOSS volunteers and/or encourage others to do the same. Otherwise, gfortran
faces the risk and fate of g77
and g95
.