aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-02-08 10:10:14 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2014-02-08 10:10:14 +0100
commitc74559df76560e75fd3adc58cccaab99ece47eeb (patch)
tree2c1956599725175921f6bf53545ec3831264dff4 /gcc/omp-low.c
parent8fcbce729d0ccd6881e479af9eec694abec61ee5 (diff)
downloadgcc-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/omp-low.c')
-rw-r--r--gcc/omp-low.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 2c35751..f99b2a6 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -8946,8 +8946,14 @@ lower_omp_for (gimple_stmt_iterator *gsi_p, omp_context *ctx)
if (!gimple_seq_empty_p (omp_for_body)
&& gimple_code (gimple_seq_first_stmt (omp_for_body)) == GIMPLE_BIND)
{
- tree vars = gimple_bind_vars (gimple_seq_first_stmt (omp_for_body));
+ gimple inner_bind = gimple_seq_first_stmt (omp_for_body);
+ tree vars = gimple_bind_vars (inner_bind);
gimple_bind_append_vars (new_stmt, vars);
+ /* bind_vars/BLOCK_VARS are being moved to new_stmt/block, don't
+ keep them on the inner_bind and it's block. */
+ gimple_bind_set_vars (inner_bind, NULL_TREE);
+ if (gimple_bind_block (inner_bind))
+ BLOCK_VARS (gimple_bind_block (inner_bind)) = NULL_TREE;
}
if (gimple_omp_for_combined_into_p (stmt))