This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/81898] [7/8 Regression] Issue with polymorphic container class


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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-08-20
                 CC|                            |janus at gcc dot gnu.org
            Summary|Issue with polymorphic      |[7/8 Regression] Issue with
                   |container class             |polymorphic container class
     Ever confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org ---
Here is a further reduced and modified version of the original test case:


module AModule

  implicit none

  type :: BType
  end type

  type:: AType
    class(BType), allocatable :: obj
    type(BType), pointer  :: bobj
  contains
    procedure :: a_rd
  end type

  contains

    subroutine a_rd(this)
      ! -- dummy
      class(AType) :: this
      write(*,*) 'in a_rd'
    end subroutine

end module


program main
  use AModule
  implicit none
  class(AType), allocatable, target :: a

  allocate(a)

  allocate(a%obj)
  a%bobj => a%obj

  write(*,*) 'calling a_rd'
  call a%a_rd()

end



It compiles and runs file with gfortran 6 and earlier, but fails with a runtime
segfault with gfortran 7 and trunk. Indeed looks like a wrong-code regression.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]