https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123948
--- Comment #2 from anlauf at gcc dot gnu.org ---
Reduced testcase:
module m0
implicit none
type y
integer::x
end type y
interface
function x2() result(r)
integer::r
end function x2
end interface
procedure (x2),pointer :: p
contains
function z() result(p)
procedure (y2),pointer :: p
type(y) :: b
p=>y2
b=p()
if (b%x/=1) print *,3 ! <<< ICE
end function z
function y2() result(r)
type(y) :: r
r%x=1
end function y2
end module m0
