diff options
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index a923e37..0b44588 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -1852,14 +1852,18 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) the receiver side will use them directly. */ if (is_global_var (maybe_lookup_decl_in_outer_ctx (decl, ctx))) break; - by_ref = use_pointer_for_field (decl, ctx); if (OMP_CLAUSE_SHARED_FIRSTPRIVATE (c)) - break; - if (! TREE_READONLY (decl) + { + use_pointer_for_field (decl, ctx); + break; + } + by_ref = use_pointer_for_field (decl, NULL); + if ((! TREE_READONLY (decl) && !OMP_CLAUSE_SHARED_READONLY (c)) || TREE_ADDRESSABLE (decl) || by_ref || is_reference (decl)) { + by_ref = use_pointer_for_field (decl, ctx); install_var_field (decl, by_ref, 3, ctx); install_var_local (decl, ctx); break; |