From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11571 invoked by alias); 27 Oct 2011 23:29:57 -0000 Received: (qmail 11369 invoked by uid 22791); 27 Oct 2011 23:29:56 -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:29:42 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id D5D217000054; Fri, 28 Oct 2011 01:29:41 +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 A11AD7000040; Fri, 28 Oct 2011 01:29:41 +0200 (CEST) X-SFR-UUID: 20111027232941659.A11AD7000040@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============0866836385667979143==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027232941.18581.64076@gimli.local> In-Reply-To: <20111027232908.18581.12145@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027232908.18581.12145@gimli.local> Subject: [Patch, fortran] [12/66] inline sum and product: Preliminary cleanups: Stop loop before end marker. 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/msg02534.txt.bz2 --===============0866836385667979143== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 257 We should not be writing to gfc_ss_terminator. It is working without this patch because gfc_ss_terminator's next pointer is NULL, so the loop stops just after it, and because we are writing zero to gfc_ss_terminator, but it is already all zeros anyway. OK? --===============0866836385667979143== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-12.CL" Content-length: 140 2011-10-19 Mikael Morin * trans-array.c (gfc_trans_scalarizing_loops): Stop loop before end marker, not after it. --===============0866836385667979143== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-12.patch" Content-length: 432 diff --git a/trans-array.c b/trans-array.c index cfbe909..f611302 100644 --- a/trans-array.c +++ b/trans-array.c @@ -3114,7 +3114,7 @@ gfc_trans_scalarizing_loops (gfc_loopinfo * loop, stmtblock_t * body) gfc_add_expr_to_block (&loop->pre, tmp); /* Clear all the used flags. */ - for (ss = loop->ss; ss; ss = ss->loop_chain) + for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain) ss->useflags = 0; } --===============0866836385667979143==--