https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102370
Bug ID: 102370 Summary: Runtime failure with allocatable component of allocatable parent and MOVE_ALLOC Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: demangler Assignee: unassigned at gcc dot gnu.org Reporter: longb at cray dot com Target Milestone: --- > cat test.f90 program main implicit none type mytype real :: val integer :: idx type(mytype), allocatable :: next end type mytype type (mytype), allocatable :: top, temp temp = mytype (5.0, 5, temp ) call move_alloc(top, temp%next) call move_alloc(temp, top) print *, temp%val end program main # Cray compiler > ftn test.f90 > ./a.out 5. > gfortran test.f90 > ./a.out Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x7f88d658e49f in ??? #1 0x7f88d72fc5c0 in get_float_string at ../../../cray-gcc-11.2.0-202108140355.9bf1fd589a5c1/libgfortran/io/write_float.def:1110 #2 0x7f88d72fec65 in list_formatted_write_scalar at ../../../cray-gcc-11.2.0-202108140355.9bf1fd589a5c1/libgfortran/io/write.c:1903 #3 0x400c91 in ??? #4 0x401145 in ??? #5 0x7f88d6579349 in ??? #6 0x4007c9 in ??? at ../sysdeps/x86_64/start.S:120 #7 0xffffffffffffffff in ??? Segmentation fault (core dumped)