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

            Bug ID: 65841
           Summary: Seg fault on intrinsic assignment to allocatable
                    derived type with allocatable component
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at sourceryinstitute dot org

The code below produces a segmentation fault upon the second intrinsic
assignment to an allocatable component of derived type containing an
allocatable component of intrinsic type.

Damian

$ cat realloc_alloc_comp_with_alloc_comp.f90 
type a
  real, allocatable :: f
end type
type b
  type(a), allocatable :: g
end type
type(b) c,d
c%g=a(1.) 
d=c       
d=c       ! seg fault with gfortran 5.0 Build 20150216
end

$ gfortran realloc_alloc_comp_with_alloc_comp.f90 

$ ./a.out

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7F3705ACEBB7
#1  0x7F3705ACDDB0
#2  0x7F3704FD949F
#3  0x7F370502654C
#4  0x400901 in MAIN__ at realloc_alloc_comp_with_alloc_comp.f90:0
Segmentation fault (core dumped)

$ gfortran --version
GNU Fortran (GCC) 5.0.0 20150216 (experimental)

Reply via email to