https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109865
--- Comment #9 from GARY.WHITE at ColoState dot edu <Gary.White at ColoState dot edu> --- Another clue. I'm seeing the same bug in gfortran-13, except that I have to use -O0 for both cases of mc11ad.f90 in or out of the contains statement. Similarly, if I put the set of va09ad.f90 routines in a module, I have to use -O0 to get correct answers. -O3 causes a bug with va09ad.f90 in a module as well.