public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/48066] [4.3/4.4/4.5/4.6 Regression] Segfault with SUM of zero-sized array
Date: Fri, 11 Mar 2011 11:29:00 -0000	[thread overview]
Message-ID: <bug-48066-4-tO3ejnCAMf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48066-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-11 11:28:57 UTC ---
Draft patch:

--- a/libgfortran/m4/ifunction.m4
+++ b/libgfortran/m4/ifunction.m4
@@ -132,7 +132,10 @@ name`'rtype_qual`_'atype_code (rtype * const restrict
retarray,
 ')dnl
 define(START_ARRAY_BLOCK,
 `      if (len <= 0)
-         *dest = '$1`;
+         {
+           if (dest)
+             *dest = '$1`;
+         }
        else
          {
            for (n = 0; n < len; n++, src += delta)
@@ -313,7 +316,10 @@ void
 ')dnl
 define(START_MASKED_ARRAY_BLOCK,
 `      if (len <= 0)
-         *dest = '$1`;
+         {
+           if (dest)
+             *dest = '$1`;
+         }
        else
          {
            for (n = 0; n < len; n++, src += delta, msrc += mdelta)
--- a/libgfortran/m4/ifunction_logical.m4
+++ b/libgfortran/m4/ifunction_logical.m4
@@ -159,7 +159,10 @@ name`'rtype_qual`_'atype_code (rtype * const restrict
retarray,
 ')dnl
 define(START_ARRAY_BLOCK,
 `        if (len <= 0)
-         *dest = '$1`;
+         {
+           if (dest)
+             *dest = '$1`;
+         }
        else
          {
            for (n = 0; n < len; n++, src += delta)


  parent reply	other threads:[~2011-03-11 11:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 23:04 [Bug fortran/48066] New: " burnus at gcc dot gnu.org
2011-03-10 23:09 ` [Bug fortran/48066] " burnus at gcc dot gnu.org
2011-03-10 23:14 ` dominiq at lps dot ens.fr
2011-03-10 23:19 ` burnus at gcc dot gnu.org
2011-03-10 23:35 ` burnus at gcc dot gnu.org
2011-03-10 23:36 ` burnus at gcc dot gnu.org
2011-03-11 11:29 ` burnus at gcc dot gnu.org [this message]
2011-03-12  9:38 ` burnus at gcc dot gnu.org
2011-03-12 10:11 ` tkoenig at gcc dot gnu.org
2011-03-12 10:16 ` tkoenig at gcc dot gnu.org
2011-03-12 17:22 ` tkoenig at gcc dot gnu.org
2011-03-12 21:46 ` tkoenig at gcc dot gnu.org
2011-03-12 22:50 ` [Bug fortran/48066] [4.3/4.4/4.5 " tkoenig at gcc dot gnu.org
2011-03-12 23:18 ` tkoenig at gcc dot gnu.org
2011-03-13 20:58 ` tkoenig at gcc dot gnu.org
2011-03-13 20:59 ` tkoenig 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-48066-4-tO3ejnCAMf@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).