From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17068 invoked by alias); 27 Oct 2011 23:30:39 -0000 Received: (qmail 16586 invoked by uid 22791); 27 Oct 2011 23:30:35 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,TW_TM X-Spam-Check-By: sourceware.org Received: from smtp25.services.sfr.fr (HELO smtp25.services.sfr.fr) (93.17.128.120) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Oct 2011 23:30:22 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id EBDAF700004E; Fri, 28 Oct 2011 01:30:20 +0200 (CEST) Received: from gimli.local (145.15.72.86.rev.sfr.net [86.72.15.145]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id B1A547000040; Fri, 28 Oct 2011 01:30:20 +0200 (CEST) X-SFR-UUID: 20111027233020727.B1A547000040@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============6579993888717072550==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027233020.18581.19957@gimli.local> In-Reply-To: <20111027232947.18581.48982@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027232947.18581.48982@gimli.local> Subject: [Patch, fortran] [18/66] inline sum and product: Interfaces changes: get_array_ref_dim Date: Thu, 27 Oct 2011 23:43:00 -0000 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg02578.txt.bz2 --===============6579993888717072550== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 106 Same as previous patch, get_array_ref_dim uses dimensions and thus needs a gfc_ss struct as argument. OK? --===============6579993888717072550== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-18.CL" Content-length: 244 2011-10-19 Mikael Morin * trans-array.c (get_array_ref_dim): Change argument type and name. Obtain previous argument from the new argument in the body. (gfc_trans_create_temp_arry, gfc_conv_loop_setup): Update calls. --===============6579993888717072550== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-18.patch" Content-length: 1284 diff --git a/trans-array.c b/trans-array.c index 6af4fd6..eeed8bb 100644 --- a/trans-array.c +++ b/trans-array.c @@ -807,9 +807,12 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post, */ static int -get_array_ref_dim (gfc_ss_info *info, int loop_dim) +get_array_ref_dim (gfc_ss *ss, int loop_dim) { int n, array_dim, array_ref_dim; + gfc_ss_info *info; + + info = &ss->data.info; array_ref_dim = 0; array_dim = info->dim[loop_dim]; @@ -884,7 +887,7 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, to the n'th dimension of the array. We need to reconstruct loop infos in the right order before using it to set the descriptor bounds. */ - tmp_dim = get_array_ref_dim (info, n); + tmp_dim = get_array_ref_dim (ss, n); from[tmp_dim] = loop->from[n]; to[tmp_dim] = loop->to[n]; @@ -3976,7 +3979,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where) && INTEGER_CST_P (info->stride[dim])) { loop->from[n] = info->start[dim]; - mpz_set (i, cshape[get_array_ref_dim (info, n)]); + mpz_set (i, cshape[get_array_ref_dim (loopspec[n], n)]); mpz_sub_ui (i, i, 1); /* To = from + (size - 1) * stride. */ tmp = gfc_conv_mpz_to_tree (i, gfc_index_integer_kind); --===============6579993888717072550==--