https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82996
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- I see the problems on all gfortran supporting finalization (4.9 up to trunk 8.0), except the ICEs that are no longer present on recent trunk. The change occurred between revisions r247817 (2017-05-09, ICE) and r248367 (2017-05-23, compiles). In top of that the code in comment 2 executes without segfault.