From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106047 invoked by alias); 16 Sep 2015 12:10:15 -0000 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 Received: (qmail 106007 invoked by uid 89); 16 Sep 2015 12:10:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f44.google.com Received: from mail-qg0-f44.google.com (HELO mail-qg0-f44.google.com) (209.85.192.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 16 Sep 2015 12:10:09 +0000 Received: by qgez77 with SMTP id z77so169496810qge.1 for ; Wed, 16 Sep 2015 05:10:06 -0700 (PDT) X-Received: by 10.140.17.203 with SMTP id 69mr40445866qgd.106.1442405406471; Wed, 16 Sep 2015 05:10:06 -0700 (PDT) Received: from ?IPv6:2601:181:c000:c497:a2a8:cdff:fe3e:b48? ([2601:181:c000:c497:a2a8:cdff:fe3e:b48]) by smtp.googlemail.com with ESMTPSA id b98sm9872911qge.8.2015.09.16.05.10.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 05:10:06 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [gomp4] reduction cleanup Message-ID: <55F95C1D.8040707@acm.org> Date: Wed, 16 Sep 2015 12:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030203060401010800070601" X-SW-Source: 2015-09/txt/msg01171.txt.bz2 This is a multi-part message in MIME format. --------------030203060401010800070601 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 50 I noticed some unreachable code. Committed this. --------------030203060401010800070601 Content-Type: text/x-patch; name="gomp4-red.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gomp4-red.patch" Content-length: 1571 2015-09-16 Nathan Sidwell * omp-low.c (lower_oacc_reductions): Remove dead initialization and unreachable code. Index: gcc/omp-low.c =================================================================== --- gcc/omp-low.c (revision 227792) +++ gcc/omp-low.c (working copy) @@ -4729,7 +4729,7 @@ static void lower_oacc_reductions (enum internal_fn ifn, int loop_dim, tree clauses, gimple_seq *ilist, omp_context *ctx, bool write_back) { - tree orig, res, var, ref_to_res, call, dim; + tree orig, var, ref_to_res, call, dim; tree c, tcode, gwv, rid, lid = build_int_cst (integer_type_node, oacc_lid); int oacc_rid, i; unsigned mask = extract_oacc_loop_mask (ctx); @@ -4783,12 +4783,6 @@ lower_oacc_reductions (enum internal_fn if (var == NULL_TREE) var = orig; - res = build_outer_var_ref (orig, ctx); - - if (res == orig) - ref_to_res = NULL_TREE; - - ref_to_res = integer_zero_node; if (is_oacc_parallel (ctx)) { ref_to_res = build_receiver_ref (orig, false, ctx); @@ -4797,11 +4791,9 @@ lower_oacc_reductions (enum internal_fn ref_to_res = build_simple_mem_ref (ref_to_res); } else if (loop_dim == GOMP_DIM_GANG) - ref_to_res = build_fold_addr_expr (res); - - /* Don't do anything for private gang reductions. */ - if (ref_to_res == NULL_TREE) - continue; + ref_to_res = build_fold_addr_expr (build_outer_var_ref (orig, ctx)); + else + ref_to_res = integer_zero_node; rcode = OMP_CLAUSE_REDUCTION_CODE (c); if (rcode == MINUS_EXPR) --------------030203060401010800070601--