public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/31001] PACK crashes on zero-sized arrays Date: Sat, 03 Mar 2007 14:24:00 -0000 [thread overview] Message-ID: <20070303142404.22245.qmail@sourceware.org> (raw) In-Reply-To: <bug-31001-6318@http.gcc.gnu.org/bugzilla/> ------- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-03-03 14:24 ------- Patch below, currently regtesting. Index: libgfortran/intrinsics/pack_generic.c =================================================================== --- libgfortran/intrinsics/pack_generic.c (revision 122504) +++ libgfortran/intrinsics/pack_generic.c (working copy) @@ -93,15 +93,19 @@ index_type count[GFC_MAX_DIMENSIONS]; index_type extent[GFC_MAX_DIMENSIONS]; + int zero_sized; index_type n; index_type dim; index_type nelem; dim = GFC_DESCRIPTOR_RANK (array); + zero_sized = 0; for (n = 0; n < dim; n++) { count[n] = 0; extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound; + if (extent[n] <= 0) + zero_sized = 1; sstride[n] = array->dim[n].stride * size; mstride[n] = mask->dim[n].stride; } @@ -154,6 +158,8 @@ const GFC_LOGICAL_4 *m = mptr; total = 0; + if (zero_sized) + m = NULL; while (m) { -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu dot | |org GCC host triplet|i686-pc-linux-gnu | Keywords| |patch, wrong-code Known to fail| |4.1.2 4.2.0 4.3.0 Last reconfirmed|2007-03-03 10:38:13 |2007-03-03 14:24:04 date| | Target Milestone|--- |4.2.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31001
next prev parent reply other threads:[~2007-03-03 14:24 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-02-28 22:16 [Bug libfortran/31001] New: " anlauf at gmx dot de 2007-03-03 10:38 ` [Bug libfortran/31001] " fxcoudert at gcc dot gnu dot org 2007-03-03 14:24 ` fxcoudert at gcc dot gnu dot org [this message] 2007-03-03 16:38 ` fxcoudert at gcc dot gnu dot org 2007-03-04 7:20 ` [Bug libfortran/31001] [4.1/4.2 only] " fxcoudert at gcc dot gnu dot org 2007-03-05 4:11 ` mmitchel at gcc dot gnu dot org 2007-03-08 12:35 ` fxcoudert at gcc dot gnu dot org 2007-03-14 10:49 ` [Bug libfortran/31001] [4.1 " fxcoudert 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=20070303142404.22245.qmail@sourceware.org \ --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).