https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86206

--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
No ICE if the module is split into two parts:

! No ICE
module zero_mod
  implicit none
contains
  pure function zero_vec(xx) result(ret)
    real, intent(in) :: xx(:)
    real             :: ret(size(xx))
    integer :: i
    forall (i=1:size(xx)) ret(i) = 0.0
  end function zero_vec
end module zero_mod

module zero_mod2
  use zero_mod
  implicit none
contains
  pure function zero_mat(xx) result(ret)
    real, intent(in) :: xx(:,:)
    real             :: ret(size(xx,1),size(xx,2))
    integer :: j
    forall (j=1:size(xx,2)) ret(:,j) = zero_vec(xx(:,j))
  end function zero_mat
end module

Reply via email to