https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119948
--- Comment #14 from kargls at comcast dot net --- HI Paul, The difference in my pr119948_1.f90 and pr119948_2.f90 is that the former is Damian's testcase with a result-name while latter does not use result-name so the function-name is the result variable. Both tests use a 'module procedure' construct. I did look at your patch (but obviously did not test it) and thought it would catch the latter. Your patch does catch issues with subroutine while my original patch does not deal with subroutines.