From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29770 invoked by alias); 15 Sep 2011 23:10:35 -0000 Received: (qmail 29615 invoked by uid 22791); 15 Sep 2011 23:10:31 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (140.186.70.92) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Sep 2011 23:10:17 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4L4R-0000wP-Sq for gcc-patches@gcc.gnu.org; Thu, 15 Sep 2011 19:10:16 -0400 Received: from smtp22.services.sfr.fr ([93.17.128.11]:5327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4L2h-0000F8-Jx; Thu, 15 Sep 2011 19:08:27 -0400 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2208.sfr.fr (SMTP Server) with ESMTP id 53F167000186; Fri, 16 Sep 2011 01:08:25 +0200 (CEST) Received: from gimli.local (118.183.72.86.rev.sfr.net [86.72.183.118]) by msfrf2208.sfr.fr (SMTP Server) with ESMTP id 0A838700015C; Fri, 16 Sep 2011 01:08:24 +0200 (CEST) X-SFR-UUID: 20110915230825431.0A838700015C@msfrf2208.sfr.fr Content-Type: multipart/mixed; boundary="===============1463119265362007409==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20110915230824.28513.40843@gimli.local> In-Reply-To: <20110915230813.28513.97419@gimli.local> References: <20110915230813.28513.97419@gimli.local> Subject: [Patch, fortran] [05/21] Remove coarray support in the scalarizer: Calculate codim earlier. Date: Thu, 15 Sep 2011 23:10:00 -0000 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 93.17.128.11 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-09/txt/msg00935.txt.bz2 --===============1463119265362007409== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 557 In the next patches, we are going to evaluate cobounds out of the scalarizer. This needs to be done before the call to gfc_get_array_type_bounds (which takes [co]bounds as input). As a result we need to know the corank before that call. Furthermore, as we are going to remove coarray support in the scalarizer, let's calculate the corank without relying on the scalarizer. This patch just does that. A new want_coarray flag is introduced as sometimes we want to treat coarrays as normal arrays, that is we want a descriptor for the local image only. OK? --===============1463119265362007409== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="no_coarray_in_scalarizer-5.CL" Content-length: 163 2011-09-14 Mikael Morin * trans_array.c (gfc_conv_expr_descriptor): Evaluate codimension earlier and without relying on the scalarizer. --===============1463119265362007409== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="no_coarray_in_scalarizer-5.diff" Content-length: 2328 diff --git a/trans-array.c b/trans-array.c index 88849ef..88998de 100644 --- a/trans-array.c +++ b/trans-array.c @@ -5988,6 +5988,11 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) tree to; tree base; + if (se->want_coarray) + codim = gfc_get_corank (expr); + else + codim = 0; + /* Set the string_length for a character array. */ if (expr->ts.type == BT_CHARACTER) se->string_length = gfc_get_expr_charlen (expr); @@ -6036,7 +6041,6 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) base = NULL_TREE; ndim = info->ref ? info->ref->u.ar.dimen : info->dimen; - codim = info->codimen; for (n = 0; n < ndim; n++) { stride = gfc_conv_array_stride (desc, n); diff --git a/trans-intrinsic.c b/trans-intrinsic.c index de5a809..c216873 100644 --- a/trans-intrinsic.c +++ b/trans-intrinsic.c @@ -974,6 +974,7 @@ trans_this_image (gfc_se * se, gfc_expr *expr) ss = gfc_walk_expr (expr->value.function.actual->expr); gcc_assert (ss != gfc_ss_terminator); ss->data.info.codimen = corank; + argse.want_coarray = 1; gfc_conv_expr_descriptor (&argse, expr->value.function.actual->expr, ss); gfc_add_block_to_block (&se->pre, &argse.pre); gfc_add_block_to_block (&se->post, &argse.post); @@ -1161,6 +1162,7 @@ trans_image_index (gfc_se * se, gfc_expr *expr) ss = gfc_walk_expr (expr->value.function.actual->expr); gcc_assert (ss != gfc_ss_terminator); ss->data.info.codimen = corank; + argse.want_coarray = 1; gfc_conv_expr_descriptor (&argse, expr->value.function.actual->expr, ss); gfc_add_block_to_block (&se->pre, &argse.pre); gfc_add_block_to_block (&se->post, &argse.post); @@ -1488,6 +1490,7 @@ conv_intrinsic_cobound (gfc_se * se, gfc_expr * expr) gcc_assert (ss != gfc_ss_terminator); ss->data.info.codimen = corank; gfc_init_se (&argse, NULL); + argse.want_coarray = 1; gfc_conv_expr_descriptor (&argse, arg->expr, ss); gfc_add_block_to_block (&se->pre, &argse.pre); diff --git a/trans.h b/trans.h index 0c249a6..6157a88 100644 --- a/trans.h +++ b/trans.h @@ -86,6 +86,8 @@ typedef struct gfc_se args alias. */ unsigned force_tmp:1; + unsigned want_coarray:1; + /* Scalarization parameters. */ struct gfc_se *parent; struct gfc_ss *ss; --===============1463119265362007409==--