[Bug fortran/81898] [7/8 Regression] Issue with polymorphic container class
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Aug 20 19:01:00 GMT 2017
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.
More information about the Gcc-bugs
mailing list