https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61767
--- Comment #4 from janus at gcc dot gnu.org --- Here is a slightly less verbose version of the test case which runs into the same ICE: module Communicator_Form implicit none type :: CommunicatorForm contains final :: Finalize end type type :: MessageTemplate type ( CommunicatorForm ), pointer :: Communicator end type contains subroutine Finalize ( C ) type ( CommunicatorForm ) :: C end subroutine end module program p use Communicator_Form implicit none class ( MessageTemplate ), pointer :: M end The ICE is due to this assert ... gcc_assert (ancestor_wrapper && ancestor_wrapper->ref == NULL && ancestor_wrapper->expr_type == EXPR_VARIABLE); ... where ancestor_wrapper is NULL.