From patchwork Sat Sep 4 14:22:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 63782 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 5E782B7147 for ; Sun, 5 Sep 2010 00:23:35 +1000 (EST) Received: (qmail 27845 invoked by alias); 4 Sep 2010 14:23:31 -0000 Received: (qmail 27832 invoked by uid 22791); 4 Sep 2010 14:23:31 -0000 X-SWARE-Spam-Status: No, hits=1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_JMF_BL, SPF_NEUTRAL, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp24.services.sfr.fr (HELO smtp24.services.sfr.fr) (93.17.128.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 04 Sep 2010 14:23:26 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2416.sfr.fr (SMTP Server) with ESMTP id 306CC700008C; Sat, 4 Sep 2010 16:23:24 +0200 (CEST) Received: from gimli.local (122.183.72-86.rev.gaoland.net [86.72.183.122]) by msfrf2416.sfr.fr (SMTP Server) with ESMTP id A7F66700008B; Sat, 4 Sep 2010 16:23:23 +0200 (CEST) X-SFR-UUID: 20100904142323688.A7F66700008B@msfrf2416.sfr.fr Message-ID: <4C825630.9050804@sfr.fr> Date: Sat, 04 Sep 2010 16:22:40 +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] [3/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 Now it starts to be interesting. If we want to have the dim array keep pointing on the transposed array, we better have gfc_trans_create_temp_array not overwriting it. Then if gfc_trans_create_temp_array doesn't set it, it should be done before. OK for trunk? 2010-09-03 Mikael Morin * trans-array.c (gfc_trans_create_temp_array): Don't set dim array. (gfc_conv_loop_setup): Set dim array. (gfc_walk_function_expr): Ditto. * trans-intrinsic.c (gfc_walk_intrinsic_libfunc): Ditto. diff --git a/trans-array.c b/trans-array.c index 5902aff..5086641 100644 --- a/trans-array.c +++ b/trans-array.c @@ -753,7 +753,6 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, info->start[dim] = gfc_index_zero_node; info->end[dim] = gfc_index_zero_node; info->stride[dim] = gfc_index_one_node; - info->dim[dim] = dim; } /* Initialize the descriptor. */ @@ -3768,6 +3767,11 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where) memset (&loop->temp_ss->data.info, 0, sizeof (gfc_ss_info)); loop->temp_ss->type = GFC_SS_SECTION; loop->temp_ss->data.info.dimen = n; + + gcc_assert (loop->temp_ss->data.info.dimen != 0); + for (n = 0; n < loop->temp_ss->data.info.dimen; n++) + loop->temp_ss->data.info.dim[n] = n; + gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, &loop->temp_ss->data.info, tmp, NULL_TREE, false, true, false, where); @@ -6740,6 +6744,7 @@ gfc_walk_function_expr (gfc_ss * ss, gfc_expr * expr) gfc_intrinsic_sym *isym; gfc_symbol *sym; gfc_component *comp = NULL; + int n; isym = expr->value.function.isym; @@ -6761,6 +6766,8 @@ gfc_walk_function_expr (gfc_ss * ss, gfc_expr * expr) newss->expr = expr; newss->next = ss; newss->data.info.dimen = expr->rank; + for (n = 0; n < newss->data.info.dimen; n++) + newss->data.info.dim[n] = n; return newss; } diff --git a/trans-intrinsic.c b/trans-intrinsic.c index 8f50e6d..c0998ba 100644 --- a/trans-intrinsic.c +++ b/trans-intrinsic.c @@ -5789,6 +5789,7 @@ static gfc_ss * gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr) { gfc_ss *newss; + int n; gcc_assert (expr->rank > 0); @@ -5797,6 +5798,8 @@ gfc_walk_intrinsic_libfunc (gfc_ss * ss, gfc_expr * expr) newss->expr = expr; newss->next = ss; newss->data.info.dimen = expr->rank; + for (n = 0; n < newss->data.info.dimen; n++) + newss->data.info.dim[n] = n; return newss; }