From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11375 invoked by alias); 27 Oct 2011 23:29:56 -0000 Received: (qmail 11046 invoked by uid 22791); 27 Oct 2011 23:29:52 -0000 X-SWARE-Spam-Status: No, hits=-1.4 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:29:37 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id 55320700004E; Fri, 28 Oct 2011 01:29:36 +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 1B5E07000040; Fri, 28 Oct 2011 01:29:36 +0200 (CEST) X-SFR-UUID: 20111027232936112.1B5E07000040@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============0417972595510770986==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027232936.18581.86599@gimli.local> In-Reply-To: <20111027232908.18581.12145@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027232908.18581.12145@gimli.local> Subject: [Patch, fortran] [11/66] inline sum and product: Preliminary cleanups: Skip temporary case. 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/msg02562.txt.bz2 --===============0417972595510770986== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 682 We can't use temporaries to guess loop dimensions, as temporaries' bounds are calculated from loop dimensions. In the union: union { struct { ... } scalar; struct { ... } temp; struct gfc_ss_info info } data; We are currently accessing data.struct.info even in the GFC_SS_TEMP case where it is not defined. However, the aliasing and the code interact in such a way that the temporary is never chosen to get loop bounds; so it works. This patch prevents accessing gfc_ss::data::info in cases it has invalid content, so that we can update gfc_ss_info without caring about aliasing problems. OK? --===============0417972595510770986== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-11.CL" Content-length: 116 2011-10-19 Mikael Morin * trans-array.c (gfc_conv_loop_setup): Also skip temporary arrays. --===============0417972595510770986== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-11.patch" Content-length: 607 diff --git a/trans-array.c b/trans-array.c index f4d8a85..cfbe909 100644 --- a/trans-array.c +++ b/trans-array.c @@ -3881,7 +3881,12 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where) loop for this dimension. We try to pick the simplest term. */ for (ss = loop->ss; ss != gfc_ss_terminator; ss = ss->loop_chain) { - if (ss->type == GFC_SS_SCALAR || ss->type == GFC_SS_REFERENCE) + gfc_ss_type ss_type; + + ss_type = ss->type; + if (ss_type == GFC_SS_SCALAR + || ss_type == GFC_SS_TEMP + || ss_type == GFC_SS_REFERENCE) continue; info = &ss->data.info; --===============0417972595510770986==--