https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98573
--- Comment #1 from David Neill Asanza <davidhneill at gmail dot com> --- Removing the derived type container triggers a segfault. $ cat segfault.f90 module foo contains subroutine store1(arr, val) class(*), allocatable, intent(out) :: arr(:) class(*), intent(in) :: val(:) arr = val end subroutine store1 subroutine store2(arr, val) class(*), allocatable, intent(out) :: arr(:) class(*), intent(in) :: val(:) allocate(arr, source=val) end subroutine store2 end module foo program prog use foo class(*), allocatable :: arr(:) call store1(arr, [1, 2, 3]) ! SEGFAULT call store2(arr, [1, 2, 3]) ! NO PROBLEM end program $ gfortran -g -Wall -Wextra minimal.f90 $ ./a.out Program received signal SIGSEGV: Segmentation fault - invalid memory reference.