public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mathewc at nag dot co.uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/49885] New: Segmentation fault when writing to an automatic character array
Date: Thu, 28 Jul 2011 10:58:00 -0000	[thread overview]
Message-ID: <bug-49885-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49885

           Summary: Segmentation fault when writing to an automatic
                    character array
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mathewc@nag.co.uk


> uname -a
Linux tiree.nag.co.uk 2.6.27.41-170.2.117.fc10.x86_64 #1 SMP Thu Dec 10
10:36:29 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

> gfortran --version
GNU Fortran (GCC) 4.7.0 20110723 (experimental)

> cat gf.f90
subroutine s(nb)
  integer :: nb
  character (max(80,nb)) :: bad_rec(1)
  write (bad_rec,'(I1)') 0
end
call s(10)
end

> gfortran gf.f90 ; ./a.out
Segmentation fault

Note that the program executes fine if declaration for bad_rec is changed to
any of:

  character (nb) :: bad_rec(1)
  character (max(80,nb)) :: bad_rec


             reply	other threads:[~2011-07-28 10:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28 10:58 mathewc at nag dot co.uk [this message]
2011-07-28 12:52 ` [Bug libfortran/49885] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
2011-07-28 12:59 ` [Bug fortran/49885] " burnus at gcc dot gnu.org
2011-07-28 14:03 ` burnus at gcc dot gnu.org
2011-07-28 14:07 ` burnus at gcc dot gnu.org
2011-07-28 14:40 ` domob at gcc dot gnu.org
2011-07-29 17:00 ` domob at gcc dot gnu.org
2011-08-01 14:45 ` rguenth at gcc dot gnu.org
2011-08-02 17:55 ` domob at gcc dot gnu.org
2011-08-02 20:11 ` domob at gcc dot gnu.org
2011-08-02 20:15 ` domob at gcc dot gnu.org
2011-08-03  9:37 ` domob at gcc dot gnu.org
2011-08-03  9:42 ` domob 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-49885-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).