aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-07-29 19:45:42 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-07-29 19:45:42 +0200
commit2514265077f4260ae10377791317c6754b3292df (patch)
treecc238d8f70d98c37fa0b8f86e59aeaeb9dd01f24 /gcc
parent8984005841121ca4d6336da74d64e5ebe89ab5ea (diff)
downloadgcc-2514265077f4260ae10377791317c6754b3292df.zip
gcc-2514265077f4260ae10377791317c6754b3292df.tar.gz
gcc-2514265077f4260ae10377791317c6754b3292df.tar.bz2
re PR middle-end/49897 (nesting lastprivate gives incorrect result)
PR middle-end/49897 PR middle-end/49898 * omp-low.c (use_pointer_for_field): If disallowing copy-in/out in nested parallel and outer is a gimple_reg, mark it as addressable and set its bit in task_shared_vars bitmap too. * testsuite/libgomp.c/pr49897-1.c: New test. * testsuite/libgomp.c/pr49897-2.c: New test. * testsuite/libgomp.c/pr49898-1.c: New test. * testsuite/libgomp.c/pr49898-2.c: New test. From-SVN: r176945
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/omp-low.c6
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 738144d..de98034 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/49897
+ PR middle-end/49898
+ * omp-low.c (use_pointer_for_field): If disallowing copy-in/out
+ in nested parallel and outer is a gimple_reg, mark it as addressable
+ and set its bit in task_shared_vars bitmap too.
+
2011-07-29 Uros Bizjak <ubizjak@gmail.com>
* config/i386/predicates.md (tp_or_register_operand): Remove predicate.
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index ccd248c..0376d92 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -781,7 +781,7 @@ use_pointer_for_field (tree decl, omp_context *shared_ctx)
break;
if (c)
- return true;
+ goto maybe_mark_addressable_and_ret;
}
}
@@ -791,7 +791,9 @@ use_pointer_for_field (tree decl, omp_context *shared_ctx)
returns, the task hasn't necessarily terminated. */
if (!TREE_READONLY (decl) && is_task_ctx (shared_ctx))
{
- tree outer = maybe_lookup_decl_in_outer_ctx (decl, shared_ctx);
+ tree outer;
+ maybe_mark_addressable_and_ret:
+ outer = maybe_lookup_decl_in_outer_ctx (decl, shared_ctx);
if (is_gimple_reg (outer))
{
/* Taking address of OUTER in lower_send_shared_vars