https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105138
--- Comment #2 from Vladimir Fuka <vladimir.fuka at gmail dot com> --- As mentioned, the correct function is called in case everything is REAL a = floor(5.0) print *, a contains RECURSIVE FUNCTION FLOOR(Z) RESULT(RES) REAL,INTENT(IN) :: Z REAL :: RES if (z>0) then RES = FLOOR(Z - 1) else RES = 0 end if END FUNCTION FLOOR end > gfortran-12 shadow.f90 > ./a.out 0.00000000