diff mbox

[gomp4] fix routine-7 test

Message ID 5620181A.3000209@acm.org
State New
Headers show

Commit Message

Nathan Sidwell Oct. 15, 2015, 9:18 p.m. UTC
I've committed this to gomp4 branch.  It fixes the routine-7 regression  I 
caused when reworking the reduction machinery.

nathan
diff mbox

Patch

2015-10-15  Nathan Sidwell  <nathan@codesourcery.com>

	* omp-low.c (lower_oacc_reductions): Check outer context is a
	target before lookup.

Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c	(revision 228848)
+++ gcc/omp-low.c	(working copy)
@@ -4846,7 +4846,8 @@  lower_oacc_reductions (location_t loc, t
 	    
 	    /* This is the outermost construct with this reduction,
 	       see if there's a mapping for it.  */
-	    if (maybe_lookup_field (orig, outer))
+	    if (gimple_code (outer->stmt) == GIMPLE_OMP_TARGET
+		&& maybe_lookup_field (orig, outer))
 	      ref_to_res = build_receiver_ref (orig, false, outer);
 
 	  has_outer_reduction:;