https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94788
--- Comment #40 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- Yes, that test case works. Thanks a lot for putting in all the effort! Because we need -fsanitize=address to reliably detect this bug, I have proposed https://gcc.gnu.org/pipermail/gcc-patches/2020-May/544975.html which introduces such a gfortran.dg/asan directory where this can be tested.