Thanks @dave - I had a suspicion changing one of the compiler flags might fix the failing internal test and removing -ffast-math seems to do the trick on my system.
So hopefully no more need for the patch, just:
gfortran -c -fno-backslash -fno-f2c -O3 -ffpe-summary=none -Wuninitialized -std=legacy -fall-intrinsics LCModel.f
gfortran LCModel.o -o lcmodel
works for me. Removing the fast-math flag doesn’t seem to hurt performance and O3 optimisation got the loop benchmark down to 17 seconds
Martin