https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129133
--- Comment #4 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
Further reduction of testcase in comment#1:
program test
implicit none
type ptr_wrapper
integer, pointer :: p(:, :)
end type
type(ptr_wrapper) a(1)
integer, target :: iarray(4)
integer :: i
forall(i=1:1) a(i)%p(1:4,1:1) => iarray
end
The rank remapping is essential for the ICE.
