[Bug fortran/65024] [4.9/5 Regression] [OOP] ICE concerning unlimited polymorphic pointer

pault at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 16 18:53:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65024

--- Comment #10 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to homgran from comment #9)
> (In reply to Dominique d'Humieres from comment #8)
> > > > AFAICT the ICE for the original test is as old as the first implementation
> > > > of unlimited polymorphism.
> > >
> > > In that case, should we remove the '[4.9/5 Regression]' tag from the summary title?
> > 
> > Please don't do that.
> > 

I agree.

If the type 'T' is declared in the main programme the problem goes away. The
ICE occurs in the course of nullifying the vptr field. It appears that this
latter has no backend_decl; hence the ICE. I think that this implies that
something is going wrong with building the structure for the class component
but I haven't yet found why being use associated makes a difference.

This works fine:
MODULE X
  TYPE T
    CLASS(*), pointer :: info
  END TYPE
END MODULE

PROGRAM P
  use x
  class(T), target, allocatable :: tgt
CONTAINS
  SUBROUTINE BUG
    USE X
    CLASS(T), pointer :: e
   e=>tgt
  END SUBROUTINE

  SUBROUTINE NEXT
    USE X
    CLASS (T), pointer :: e
  END SUBROUTINE
END

Cheers

Paul



More information about the Gcc-bugs mailing list