aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-07-10 12:26:19 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2015-07-10 12:26:19 +0200
commitd26fc9797bd7888d50fb8d09fbe7d258b0236444 (patch)
tree33d774f746d1bcb1f3b9de1fd52df76f9c290001 /gcc/gimplify.c
parente9f4322e78d9f5be3ee2a61ffa9b44f9470f0042 (diff)
downloadgcc-d26fc9797bd7888d50fb8d09fbe7d258b0236444.zip
gcc-d26fc9797bd7888d50fb8d09fbe7d258b0236444.tar.gz
gcc-d26fc9797bd7888d50fb8d09fbe7d258b0236444.tar.bz2
re PR middle-end/66820 (internal compiler error: in get_expr_operands, at tree-ssa-operands.c:910)
PR middle-end/66820 * gimplify.c (maybe_fold_stmt): Don't fold in ORT_PARALLEL or ORT_TASK contexts. * omp-low.c (lower_omp): Call fold_stmt even if taskreg_nesting_level is non-zero. * gcc.dg/gomp/pr66820.c: New test. From-SVN: r225661
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index c621305..07ea2a7 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2245,16 +2245,17 @@ gimplify_arg (tree *arg_p, gimple_seq *pre_p, location_t call_location)
return gimplify_expr (arg_p, pre_p, NULL, test, fb);
}
-/* Don't fold inside offloading regions: it can break code by adding decl
- references that weren't in the source. We'll do it during omplower pass
- instead. */
+/* Don't fold inside offloading or taskreg regions: it can break code by
+ adding decl references that weren't in the source. We'll do it during
+ omplower pass instead. */
static bool
maybe_fold_stmt (gimple_stmt_iterator *gsi)
{
struct gimplify_omp_ctx *ctx;
for (ctx = gimplify_omp_ctxp; ctx; ctx = ctx->outer_context)
- if (ctx->region_type == ORT_TARGET)
+ if (ctx->region_type == ORT_TARGET
+ || (ctx->region_type & (ORT_PARALLEL | ORT_TASK)) != 0)
return false;
return fold_stmt (gsi);
}