public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mikael at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/51250] [4.7 Regression] Bug with SUM(,dim,mask)
Date: Thu, 24 Nov 2011 00:37:00 -0000	[thread overview]
Message-ID: <bug-51250-4-rS1LtcT5bK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51250-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> 2011-11-23 23:20:16 UTC ---
(In reply to comment #3)
> I will take care of this one after mid-december.
> 
I couldn't help having a look.

diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 2fb2d34..ee8f896 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -1087,7 +1087,7 @@ gfc_trans_create_temp_array (stmtblock_t * pre,
stmtblock_t * post, gfc_ss * ss,
     for (s = ss; s; s = s->parent)
       for (n = 0; n < s->loop->dimen; n++)
     {
-      dim = get_scalarizer_dim_for_array_dim (ss, ss->dim[n]);
+      dim = get_scalarizer_dim_for_array_dim (ss, s->dim[n]);

       /* For a callee allocated array express the loop bounds in terms
          of the descriptor fields.  */



This gives the following change in the dump. Then one gets the expected result.

--- comment_0.f90.003t.original.bad    2011-11-24 00:15:42.045565178 +0100
+++ comment_0.f90.003t.original.good    2011-11-24 00:12:16.409796545 +0100
@@ -473,7 +473,7 @@
                           S.18 = 0;
                           while (1)
                             {
-                              if (atmp.17.dim[1].ubound -
atmp.17.dim[1].lbound < S.18) goto L.14;
+                              if (atmp.17.dim[0].ubound -
atmp.17.dim[0].lbound < S.18) goto L.14;
                               {
                                 integer(kind=4) D.2013;
                                 integer(kind=4) val.19;
@@ -608,7 +608,7 @@
                               __builtin_free (D.2035);
                             }
                         }
-                        D.2051 = atmp.23.dim[1].ubound -
atmp.23.dim[1].lbound;
+                        D.2051 = atmp.23.dim[0].ubound -
atmp.23.dim[0].lbound;
                         atmp.24.dtype = 265;
                         atmp.24.dim[0].stride = 1;
                         atmp.24.dim[0].lbound = 0;


  parent reply	other threads:[~2011-11-23 23:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-20 23:22 [Bug fortran/51250] New: " anlauf at gmx dot de
2011-11-21  0:51 ` [Bug fortran/51250] " dominiq at lps dot ens.fr
2011-11-21  8:07 ` burnus at gcc dot gnu.org
2011-11-22 19:34 ` mikael at gcc dot gnu.org
2011-11-24  0:37 ` mikael at gcc dot gnu.org [this message]
2011-11-25  0:59 ` anlauf at gmx dot de
2011-11-26  7:15 ` mikael at gcc dot gnu.org
2011-11-26  9:22 ` mikael 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-51250-4-rS1LtcT5bK@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).