https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93678
--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- A somewhat smaller test case, which of course does nothing useful, but still reproduces the ICE: module mo_a implicit none type t_b integer :: n = 0 integer :: nr = 0 character, pointer :: buffer(:) => NULL() contains procedure :: unpackbytes => b_unpackbytes end type t_b character :: characterarraymold(1) contains subroutine b_unpackint(me, val) class(t_b), intent(inout) :: me integer, intent(out) :: val val = transfer(me%unpackbytes(transfer(val, characterarraymold)), val) end subroutine b_unpackint function b_unpackbytes(me, bytearraymold) result(res) class(t_b), intent(inout) :: me character, intent(in) :: bytearraymold(:) character, pointer :: res(:) end function b_unpackbytes end module mo_a