The following program seems to reveal a compiler problem with finalized optional, allocatable polymorphic, intent(out) dummy arguments in a subprogram, which let the executable exit with a segfault on procedure entry(?).
module m implicit none ! finalized derived type type :: derived_type contains final :: finalizer end type contains ! derived type's final subroutine subroutine finalizer(this) type(derived_type), intent(inout) :: this end subroutine end module program p use m implicit none call do_something() ! runtime segfault ! forrtl: severe (174): SIGSEGV, segmentation fault occurred contains ! a subprogram which returns finalized derived type ! important: intent(out), allocatable, optional subroutine do_something(arg) type(derived_type), intent(out), allocatable, optional :: arg end subroutine end program
Note: As far as I checked it, the arguments attributes must not be changed (allocatable to pointer etc.) for the program to exhibit the reported behaviour.