https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72709
--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- This works: program show_problem implicit none character(len=:), dimension(:), allocatable :: text allocate(character(len=3) :: text(3)) text(1) = 'abc' text(2) = '123' print *,text(1) end program show_problem so it is the derived type that causes the problem.