From patchwork Mon Sep 20 22:21:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 65261 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 E53A7B70A6 for ; Tue, 21 Sep 2010 08:22:32 +1000 (EST) Received: (qmail 1564 invoked by alias); 20 Sep 2010 22:21:43 -0000 Received: (qmail 1500 invoked by uid 22791); 20 Sep 2010 22:21:42 -0000 X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_NEUTRAL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp21.services.sfr.fr (HELO smtp21.services.sfr.fr) (93.17.128.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Sep 2010 22:21:33 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2118.sfr.fr (SMTP Server) with ESMTP id B22307000089; Tue, 21 Sep 2010 00:21:31 +0200 (CEST) Received: from gimli.local (40.183.72-86.rev.gaoland.net [86.72.183.40]) by msfrf2118.sfr.fr (SMTP Server) with ESMTP id 8473C700008B; Tue, 21 Sep 2010 00:21:31 +0200 (CEST) X-SFR-UUID: 20100920222131542.8473C700008B@msfrf2118.sfr.fr MIME-Version: 1.0 From: Mikael Morin To: gfortran , patches Message-ID: <20100920222130.27269.44792@gimli.local> In-Reply-To: <20100920222130.27269.49914@gimli.local> References: <20100920222130.27269.49914@gimli.local> Subject: [Patch, fortran] [2/5] PR 45648: Inline transpose part 2: Take transposed dimensions into account whilst checking for full array Date: Tue, 21 Sep 2010 00:21:31 +0200 (CEST) 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 We have to take into account the fact that we can access an array transposed when checking whether an array reference is a reference to a full array. OK for trunk ? 2010-09-20 Mikael Morin PR fortran/45648 * trans-array.c (gfc_conv_expr_descriptor): Unset full if we are accessing dimensions in reversed order. diff --git a/trans-array.c b/trans-array.c index f15b53e..52e6d2a 100644 --- a/trans-array.c +++ b/trans-array.c @@ -5216,6 +5216,14 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) full = gfc_full_array_ref_p (info->ref, NULL); if (full) + for (n = 0; n < info->dimen; n++) + if (info->dim[n] != n) + { + full = 0; + break; + } + + if (full) { if (se->direct_byref && !se->byref_noassign) {