FTN95 8.05 outputs an erroneous result for the first run of the DO loop and then aborts with an X87 stack fault when the following program is compiled and run in 32-bit mode. There is no error with /64. I am not sure whether the bug is directly related to the use of the F2008 function log_gamma. The bug goes away if log_gamma is replaced by log.
program xloggam
implicit none
real :: p,q(2),x
integer :: ifault,i
data p/2.0/, q /10.0,20.0/
do i=1,2
x = log_gamma(p)+log_gamma(q(i))-log_gamma(p+q(i))
write(*,10)q(i),x
end do
10 format(F8.0,ES16.8)
end program
If the unused variable ifault is removed, the output for i = 1 is changed, although still incorrect.