https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128976
--- Comment #18 from Jürgen Reuter <juergen.reuter at desy dot de> ---
This is a bit shorter reproducer below:
Apparently, the important thing is that the 'core' object
is both polymorphic and a pointer.
module m
implicit none
type :: t1_t
end type t1_t
contains
subroutine s1 (core)
class(t1_t), intent(in), pointer :: core
select type (core)
class is (t1_t)
call s2 (core)
end select
end subroutine s1
subroutine s2 (core)
class(t1_t), intent(inout) :: core
end subroutine s2
end module m