https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92586
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pault at gcc dot gnu.org --- Comment #11 from Paul Thomas <pault at gcc dot gnu.org> --- (In reply to G. Steinmetz from comment #5) > A simplification might be : > > > $ cat z1.f90 > program p > type t > integer, allocatable :: a > end type > type t2 > type(t) :: b > end type > type t3 > type(t2) :: c > end type > contains > function g(x) > class(t2) :: x > type(t) :: g(2) > end > function f(x) > class(t3) :: x > type(t) :: f(2) > f = g(x%c) > end > end > > > $ gfortran-10-20191215 -c z1.f90 > gimplification failed: > &parm.14 <addr_expr 0x7f89646c6e40 The tree dump contains the obviously wrong: ....snip.... struct array01_t parm.15; ....snip.... if ((&parm.15).a != 0B) { __builtin_free ((void *) (&parm.15).a); (&parm.15).a = 0B; } which is why changing allocatable to pointer, for example, works. Now to find out where that is happening. Paul