aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimplify.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c9ee703..a40820b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-06-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/81130
+ * gimplify.c (omp_add_variable): Don't force GOVD_SEEN for types
+ with ctors/dtors if GOVD_SHARED is set.
+
2017-06-21 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.md (movti_aarch64):
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index cf82f95..13760c0 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6634,9 +6634,11 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree decl, unsigned int flags)
return;
/* Never elide decls whose type has TREE_ADDRESSABLE set. This means
- there are constructors involved somewhere. */
- if (TREE_ADDRESSABLE (TREE_TYPE (decl))
- || TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)))
+ there are constructors involved somewhere. Exception is a shared clause,
+ there is nothing privatized in that case. */
+ if ((flags & GOVD_SHARED) == 0
+ && (TREE_ADDRESSABLE (TREE_TYPE (decl))
+ || TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl))))
flags |= GOVD_SEEN;
n = splay_tree_lookup (ctx->variables, (splay_tree_key)decl);