https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117539
--- Comment #3 from Dominik Gronkiewicz <gronki at gmail dot com> --- Turns out, the behavior of gfortran is consistent with the standard, as it is a gateway open left for implementing garbage collection (details in the discourse thread). So with this development I think this bug can be closed.