https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72699
--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fort...@t-online.de> --- No ICE without explicit "implicit none". But of course again with added option -fimplicit-none. $ cat z2.f90 function f() result(z) character(:), allocatable :: z h = z(1) z(1) = h end