aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-05-22 20:54:05 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-05-22 20:54:05 +0200
commite9e2ef9f2f1e037e0f3bc4990947e242106e43b9 (patch)
tree7824d1e6f2475b21c05bfc71e55b7adcb45da4f7 /gcc
parentc24783c49924474f54feb0c6038cba4719125634 (diff)
downloadgcc-e9e2ef9f2f1e037e0f3bc4990947e242106e43b9.zip
gcc-e9e2ef9f2f1e037e0f3bc4990947e242106e43b9.tar.gz
gcc-e9e2ef9f2f1e037e0f3bc4990947e242106e43b9.tar.bz2
re PR middle-end/80809 (Multi-free error for variable size array used within OpenMP task)
PR middle-end/80809 * gimplify.c (omp_add_variable): For GOVD_DEBUG_PRIVATE use GOVD_SHARED rather than GOVD_PRIVATE with it. (gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Expect GOVD_SHARED rather than GOVD_PRIVATE with GOVD_DEBUG_PRIVATE. * testsuite/libgomp.c/pr80809-1.c: New test. From-SVN: r248345
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimplify.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b69ffc0..cfa15c2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-05-22 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/80809
+ * gimplify.c (omp_add_variable): For GOVD_DEBUG_PRIVATE use
+ GOVD_SHARED rather than GOVD_PRIVATE with it.
+ (gimplify_adjust_omp_clauses_1, gimplify_adjust_omp_clauses): Expect
+ GOVD_SHARED rather than GOVD_PRIVATE with GOVD_DEBUG_PRIVATE.
+
PR middle-end/80853
* omp-low.c (lower_reduction_clauses): Pass OMP_CLAUSE_PRIVATE
as last argument to build_outer_var_ref for pointer bases of array
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 810d9f4..455a699 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6693,7 +6693,7 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags)
of PRIVATE. The sharing would take place via the pointer variable
which we remapped above. */
if (flags & GOVD_SHARED)
- flags = GOVD_PRIVATE | GOVD_DEBUG_PRIVATE
+ flags = GOVD_SHARED | GOVD_DEBUG_PRIVATE
| (flags & (GOVD_SEEN | GOVD_EXPLICIT));
/* We're going to make use of the TYPE_SIZE_UNIT at least in the
@@ -8616,7 +8616,7 @@ gimplify_adjust_omp_clauses_1 (splay_tree_node n, void *data)
return 0;
if (flags & GOVD_DEBUG_PRIVATE)
{
- gcc_assert ((flags & GOVD_DATA_SHARE_CLASS) == GOVD_PRIVATE);
+ gcc_assert ((flags & GOVD_DATA_SHARE_CLASS) == GOVD_SHARED);
private_debug = true;
}
else if (flags & GOVD_MAP)
@@ -8878,7 +8878,7 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, gimple_seq body, tree *list_p,
{
gcc_assert ((n->value & GOVD_DEBUG_PRIVATE) == 0
|| ((n->value & GOVD_DATA_SHARE_CLASS)
- == GOVD_PRIVATE));
+ == GOVD_SHARED));
OMP_CLAUSE_SET_CODE (c, OMP_CLAUSE_PRIVATE);
OMP_CLAUSE_PRIVATE_DEBUG (c) = 1;
}