This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Bug 78641 - [OOP] ICE on polymorphic allocatable function in array constructor
- From: Damian Rouson <damian at sourceryinstitute dot org>
- To: gfortran <fortran at gcc dot gnu dot org>
- Date: Thu, 1 Dec 2016 18:21:26 -0800
- Subject: Bug 78641 - [OOP] ICE on polymorphic allocatable function in array constructor
- Authentication-results: sourceware.org; auth=none
I just submitted the text below in the above referenced bug report.
Damian
gfortran 6.2.0 and 7.0.0 20161127 report an internal compiler error when an allocatable polymorphic function appears in an array constructor:
$ cat alloc-func-in-array-const.f90
implicit none
type foo
end type
type(foo) :: bar(1)
bar = [f()]
contains
function f() result(foobar)
class(foo), allocatable :: foobar
allocate(foobar,source = foo())
end function
end program
$ gfortran alloc-func-in-array-const.f90
f951: internal compiler error: Segmentation fault: 11
f951: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
________________________________
Damian Rouson, Ph.D., P.E.
President, Sourcery Institute
http://www.sourceryinstitute.org
+1-510-600-2992 (mobile)