https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98454
martin <mscfd at gmx dot net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mscfd at gmx dot net --- Comment #9 from martin <mscfd at gmx dot net> --- Problems with default initialisation of function result were fixed with PR45489. The relevant testcase added by this PR is initialization_27.f90 which looks very similar to the reported problem (minus the non-initialised components). After playing around a little bit I think the reason why initialization_27.f90 does not fail in contrast to the reported case (with only unit=-1 as component so as to get valid fortran) is that it has a pointer component. Change t_test to something like type :: t_test integer :: unit = -1 integer, pointer :: p => null() end type and unit gets properly initialised. Without the pointer component I get bogus results.