From patchwork Sat Sep 4 14:24:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 63783 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 602FCB7146 for ; Sun, 5 Sep 2010 00:24:57 +1000 (EST) Received: (qmail 28876 invoked by alias); 4 Sep 2010 14:24:53 -0000 Received: (qmail 28861 invoked by uid 22791); 4 Sep 2010 14:24:53 -0000 X-SWARE-Spam-Status: No, hits=1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_JMF_BL, SPF_NEUTRAL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp22.services.sfr.fr (HELO smtp22.services.sfr.fr) (93.17.128.11) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 04 Sep 2010 14:24:49 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2206.sfr.fr (SMTP Server) with ESMTP id 3B0BC700008A; Sat, 4 Sep 2010 16:24:47 +0200 (CEST) Received: from gimli.local (122.183.72-86.rev.gaoland.net [86.72.183.122]) by msfrf2206.sfr.fr (SMTP Server) with ESMTP id A5FC0700008C; Sat, 4 Sep 2010 16:24:46 +0200 (CEST) X-SFR-UUID: 20100904142446680.A5FC0700008C@msfrf2206.sfr.fr Message-ID: <4C825683.80801@sfr.fr> Date: Sat, 04 Sep 2010 16:24:03 +0200 From: Mikael Morin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; fr-FR; rv:1.9.1.11) Gecko/20100725 Thunderbird/3.0.6 MIME-Version: 1.0 To: "fortran@gcc.gnu.org" , gcc-patches Subject: [Patch, fortran] [4/11] Inline transpose part 1 References: <4C8254A0.9020907@sfr.fr> In-Reply-To: <4C8254A0.9020907@sfr.fr> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org The innermost stride of a full array is not necessarily stride[0] if we are accessing it transposed. OK for trunk? 2010-09-03 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Unconditionally use the dim array to get the stride in the innermost loop. diff --git a/trans-array.c b/trans-array.c index 5086641..d4a0542 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2733,12 +2733,13 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, info->offset, index); info->offset = gfc_evaluate_now (info->offset, pblock); } - - i = loop->order[0]; - stride = gfc_conv_array_stride (info->descriptor, info->dim[i]); } - else - stride = gfc_conv_array_stride (info->descriptor, 0); + + i = loop->order[0]; + /* For the time being, the innermost loop is unconditionally on + the first dimension of the scalarization loop. */ + gcc_assert (i == 0); + stride = gfc_conv_array_stride (info->descriptor, info->dim[i]); /* Calculate the stride of the innermost loop. Hopefully this will allow the backend optimizers to do their stuff more effectively.