diff options
author | Jakub Jelinek <jakub@redhat.com> | 2011-07-29 19:45:42 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2011-07-29 19:45:42 +0200 |
commit | 2514265077f4260ae10377791317c6754b3292df (patch) | |
tree | cc238d8f70d98c37fa0b8f86e59aeaeb9dd01f24 /gcc/omp-low.c | |
parent | 8984005841121ca4d6336da74d64e5ebe89ab5ea (diff) | |
download | gcc-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/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 |