From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2667 invoked by alias); 27 Oct 2011 23:36:14 -0000 Received: (qmail 4575 invoked by uid 22791); 27 Oct 2011 23:34:02 -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:33:47 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id 1DC0570000AC; Fri, 28 Oct 2011 01:33:46 +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 D2CF6700008E; Fri, 28 Oct 2011 01:33:45 +0200 (CEST) X-SFR-UUID: 20111027233345863.D2CF6700008E@msfrf2512.sfr.fr Content-Type: multipart/mixed; boundary="===============1394532277017915106==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027233345.18581.10100@gimli.local> In-Reply-To: <20111027233339.18581.86093@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027233339.18581.86093@gimli.local> Subject: [Patch, fortran] [62/66] inline sum and product: Inline sum: Change conditions. Date: Fri, 28 Oct 2011 00:29: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/msg02587.txt.bz2 --===============1394532277017915106== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 146 This makes the convention that all conditions are based on arguments presence and their rank. In the hope that it makes code easier to read. OK? --===============1394532277017915106== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-62.CL" Content-length: 116 2011-10-19 Mikael Morin * trans-intrinsic.c (gfc_conv_intrinsic_arith): Update conditions. --===============1394532277017915106== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr43829-62.patch" Content-length: 2003 diff --git a/trans-intrinsic.c b/trans-intrinsic.c index 3cdc1e0..342d2cb 100644 --- a/trans-intrinsic.c +++ b/trans-intrinsic.c @@ -2624,7 +2624,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, maskexpr = actual->expr; } - if (maskexpr && maskexpr->rank != 0) + if (maskexpr && maskexpr->rank > 0) { maskss = gfc_walk_expr (maskexpr); gcc_assert (maskss != gfc_ss_terminator); @@ -2635,7 +2635,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, /* Initialize the scalarizer. */ gfc_init_loopinfo (&loop); gfc_add_ss_to_loop (&loop, arrayss); - if (maskss) + if (maskexpr && maskexpr->rank > 0) gfc_add_ss_to_loop (&loop, maskss); /* Initialize the loop. */ @@ -2643,13 +2643,13 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, gfc_conv_loop_setup (&loop, &expr->where); gfc_mark_ss_chain_used (arrayss, 1); - if (maskss) + if (maskexpr && maskexpr->rank > 0) gfc_mark_ss_chain_used (maskss, 1); /* Generate the loop body. */ gfc_start_scalarized_body (&loop, &body); /* If we have a mask, only add this element if the mask is set. */ - if (maskss) + if (maskexpr && maskexpr->rank > 0) { gfc_init_se (&maskse, NULL); gfc_copy_loopinfo_to_se (&maskse, &loop); @@ -2740,7 +2740,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, gfc_add_block_to_block (&block, &arrayse.post); - if (maskss) + if (maskexpr && maskexpr->rank > 0) { /* We enclose the above in if (mask) {...} . */ @@ -2755,7 +2755,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, enum tree_code op, gfc_trans_scalarizing_loops (&loop, &body); /* For a scalar mask, enclose the loop in an if statement. */ - if (maskexpr && maskss == NULL) + if (maskexpr && maskexpr->rank == 0) { gfc_init_se (&maskse, NULL); gfc_conv_expr_val (&maskse, maskexpr); --===============1394532277017915106==--