https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93678
--- Comment #8 from anlauf at gcc dot gnu.org --- Further reduced: module mo_a implicit none type t_b contains procedure :: unpackbytes => b_unpackbytes end type t_b contains function b_unpackbytes (me) result (res) class(t_b), intent(inout) :: me character :: res(1) end function b_unpackbytes subroutine b_unpackint (me) class(t_b), intent(inout) :: me ! print *, b_unpackbytes (me) ! ok print *, me% unpackbytes () ! ICE end subroutine b_unpackint end module mo_a The "arrayness" of the result res seems to be key.