public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "shenpo.dong@compiler-dev.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/96624] New: A segment error occurred when using the reshape function result to assign a variable
Date: Sat, 15 Aug 2020 07:41:18 +0000	[thread overview]
Message-ID: <bug-96624-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 96624
           Summary: A segment error occurred when using the reshape
                    function result to assign a variable
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: shenpo.dong@compiler-dev.com
  Target Milestone: ---

program test
  integer :: a(2,0)
  a = reshape([1,2,3,4], [2,0])
  print *,a
end

with gcc version 10.1.0 (Ubuntu 10.1.0-2ubuntu1~18.04)
Target: aarch64-linux-gnu
i get this message:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0xffff81755e5f
#1  0xffff81754ea7
#2  0xffff818dd687
#3  0xaaaad5c199cc
#4  0xaaaad5c19b1f
#5  0xffff816006df
#6  0xaaaad5c19883
Segmentation fault (core dumped)

But if assign values when declare them,it is correct

  integer :: a(2,0) = reshape([1,2,3,4], [2,0])
  print *,a
end

the result is a blank line

             reply	other threads:[~2020-08-15  7:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15  7:41 shenpo.dong@compiler-dev.com [this message]
2020-08-15 16:11 ` [Bug fortran/96624] A segment fault " kargl at gcc dot gnu.org
2020-08-27 11:50 ` pault at gcc dot gnu.org
2020-08-28  8:03 ` cvs-commit at gcc dot gnu.org
2020-08-28  8:05 ` pault at gcc dot gnu.org

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-96624-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).