public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4] reduction cleanup
@ 2015-09-16 12:11 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2015-09-16 12:11 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 50 bytes --]

I noticed some unreachable code.  Committed this.

[-- Attachment #2: gomp4-red.patch --]
[-- Type: text/x-patch, Size: 1571 bytes --]

2015-09-16  Nathan Sidwell  <nathan@codesourcery.com>

	* 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-16 12:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-16 12:11 [gomp4] reduction cleanup Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).