From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25629 invoked by alias); 27 Oct 2011 23:32:35 -0000 Received: (qmail 22995 invoked by uid 22791); 27 Oct 2011 23:31:56 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD 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:40 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id 4A0707000040; Fri, 28 Oct 2011 01:31:39 +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 08C7E700008E; Fri, 28 Oct 2011 01:31:38 +0200 (CEST) X-SFR-UUID: 20111027233139360.08C7E700008E@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============4023439036140899043==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027233138.18581.98598@gimli.local> In-Reply-To: <20111027233031.18581.58613@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027233031.18581.58613@gimli.local> Subject: [Patch, fortran] [30/66] inline sum and product: Update core structs: Move where flag. Date: Thu, 27 Oct 2011 23:35: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/msg02548.txt.bz2 --===============4023439036140899043== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 55 This moves where field from gfc_ss to gfc_ss_info. OK? --===============4023439036140899043== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-30.CL" Content-length: 275 2011-10-19 Mikael Morin * trans.h (struct gfc_ss, struct gfc_ss_info): Move field gfc_ss::where into gfc_ss_info. * trans-array.c (gfc_add_loop_ss_code): Update reference chains. * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto. --===============4023439036140899043== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-30.patch" Content-length: 2268 diff --git a/trans-array.c b/trans-array.c index 427bb7b..045c426 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2203,7 +2203,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript, scalarization loop, except for WHERE assignments. */ if (subscript) se.expr = convert(gfc_array_index_type, se.expr); - if (!ss->where) + if (!ss_info->where) se.expr = gfc_evaluate_now (se.expr, &loop->pre); gfc_add_block_to_block (&loop->pre, &se.post); } diff --git a/trans-stmt.c b/trans-stmt.c index 101a651..86a56e8 100644 --- a/trans-stmt.c +++ b/trans-stmt.c @@ -4062,7 +4062,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, { /* The rhs is scalar. Add a ss for the expression. */ rss = gfc_get_scalar_ss (gfc_ss_terminator, expr2); - rss->where = 1; + rss->info->where = 1; } /* Associate the SS with the loop. */ @@ -4501,7 +4501,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock) if (tsss == gfc_ss_terminator) { tsss = gfc_get_scalar_ss (gfc_ss_terminator, tsrc); - tsss->where = 1; + tsss->info->where = 1; } gfc_add_ss_to_loop (&loop, tdss); gfc_add_ss_to_loop (&loop, tsss); @@ -4516,7 +4516,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock) if (esss == gfc_ss_terminator) { esss = gfc_get_scalar_ss (gfc_ss_terminator, esrc); - esss->where = 1; + esss->info->where = 1; } gfc_add_ss_to_loop (&loop, edss); gfc_add_ss_to_loop (&loop, esss); diff --git a/trans.h b/trans.h index 907c271..c35b1ae 100644 --- a/trans.h +++ b/trans.h @@ -214,6 +214,9 @@ typedef struct gfc_ss_info 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; + + /* Suppresses precalculation of scalars in WHERE assignments. */ + unsigned where:1; } gfc_ss_info; @@ -242,9 +245,7 @@ typedef struct gfc_ss struct gfc_ss *loop_chain; struct gfc_ss *next; - /* The bit 'where' suppresses precalculation of scalars in WHERE assignments. - */ - unsigned where:1, is_alloc_lhs:1; + unsigned is_alloc_lhs:1; } gfc_ss; #define gfc_get_ss() XCNEW (gfc_ss) --===============4023439036140899043==--