diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-03-16 17:10:17 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-03-16 17:10:17 +0100 |
commit | 3713412b8a5e374dcb3230828f38339b78846236 (patch) | |
tree | a64a310307574457e8ea86438903565f13be9c0e /gcc/omp-low.c | |
parent | ae8b772f95915483e4da49c0d7d4b07ce367c7ed (diff) | |
download | gcc-3713412b8a5e374dcb3230828f38339b78846236.zip gcc-3713412b8a5e374dcb3230828f38339b78846236.tar.gz gcc-3713412b8a5e374dcb3230828f38339b78846236.tar.bz2 |
re PR middle-end/65431 (Invalid read of size 8 at 0x105DBBF8: delete_omp_context(unsigned long) (omp-low.c:1586))
PR middle-end/65431
* omp-low.c (delete_omp_context): Only splay_tree_delete
reduction_map in GIMPLE_OMP_TARGET is_gimple_omp_offloaded
is_gimple_omp_oacc contexts. Don't look at ctx->outer.
From-SVN: r221459
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 2d64a74..1ecc6f8 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -1580,10 +1580,12 @@ delete_omp_context (splay_tree_value value) splay_tree_delete (ctx->field_map); if (ctx->sfield_map) splay_tree_delete (ctx->sfield_map); + /* Reduction map is copied to nested contexts, so only delete it in the + owner. */ if (ctx->reduction_map - /* Shared over several omp_contexts. */ - && (ctx->outer == NULL - || ctx->reduction_map != ctx->outer->reduction_map)) + && gimple_code (ctx->stmt) == GIMPLE_OMP_TARGET + && is_gimple_omp_offloaded (ctx->stmt) + && is_gimple_omp_oacc (ctx->stmt)) splay_tree_delete (ctx->reduction_map); /* We hijacked DECL_ABSTRACT_ORIGIN earlier. We need to clear it before |