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/67564] New: Segfault on sourced allocattion statement with class(*) arrays


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

            Bug ID: 67564
           Summary: Segfault on sourced allocattion statement with
                    class(*) arrays
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: neil.n.carlson at gmail dot com
  Target Milestone: ---

The following example segfaults on the allocate statement.
Using the trunk version of 20150906.

program main
  type :: any_vector
    class(*), allocatable :: x(:)
  end type
  type(any_vector) :: a
  allocate(a%x(2), source=['foo','bar'])
end program

Here's the output:

$ gfortran --version gfortran-bug-20150913A.f90 
GNU Fortran (GCC) 6.0.0 20150906 (experimental)

$ gfortran gfortran-bug-20150913A.f90 
$ ./a.out

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

Backtrace for this error:
#0  0x7F338430C517
#1  0x7F338430CB5E
#2  0x7F338380D95F
#3  0x7F33838677ED
#4  0x400932 in __copy_character_1.3388 at gfortran-bug-20150913A.f90:?
#5  0x400AC6 in MAIN__ at gfortran-bug-20150913A.f90:?
Segmentation fault (core dumped)


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