public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug demangler/102370] New: Runtime failure with allocatable component of allocatable parent and MOVE_ALLOC
@ 2021-09-16 15:16 longb at cray dot com
  2021-09-17 20:15 ` [Bug libfortran/102370] " anlauf at gcc dot gnu.org
  2021-09-17 20:40 ` longb at cray dot com
  0 siblings, 2 replies; 3+ messages in thread
From: longb at cray dot com @ 2021-09-16 15:16 UTC (permalink / raw)
  To: gcc-bugs

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libfortran/102370] Runtime failure with allocatable component of allocatable parent and MOVE_ALLOC
  2021-09-16 15:16 [Bug demangler/102370] New: Runtime failure with allocatable component of allocatable parent and MOVE_ALLOC longb at cray dot com
@ 2021-09-17 20:15 ` anlauf at gcc dot gnu.org
  2021-09-17 20:40 ` longb at cray dot com
  1 sibling, 0 replies; 3+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-17 20:15 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-09-17
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1

--- Comment #1 from anlauf at gcc dot gnu.org ---
Are you sure the code is valid?

Even Intel crashes when it reaches the print.
Adding

  print *, allocated (temp)

before

  print *, temp%val

print for both:

 F

So the final print looks invalid.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libfortran/102370] Runtime failure with allocatable component of allocatable parent and MOVE_ALLOC
  2021-09-16 15:16 [Bug demangler/102370] New: Runtime failure with allocatable component of allocatable parent and MOVE_ALLOC longb at cray dot com
  2021-09-17 20:15 ` [Bug libfortran/102370] " anlauf at gcc dot gnu.org
@ 2021-09-17 20:40 ` longb at cray dot com
  1 sibling, 0 replies; 3+ messages in thread
From: longb at cray dot com @ 2021-09-17 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Bill Long <longb at cray dot com> ---
I've sent a question back to the original submitter.  On completion, the first
argument to MOVE_ALLOC is unallocated, so it does look suspicious to be
printing a component of an unallocated structure.  I'll update when I get a
revised test case.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-17 20:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 15:16 [Bug demangler/102370] New: Runtime failure with allocatable component of allocatable parent and MOVE_ALLOC longb at cray dot com
2021-09-17 20:15 ` [Bug libfortran/102370] " anlauf at gcc dot gnu.org
2021-09-17 20:40 ` longb at cray dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).