aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-02-11 22:57:52 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-02-11 22:57:52 +0100
commit3ad6b2669b7a6d9cd1b12330fd7accd44fdd2154 (patch)
tree4a20f063b19d39a1b3b6f180cab2f0a734d92d9c /gcc
parentb058b753550ca9588b3961e75f6d30399f9d2c67 (diff)
downloadgcc-3ad6b2669b7a6d9cd1b12330fd7accd44fdd2154.zip
gcc-3ad6b2669b7a6d9cd1b12330fd7accd44fdd2154.tar.gz
gcc-3ad6b2669b7a6d9cd1b12330fd7accd44fdd2154.tar.bz2
re PR middle-end/39154 (Miscompilation of VLAs in nested parallel regions)
PR middle-end/39154 * gimplify.c (omp_notice_variable): If adding GOVD_SEEN bit to variable length decl's flags, add it also to its pointer replacement variable. * testsuite/libgomp.c/pr39154.c: New test. From-SVN: r144111
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/gimplify.c14
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 71c859e..8f65c78 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/39154
+ * gimplify.c (omp_notice_variable): If adding GOVD_SEEN
+ bit to variable length decl's flags, add it also to its
+ pointer replacement variable.
+
2009-02-11 Uros Bizjak <ubizjak@gmail.com>
Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 4af5029..ae12424 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -5308,6 +5308,20 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code)
goto do_outer;
}
+ if ((n->value & (GOVD_SEEN | GOVD_LOCAL)) == 0
+ && (flags & (GOVD_SEEN | GOVD_LOCAL)) == GOVD_SEEN
+ && DECL_SIZE (decl)
+ && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
+ {
+ splay_tree_node n2;
+ tree t = DECL_VALUE_EXPR (decl);
+ gcc_assert (TREE_CODE (t) == INDIRECT_REF);
+ t = TREE_OPERAND (t, 0);
+ gcc_assert (DECL_P (t));
+ n2 = splay_tree_lookup (ctx->variables, (splay_tree_key) t);
+ n2->value |= GOVD_SEEN;
+ }
+
shared = ((flags | n->value) & GOVD_SHARED) != 0;
ret = lang_hooks.decls.omp_disregard_value_expr (decl, shared);