I am currently working to debug a subroutine of some software that my boss has written back in the 90s. There seems to be a floating-point exception that occurs in a do loop
There seems to be two questions here. Lets try to answer each one.
1. Why does the new GFortran version print such a message
Since the Fortran 2008 standard requires that execution of the STOP and ERROR STOP statements outputs a list of currently signaling FP exceptions (if such a thing is supported by the system), GFortran follows this as of GFortran version 4.9. See https://gcc.gnu.org/ml/fortran/2013-06/msg00072.html .
2. Why does my code trigger this exception, and why does it only happen with the new GFortran version
Very likely, the exception was signalling before as well, but since it wasn't printed at the STOP statement you weren't aware of it. Since the example you have showed isn't self-contained (I can't compile and test it), I can only recommend you try the usual debugging command line options such as "-fcheck=all, -ffpe-trap=invalid,zero,overflow -g -Wall -Wextra -Werror -pedantic", check running your program under valgrind etc.