The code function foo(fp, m) result(ft)real , intent(in) :: fp(m) integer, intent(in) :: m integer :: m ft = 0.0 end function foo declares "m" twice, but GNU Fortran (GCC) 7.0.1 20170122 (experimental) on Windows 10 compiles it. If fp(m) is replace by fp, gfortran catches the error. Thanks to the gfortran developers for their efforts.