From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24756 invoked by alias); 27 Oct 2011 23:32:20 -0000 Received: (qmail 22585 invoked by uid 22791); 27 Oct 2011 23:31:49 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,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:31:34 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id AF96370000AC; Fri, 28 Oct 2011 01:31:33 +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 5AFF1700008E; Fri, 28 Oct 2011 01:31:33 +0200 (CEST) X-SFR-UUID: 20111027233133372.5AFF1700008E@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============5655701905953853645==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027233133.18581.80296@gimli.local> In-Reply-To: <20111027233031.18581.58613@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027233031.18581.58613@gimli.local> Subject: [Patch, fortran] [29/66] inline sum and product: Update core structs: Move useflags flag. Date: Thu, 27 Oct 2011 23:32: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/msg02538.txt.bz2 --===============5655701905953853645== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 58 This moves useflags field from gfc_ss to gfc_ss_info. OK? --===============5655701905953853645== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-29.CL" Content-length: 407 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move field gfc_ss::useflags into gfc_ss_info. * trans-array.c (gfc_mark_ss_chain_used, gfc_trans_preloop_setup, gfc_trans_scalarizing_loops, gfc_trans_scalarized_boundary): Update reference chains. * trans-expr.c (gfc_conv_procedure_call): Ditto. * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto. --===============5655701905953853645== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-29.patch" Content-length: 3411 diff --git a/trans-array.c b/trans-array.c index 78e1443..427bb7b 100644 --- a/trans-array.c +++ b/trans-array.c @@ -463,7 +463,7 @@ void gfc_mark_ss_chain_used (gfc_ss * ss, unsigned flags) { for (; ss != gfc_ss_terminator; ss = ss->next) - ss->useflags = flags; + ss->info->useflags = flags; } static void gfc_free_ss (gfc_ss *); @@ -2906,7 +2906,7 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, { ss_info = ss->info; - if ((ss->useflags & flag) == 0) + if ((ss_info->useflags & flag) == 0) continue; ss_type = ss_info->type; @@ -3148,7 +3148,7 @@ gfc_trans_scalarizing_loops (gfc_loopinfo * loop, stmtblock_t * body) /* Clear all the used flags. */ for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain) - ss->useflags = 0; + ss->info->useflags = 0; } @@ -3185,7 +3185,7 @@ gfc_trans_scalarized_loop_boundary (gfc_loopinfo * loop, stmtblock_t * body) ss_info = ss->info; - if ((ss->useflags & 2) == 0) + if ((ss_info->useflags & 2) == 0) continue; ss_type = ss_info->type; diff --git a/trans-expr.c b/trans-expr.c index b175b62..01d4ca3 100644 --- a/trans-expr.c +++ b/trans-expr.c @@ -2898,7 +2898,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, if (!sym->attr.elemental) { gcc_assert (se->ss->info->type == GFC_SS_FUNCTION); - if (se->ss->useflags) + if (se->ss->info->useflags) { gcc_assert ((!comp && gfc_return_by_reference (sym) && sym->result->attr.dimension) @@ -2983,7 +2983,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, gfc_init_se (&parmse, se); gfc_conv_derived_to_class (&parmse, e, fsym->ts); } - else if (se->ss && se->ss->useflags) + else if (se->ss && se->ss->info->useflags) { /* An elemental function inside a scalarized loop. */ gfc_init_se (&parmse, se); diff --git a/trans-intrinsic.c b/trans-intrinsic.c index a3b7383..fcc59d7 100644 --- a/trans-intrinsic.c +++ b/trans-intrinsic.c @@ -6634,7 +6634,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr) break; case GFC_ISYM_TRANSFER: - if (se->ss && se->ss->useflags) + if (se->ss && se->ss->info->useflags) /* Access the previously obtained result. */ gfc_conv_tmp_array_ref (se); else diff --git a/trans.h b/trans.h index e74da41..907c271 100644 --- a/trans.h +++ b/trans.h @@ -209,6 +209,11 @@ typedef struct gfc_ss_info gfc_array_info array; } data; + + /* This is used by assignments requiring temporaries. The bits specify which + loops the terms appear in. This will be 1 for the RHS expressions, + 2 for the LHS expressions, and 3(=1|2) for the temporary. */ + unsigned useflags:2; } gfc_ss_info; @@ -237,11 +242,9 @@ typedef struct gfc_ss struct gfc_ss *loop_chain; struct gfc_ss *next; - /* This is used by assignments requiring temporaries. The bits specify which - loops the terms appear in. This will be 1 for the RHS expressions, - 2 for the LHS expressions, and 3(=1|2) for the temporary. The bit - 'where' suppresses precalculation of scalars in WHERE assignments. */ - unsigned useflags:2, where:1, is_alloc_lhs:1; + /* The bit 'where' suppresses precalculation of scalars in WHERE assignments. + */ + unsigned where:1, is_alloc_lhs:1; } gfc_ss; #define gfc_get_ss() XCNEW (gfc_ss) --===============5655701905953853645==--