diff options
author | Chung-Lin Tang <cltang@codesourcery.com> | 2018-05-31 14:10:10 +0000 |
---|---|---|
committer | Cesar Philippidis <cesar@gcc.gnu.org> | 2018-05-31 07:10:10 -0700 |
commit | bd1cab35c5eabf51d9392751036fa3a71758d263 (patch) | |
tree | b3173fd010fc1a205b8af74f166a3e091a389ad5 /gcc/gimplify.c | |
parent | 22f1f4c790759674d47b704e0faa140343e542d5 (diff) | |
download | gcc-bd1cab35c5eabf51d9392751036fa3a71758d263.zip gcc-bd1cab35c5eabf51d9392751036fa3a71758d263.tar.gz gcc-bd1cab35c5eabf51d9392751036fa3a71758d263.tar.bz2 |
re PR middle-end/85879 (ICE in expand_debug_locations, at cfgexpand.c:5405)
Fix PR middle-end/85879
gcc/
* gimplify.c (gimplify_adjust_omp_clauses): Add 'remove = true'
when emitting error on private/firstprivate reductions.
* omp-low.c (lower_omp_target): Avoid reference-type processing
on pointers for firstprivate clause.
gcc/testsuite/
* gfortran.dg/goacc/pr77371-1.f90: New test.
* gfortran.dg/goacc/pr77371-2.f90: New test.
* gfortran.dg/goacc/pr85879.f90: New test.
Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
From-SVN: r261025
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 9771804..44cb784 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -9275,13 +9275,16 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, gimple_seq body, tree *list_p, case OMP_CLAUSE_REDUCTION: decl = OMP_CLAUSE_DECL (c); /* OpenACC reductions need a present_or_copy data clause. - Add one if necessary. Error is the reduction is private. */ + Add one if necessary. Emit error when the reduction is private. */ if (ctx->region_type == ORT_ACC_PARALLEL) { n = splay_tree_lookup (ctx->variables, (splay_tree_key) decl); if (n->value & (GOVD_PRIVATE | GOVD_FIRSTPRIVATE)) - error_at (OMP_CLAUSE_LOCATION (c), "invalid private " - "reduction on %qE", DECL_NAME (decl)); + { + remove = true; + error_at (OMP_CLAUSE_LOCATION (c), "invalid private " + "reduction on %qE", DECL_NAME (decl)); + } else if ((n->value & GOVD_MAP) == 0) { tree next = OMP_CLAUSE_CHAIN (c); |