I've committed this to gomp4 branch. It fixes the routine-7 regression I
caused when reworking the reduction machinery.
nathan
2015-10-15 Nathan Sidwell <nat...@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:;