From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7523 invoked by alias); 27 Oct 2011 23:29:16 -0000 Received: (qmail 7401 invoked by uid 22791); 27 Oct 2011 23:29:15 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD 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:28:58 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id 954097000068; Fri, 28 Oct 2011 01:28:57 +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 5F342700008E; Fri, 28 Oct 2011 01:28:57 +0200 (CEST) X-SFR-UUID: 20111027232857390.5F342700008E@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============6096549930342511328==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027232857.18581.98375@gimli.local> In-Reply-To: <20111027232829.18581.89158@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027232829.18581.89158@gimli.local> Subject: [Patch, fortran] [05/66] inline sum and product: Prepare gfc_trans_preloop_setup Date: Thu, 27 Oct 2011 23:36: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/msg02560.txt.bz2 --===============6096549930342511328== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 214 This is for consistency. As dim == dimen-1 means "we are in the outermost loop", we should check against the loop dimension, not the array dimension. An assertion is added to check that it is in fact the same. OK? --===============6096549930342511328== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-5.CL" Content-length: 178 2011-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Use loop's dimension instead of array's dimention. Check that it is indeed the same. --===============6096549930342511328== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-5.patch" Content-length: 779 diff --git a/trans-array.c b/trans-array.c index f5e30ae..476978e 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2861,13 +2861,14 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, if (dim >= info->dimen) continue; + gcc_assert (info->dimen == loop->dimen); if (info->ref) ar = &info->ref->u.ar; else ar = NULL; - if (dim == info->dimen - 1) + if (dim == loop->dimen - 1) i = 0; else i = dim + 1; @@ -2876,7 +2877,7 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, gcc_assert (i == loop->order[i]); i = loop->order[i]; - if (dim == info->dimen - 1) + if (dim == loop->dimen - 1) { stride = gfc_conv_array_stride (info->descriptor, info->dim[i]); --===============6096549930342511328==--