diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-02-08 10:10:14 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-02-08 10:10:14 +0100 |
commit | c74559df76560e75fd3adc58cccaab99ece47eeb (patch) | |
tree | 2c1956599725175921f6bf53545ec3831264dff4 /gcc/gimplify.c | |
parent | 8fcbce729d0ccd6881e479af9eec694abec61ee5 (diff) | |
download | gcc-c74559df76560e75fd3adc58cccaab99ece47eeb.zip gcc-c74559df76560e75fd3adc58cccaab99ece47eeb.tar.gz gcc-c74559df76560e75fd3adc58cccaab99ece47eeb.tar.bz2 |
re PR c/59984 (OpenMP pragma makes loop incorrect)
PR c/59984
* gimplify.c (gimplify_bind_expr): In ORT_SIMD region
mark local addressable non-static vars as GOVD_PRIVATE
instead of GOVD_LOCAL.
* omp-low.c (lower_omp_for): Move gimple_bind_vars
and BLOCK_VARS of gimple_bind_block to new_stmt rather
than copying them.
* gcc.dg/vect/pr59984.c: New test.
From-SVN: r207629
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 9c9998d..957a82f 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1042,7 +1042,14 @@ gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p) && (! DECL_SEEN_IN_BIND_EXPR_P (t) || splay_tree_lookup (ctx->variables, (splay_tree_key) t) == NULL)) - omp_add_variable (gimplify_omp_ctxp, t, GOVD_LOCAL | GOVD_SEEN); + { + if (ctx->region_type == ORT_SIMD + && TREE_ADDRESSABLE (t) + && !TREE_STATIC (t)) + omp_add_variable (ctx, t, GOVD_PRIVATE | GOVD_SEEN); + else + omp_add_variable (ctx, t, GOVD_LOCAL | GOVD_SEEN); + } DECL_SEEN_IN_BIND_EXPR_P (t) = 1; |