!================================================== ! ! Compile and run using: ! ifort optional-bug.f90 ! ./a.out !================================================== program option implicit none real, target :: at, dt real, pointer :: ap, dp at = 10; dt = 40 ap => at dp => dt dp => null() ! Uncommenting this line crashes print*, 'before ap, dp', ap, dp call mysub(ap, dp) print*, 'after ap, dp', ap, dp contains subroutine mysub(aa, dd) real :: aa real :: dd aa = 1000.*aa print*, ' Inside mysub aa = ', aa end subroutine mysub end program option