public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "highegg at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/32217] New: gfortran segfaults on UNPACK with zero-sized arrays Date: Tue, 05 Jun 2007 07:55:00 -0000 [thread overview] Message-ID: <bug-32217-14211@http.gcc.gnu.org/bugzilla/> (raw) The following valid program ends up in a segfault at the UNPACK function call with gfortran 4.3.0 20070605 (experimental binaries from gcc site): program bug_report implicit none integer,parameter:: rp = kind(1.d0),na = 6 real(rp),allocatable:: hhe(:,:,:),hhc(:,:,:),dv(:) integer:: nhh,ndv nhh = 0 allocate(hhe(nhh,2,2)) ndv = 2*na + count(hhe /= 0) allocate(hhc(nhh,2,2),dv(ndv)) print *,'OK' hhc = unpack(dv(2*na+1:),hhe /= 0._rp,0._rp) print *,'OK' end program Also reproducible with gfortran 4.2.0 on x86_64 and IA64. Although the F2003 standard does not explicitly cover zero-sized arguments to UNPACK; however, I think that from the text it follows logically that the result should be zero-sized array. With nhh > 0, the program is working fine. cheers to all gfortran developers, Jaroslav Hajek -- Summary: gfortran segfaults on UNPACK with zero-sized arrays Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: highegg at gmail dot com GCC host triplet: i386-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32217
next reply other threads:[~2007-06-05 7:55 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-06-05 7:55 highegg at gmail dot com [this message] 2007-06-05 17:30 ` [Bug fortran/32217] segfaults (at runtime) " burnus at gcc dot gnu dot org 2007-06-16 8:09 ` tkoenig at gcc dot gnu dot org 2007-06-22 22:16 ` tkoenig at gcc dot gnu dot org 2007-07-08 15:42 ` dominiq at lps dot ens dot fr 2007-07-08 21:30 ` patchapp at dberlin dot org 2007-07-08 22:20 ` tkoenig at gcc dot gnu dot org 2007-07-08 22:23 ` tkoenig at gcc dot gnu dot 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-32217-14211@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: linkBe 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).