From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13379 invoked by alias); 27 Oct 2011 23:34:53 -0000 Received: (qmail 26628 invoked by uid 22791); 27 Oct 2011 23:32:41 -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:32:27 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id 578D170000AC; Fri, 28 Oct 2011 01:32:26 +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 1F10E700008E; Fri, 28 Oct 2011 01:32:26 +0200 (CEST) X-SFR-UUID: 20111027233226127.1F10E700008E@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============3305235866643562718==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027233226.18581.3345@gimli.local> In-Reply-To: <20111027233144.18581.30688@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027233144.18581.30688@gimli.local> Subject: [Patch, fortran] [44/66] inline sum and product: Update the scalarizer: New gfc_ss::nested_ss field. 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/msg02551.txt.bz2 --===============3305235866643562718== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 155 To be able, from one outer gfc_ss struct, to descend into the corresponding inner gfc_ss struct in the nested loop, this introduces a nested_ss field. OK? --===============3305235866643562718== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-44.CL" Content-length: 235 2011-10-19 Mikael Morin * trans.h (struct gfc_ss): New field nested_ss. * trans-array.c (gfc_mark_ss_chain_used): Mark recursively nested structs. * trans-expr.c (gfc_advance_se_ss_chain): Update assertion. --===============3305235866643562718== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-44.patch" Content-length: 1046 diff --git a/trans-expr.c b/trans-expr.c index 72d35f8..4cfdc3e 100644 --- a/trans-expr.c +++ b/trans-expr.c @@ -92,7 +92,8 @@ gfc_advance_se_ss_chain (gfc_se * se) while (p != NULL) { /* Simple consistency check. */ - gcc_assert (p->parent == NULL || p->parent->ss == p->ss); + gcc_assert (p->parent == NULL || p->parent->ss == p->ss + || p->parent->ss->nested_ss == p->ss); /* If we were in a nested loop, the next scalarized expression can be on the parent ss' next pointer. Thus we should not take the next diff --git a/trans.h b/trans.h index 53c5ce2..0608879 100644 --- a/trans.h +++ b/trans.h @@ -249,6 +249,11 @@ typedef struct gfc_ss /* Non-null if the ss is part of a nested loop. */ struct gfc_ss *parent; + /* If the evaluation of an expression requires a nested loop (for example + if the sum intrinsic is evaluated inline), this points to the nested + loop's gfc_ss. */ + struct gfc_ss *nested_ss; + /* The loop this gfc_ss is in. */ struct gfc_loopinfo *loop; --===============3305235866643562718==--