https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93678
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #1 from kargl at gcc dot gnu.org --- Reduced testcase. Have no idea if original code and/or this testcase is valid Fortran. My suspicion is that the original code is invalid. module mo_a implicit none type t_b integer n contains procedure :: unpackint => b_unpackint procedure :: unpackbytes => b_unpackbytes end type t_b contains function b_unpackbytes(me, s) result(res) class(t_b), intent(inout) :: me character, intent(in) :: s(:) character, pointer :: res(:) res => null() if (len(s) == 1) me%n = 42 end function b_unpackbytes subroutine b_unpackint(me, val) class(t_b), intent(inout) :: me integer, intent(out) :: val character :: c(1) c = transfer(val, c) val = transfer(me%unpackbytes(c), val) end subroutine b_unpackint end module mo_a