public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "longb at cray dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug demangler/102370] New: Runtime failure with allocatable component of allocatable parent and MOVE_ALLOC
Date: Thu, 16 Sep 2021 15:16:42 +0000	[thread overview]
Message-ID: <bug-102370-4@http.gcc.gnu.org/bugzilla/> (raw)

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)

             reply	other threads:[~2021-09-16 15:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 15:16 longb at cray dot com [this message]
2021-09-17 20:15 ` [Bug libfortran/102370] " anlauf at gcc dot gnu.org
2021-09-17 20:40 ` longb at cray dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102370-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).