https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88399
Harald Anlauf <anlauf at gmx dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gmx dot de --- Comment #2 from Harald Anlauf <anlauf at gmx dot de> --- AFAICT the problem seems fixed since 7.1, it is still present at 6.1. Looking at the tree dump, one can see that gfortran <= 6 initialized the derived type even when the malloc failed. It is now protected by an appropriate if/goto. I recommend to update to 7.1+