https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120355
--- Comment #1 from anlauf at gcc dot gnu.org --- Workaround: don't use the result clause in the external function, e.g. integer function s(x) implicit none integer, intent(in) :: x s = 1 - x end function s