From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15304 invoked by alias); 27 Oct 2011 23:30:29 -0000 Received: (qmail 14625 invoked by uid 22791); 27 Oct 2011 23:30:25 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,TW_TM 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:30:10 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id D73CB7000089; Fri, 28 Oct 2011 01:30:09 +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 825C77000040; Fri, 28 Oct 2011 01:30:09 +0200 (CEST) X-SFR-UUID: 20111027233009534.825C77000040@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============4757407500615191961==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027233009.18581.88492@gimli.local> In-Reply-To: <20111027232947.18581.48982@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027232947.18581.48982@gimli.local> Subject: [Patch, fortran] [16/66] inline sum and product: Interfaces changes: gfc_trans_create_temp_array 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/msg02572.txt.bz2 --===============4757407500615191961== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 222 gfc_trans_create_temp_array uses dimensions heavily, and dimensions are to be moved from gfc_ss_info to gfc_ss. To have them still available in gfc_trans_create_temp_array, the gfc_ss_info argument should be a gfc_ss. OK? --===============4757407500615191961== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-16.CL" Content-length: 475 2011-10-19 Mikael Morin * trans-array.h (gfc_trans_create_temp_array): Replace info argument with ss argument. * trans-array.c (gfc_trans_create_temp_array): Ditto. Get info from ss. (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to gfc_trans_create_temp_array. * trans-expr.c (gfc_conv_procedure_call): Ditto. * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto. * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto. --===============4757407500615191961== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-16.patch" Content-length: 4482 diff --git a/trans-array.c b/trans-array.c index d8f5448..0e7c1c1 100644 --- a/trans-array.c +++ b/trans-array.c @@ -838,10 +838,11 @@ get_array_ref_dim (gfc_ss_info *info, int loop_dim) tree gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, - gfc_loopinfo * loop, gfc_ss_info * info, + gfc_loopinfo * loop, gfc_ss * ss, tree eltype, tree initial, bool dynamic, bool dealloc, bool callee_alloc, locus * where) { + gfc_ss_info *info; tree from[GFC_MAX_DIMENSIONS], to[GFC_MAX_DIMENSIONS]; tree type; tree desc; @@ -855,6 +856,8 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post, memset (from, 0, sizeof (from)); memset (to, 0, sizeof (to)); + info = &ss->data.info; + gcc_assert (info->dimen > 0); gcc_assert (loop->dimen == info->dimen); @@ -2038,7 +2041,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where) if (TREE_CODE (loop->to[0]) == VAR_DECL) dynamic = true; - gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, &ss->data.info, + gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, ss, type, NULL_TREE, dynamic, true, false, where); desc = ss->data.info.descriptor; @@ -4061,7 +4064,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where) 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, + loop->temp_ss, tmp, NULL_TREE, false, true, false, where); } diff --git a/trans-array.h b/trans-array.h index 4d737bd..57805b6 100644 --- a/trans-array.h +++ b/trans-array.h @@ -32,7 +32,7 @@ void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *, /* Generate code to create a temporary array. */ tree gfc_trans_create_temp_array (stmtblock_t *, stmtblock_t *, gfc_loopinfo *, - gfc_ss_info *, tree, tree, bool, bool, bool, + gfc_ss *, tree, tree, bool, bool, bool, locus *); /* Generate function entry code for allocation of compiler allocated array diff --git a/trans-expr.c b/trans-expr.c index 09b98d0..b2c1739 100644 --- a/trans-expr.c +++ b/trans-expr.c @@ -3602,8 +3602,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, returns a pointer, the temporary will be a shallow copy and mustn't be deallocated. */ callee_alloc = comp->attr.allocatable || comp->attr.pointer; - gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, info, tmp, - NULL_TREE, false, !comp->attr.pointer, + gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, se->ss, + tmp, NULL_TREE, false, + !comp->attr.pointer, callee_alloc, &se->ss->expr->where); /* Pass the temporary as the first argument. */ @@ -3637,8 +3638,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, returns a pointer, the temporary will be a shallow copy and mustn't be deallocated. */ callee_alloc = sym->attr.allocatable || sym->attr.pointer; - gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, info, tmp, - NULL_TREE, false, !sym->attr.pointer, + gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, se->ss, + tmp, NULL_TREE, false, + !sym->attr.pointer, callee_alloc, &se->ss->expr->where); /* Pass the temporary as the first argument. */ diff --git a/trans-intrinsic.c b/trans-intrinsic.c index 83fc4fc..95161f8 100644 --- a/trans-intrinsic.c +++ b/trans-intrinsic.c @@ -5502,7 +5502,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr) /* Build a destination descriptor, using the pointer, source, as the data field. */ gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, - info, mold_type, NULL_TREE, false, true, false, + se->ss, mold_type, NULL_TREE, false, true, false, &expr->where); /* Cast the pointer to the result. */ diff --git a/trans-stmt.c b/trans-stmt.c index c71eeec..c7ae360 100644 --- a/trans-stmt.c +++ b/trans-stmt.c @@ -310,7 +310,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse, data = gfc_create_var (pvoid_type_node, NULL); gfc_init_block (&temp_post); tmp = gfc_trans_create_temp_array (&se->pre, &temp_post, - &tmp_loop, info, temptype, + &tmp_loop, ss, temptype, initial, false, true, false, &arg->expr->where); --===============4757407500615191961==--