https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98141
Bug ID: 98141
Summary: Segmentation fault with empty string sourced
allocation
Product: gcc
Version: 9.3.0
Status: UNCONFIRMED
Severity: normal
Priori
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98141
--- Comment #1 from David Neill Asanza ---
Here are even shorter examples:
$ cat short01.f90
program short01
class(*), allocatable :: a, b, c
character(len=0) :: s
allocate(a, source=s) !! No problem
allocate(character(len=0)::b)
all
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98573
Bug ID: 98573
Summary: Dynamic type lost on assignment
Product: gcc
Version: 9.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98573
--- Comment #1 from David Neill Asanza ---
Removing the derived type container triggers a segfault.
$ cat segfault.f90
module foo
contains
subroutine store1(arr, val)
class(*), allocatable, intent(out) :: arr(:)
class(*), intent(in) :
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98573
--- Comment #2 from David Neill Asanza ---
Created attachment 49905
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49905&action=edit
Minimal reproducer for segmentation fault.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98573
--- Comment #3 from David Neill Asanza ---
A related case when the array is 0-length. In this case, the dynamic type is
lost in both assignment and sourced allocation.
$ cat type_lost_0_length.f90
module foo
type, public:: box
class(*), a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98573
--- Comment #4 from David Neill Asanza ---
Created attachment 49906
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49906&action=edit
Reproducer for 0-length case.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98573
--- Comment #6 from David Neill Asanza ---
Thanks for looking into this Paul.
I'm looking forward to having this fixed. :)