https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96018
--- Comment #6 from martin.schlipf at damnthespam dot com --- Sorry, if that has not been clear enough. I already know how to work around this issue. You can simply check the error flag [if (ierr /= 0) return]. What I do not understand is why gfortran removes the call to the first function when I switch on the optimization.