From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120788 invoked by alias); 14 Apr 2016 13:36:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 120773 invoked by uid 89); 14 Apr 2016 13:36:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=4312, 20,8, 43,12, 58137 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 14 Apr 2016 13:36:38 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1aqhRi-0007V8-82 from Thomas_Schwinge@mentor.com ; Thu, 14 Apr 2016 06:36:34 -0700 Received: from hertz.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Thu, 14 Apr 2016 14:36:32 +0100 From: Thomas Schwinge To: Bernd Schmidt , Martin Jambor , Jakub Jelinek , Subject: Re: Splitting up gcc/omp-low.c? In-Reply-To: <570E8DE3.6070007@redhat.com> References: <20151207111758.GA24234@virgil.suse.cz> <20151207112243.GF24234@virgil.suse.cz> <20151209131930.GS5675@tucnak.redhat.com> <87si3b4mk3.fsf@kepler.schwinge.homeip.net> <5668638A.5030500@redhat.com> <20151210080835.GX5675@tucnak.redhat.com> <87y48o5toc.fsf@hertz.schwinge.homeip.net> <87twj54hx6.fsf@hertz.schwinge.homeip.net> <570E8417.3080208@redhat.com> <87r3e94cku.fsf@hertz.schwinge.homeip.net> <570E8DE3.6070007@redhat.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 14 Apr 2016 13:36:00 -0000 Message-ID: <87k2k048ir.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2016-04/txt/msg00661.txt.bz2 Hi! On Wed, 13 Apr 2016 20:20:19 +0200, Bernd Schmidt wro= te: > On 04/13/2016 07:56 PM, Thomas Schwinge wrote: > > 0001-Split-up-gcc-omp-low.c-plain.patch.xz attached. >=20 > That looks much better. However, the //OMPWHATEVER comments are not=20 > really all that helpful. They're helpful in the word-diff patch, as they show where I moved stuff. I agree that they can't serve this purpose in the line-diff patch. > I think the next step would be to clear out all=20 > this stuff including the OMPCUT markers I think the first step would be to get agreement on the several questions that I posted yesterday. That is, which stuff to move, into which files, how to structure it all, and so on. That's what I hoped the word-diff patch would help with. Everything else sounds a bit like busywork to me; that is: > start with an=20 > initial patch that includes everything that actually modifies code=20 > rather than moving it (omp_is_reference seems to be the major thing here). I don't know how meaningful it is to create/discuss/review/commit the following patch until the overall approach has been agreed upon? commit 8ac6b83350022c74bb2af8006e51f3620889e7c1 Author: Thomas Schwinge Date: Thu Apr 14 15:25:24 2016 +0200 gcc/omp-low.c:is_reference -> gcc/omp-low.h:omp_is_reference =20=20=20=20 gcc/ * omp-low.h: Include "langhooks.h". Define omp_is_reference here, and... * omp-low.c: ... don't define is_reference here. Adjust all users. --- gcc/omp-low.c | 102 +++++++++++++++++++++++++++---------------------------= ---- gcc/omp-low.h | 10 ++++++ 2 files changed, 57 insertions(+), 55 deletions(-) diff --git gcc/omp-low.c gcc/omp-low.c index 7335abc..bb9c61e 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -1039,21 +1039,13 @@ is_variable_sized (const_tree expr) return !TREE_CONSTANT (TYPE_SIZE_UNIT (TREE_TYPE (expr))); } =20 -/* Return true if DECL is a reference type. */ - -static inline bool -is_reference (tree decl) -{ - return lang_hooks.decls.omp_privatize_by_reference (decl); -} - /* Return the type of a decl. If the decl is reference type, return its base type. */ static inline tree get_base_type (tree decl) { tree type =3D TREE_TYPE (decl); - if (is_reference (decl)) + if (omp_is_reference (decl)) type =3D TREE_TYPE (type); return type; } @@ -1348,7 +1340,7 @@ build_outer_var_ref (tree var, omp_context *ctx, bool= lastprivate =3D false) } x =3D lookup_decl (var, outer); } - else if (is_reference (var)) + else if (omp_is_reference (var)) /* This can happen with orphaned constructs. If var is reference, it = is possible it is shared and as such valid. */ x =3D var; @@ -1371,7 +1363,7 @@ build_outer_var_ref (tree var, omp_context *ctx, bool= lastprivate =3D false) } } =20 - if (is_reference (var)) + if (omp_is_reference (var)) x =3D build_simple_mem_ref (x); =20 return x; @@ -1433,7 +1425,7 @@ install_var_field (tree var, bool by_ref, int mask, o= mp_context *ctx, if (base_pointers_restrict) type =3D build_qualified_type (type, TYPE_QUAL_RESTRICT); } - else if ((mask & 3) =3D=3D 1 && is_reference (var)) + else if ((mask & 3) =3D=3D 1 && omp_is_reference (var)) type =3D TREE_TYPE (type); =20 field =3D build_decl (DECL_SOURCE_LOCATION (var), @@ -1904,7 +1896,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx, if ((! TREE_READONLY (decl) && !OMP_CLAUSE_SHARED_READONLY (c)) || TREE_ADDRESSABLE (decl) || by_ref - || is_reference (decl)) + || omp_is_reference (decl)) { by_ref =3D use_pointer_for_field (decl, ctx); install_var_field (decl, by_ref, 3, ctx); @@ -1954,7 +1946,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx, && is_gimple_omp_offloaded (ctx->stmt)) { if (OMP_CLAUSE_CODE (c) =3D=3D OMP_CLAUSE_FIRSTPRIVATE) - install_var_field (decl, !is_reference (decl), 3, ctx); + install_var_field (decl, !omp_is_reference (decl), 3, ctx); else if (TREE_CODE (TREE_TYPE (decl)) =3D=3D ARRAY_TYPE) install_var_field (decl, true, 3, ctx); else @@ -1973,7 +1965,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx, by_ref =3D use_pointer_for_field (decl, NULL); =20 if (is_task_ctx (ctx) - && (global || by_ref || is_reference (decl))) + && (global || by_ref || omp_is_reference (decl))) { install_var_field (decl, false, 1, ctx); if (!global) @@ -4673,10 +4665,10 @@ lower_rec_input_clauses (tree clauses, gimple_seq *= ilist, gimple_seq *dlist, tree ref =3D build_outer_var_ref (var, ctx); /* For ref build_outer_var_ref already performs this. */ if (TREE_CODE (d) =3D=3D INDIRECT_REF) - gcc_assert (is_reference (var)); + gcc_assert (omp_is_reference (var)); else if (TREE_CODE (d) =3D=3D ADDR_EXPR) ref =3D build_fold_addr_expr (ref); - else if (is_reference (var)) + else if (omp_is_reference (var)) ref =3D build_fold_addr_expr (ref); ref =3D fold_convert_loc (clause_loc, ptype, ref); if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) @@ -4840,7 +4832,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *il= ist, gimple_seq *dlist, gimplify_assign (ptr, x, ilist); } } - else if (is_reference (var)) + else if (omp_is_reference (var)) { /* For references that are being privatized for Fortran, allocate new backing storage for the new pointer @@ -5007,7 +4999,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *il= ist, gimple_seq *dlist, case OMP_CLAUSE_FIRSTPRIVATE: if (is_task_ctx (ctx)) { - if (is_reference (var) || is_variable_sized (var)) + if (omp_is_reference (var) || is_variable_sized (var)) goto do_dtor; else if (is_global_var (maybe_lookup_decl_in_outer_ctx (var, ctx)) @@ -5135,14 +5127,14 @@ lower_rec_input_clauses (tree clauses, gimple_seq *= ilist, gimple_seq *dlist, gimple *tseq; x =3D build_outer_var_ref (var, ctx); =20 - if (is_reference (var) + if (omp_is_reference (var) && !useless_type_conversion_p (TREE_TYPE (placeholder), TREE_TYPE (x))) x =3D build_fold_addr_expr_loc (clause_loc, x); SET_DECL_VALUE_EXPR (placeholder, x); DECL_HAS_VALUE_EXPR_P (placeholder) =3D 1; tree new_vard =3D new_var; - if (is_reference (var)) + if (omp_is_reference (var)) { gcc_assert (TREE_CODE (new_var) =3D=3D MEM_REF); new_vard =3D TREE_OPERAND (new_var, 0); @@ -5200,7 +5192,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *il= ist, gimple_seq *dlist, for it because it is undesirable if SIMD arrays are used. But if they aren't used, we need to emit the deferred initialization now. */ - else if (is_reference (var) && is_simd) + else if (omp_is_reference (var) && is_simd) handle_simd_reference (clause_loc, new_vard, ilist); x =3D lang_hooks.decls.omp_clause_default_ctor (c, unshare_expr (new_var), @@ -5236,7 +5228,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *il= ist, gimple_seq *dlist, code =3D PLUS_EXPR; =20 tree new_vard =3D new_var; - if (is_simd && is_reference (var)) + if (is_simd && omp_is_reference (var)) { gcc_assert (TREE_CODE (new_var) =3D=3D MEM_REF); new_vard =3D TREE_OPERAND (new_var, 0); @@ -5263,7 +5255,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *il= ist, gimple_seq *dlist, } else { - if (is_reference (var) && is_simd) + if (omp_is_reference (var) && is_simd) handle_simd_reference (clause_loc, new_vard, ilist); gimplify_assign (new_var, x, ilist); if (is_simd) @@ -5514,7 +5506,7 @@ lower_lastprivate_clauses (tree clauses, tree predica= te, gimple_seq *stmt_list, } if (!x) x =3D build_outer_var_ref (var, ctx, true); - if (is_reference (var)) + if (omp_is_reference (var)) new_var =3D build_simple_mem_ref_loc (clause_loc, new_var); x =3D lang_hooks.decls.omp_clause_assign_op (c, x, new_var); gimplify_and_add (x, stmt_list); @@ -5645,7 +5637,7 @@ lower_oacc_reductions (location_t loc, tree clauses, = tree level, bool inner, && maybe_lookup_field (orig, outer) && !is_private) { ref_to_res =3D build_receiver_ref (orig, false, outer); - if (is_reference (orig)) + if (omp_is_reference (orig)) ref_to_res =3D build_simple_mem_ref (ref_to_res); =20 tree type =3D TREE_TYPE (var); @@ -5666,7 +5658,7 @@ lower_oacc_reductions (location_t loc, tree clauses, = tree level, bool inner, if (!ref_to_res) ref_to_res =3D integer_zero_node; =20 - if (is_reference (orig)) + if (omp_is_reference (orig)) { tree type =3D TREE_TYPE (var); const char *id =3D IDENTIFIER_POINTER (DECL_NAME (var)); @@ -5821,7 +5813,7 @@ lower_reduction_clauses (tree clauses, gimple_seq *st= mt_seqp, omp_context *ctx) } } new_var =3D lookup_decl (var, ctx); - if (var =3D=3D OMP_CLAUSE_DECL (c) && is_reference (var)) + if (var =3D=3D OMP_CLAUSE_DECL (c) && omp_is_reference (var)) new_var =3D build_simple_mem_ref_loc (clause_loc, new_var); ref =3D build_outer_var_ref (var, ctx); code =3D OMP_CLAUSE_REDUCTION_CODE (c); @@ -5875,7 +5867,7 @@ lower_reduction_clauses (tree clauses, gimple_seq *st= mt_seqp, omp_context *ctx) if (TREE_CODE (d) =3D=3D INDIRECT_REF) { new_var =3D build_simple_mem_ref_loc (clause_loc, new_var); - gcc_assert (is_reference (var) && var =3D=3D orig_var); + gcc_assert (omp_is_reference (var) && var =3D=3D orig_var); } else if (TREE_CODE (d) =3D=3D ADDR_EXPR) { @@ -5888,7 +5880,7 @@ lower_reduction_clauses (tree clauses, gimple_seq *st= mt_seqp, omp_context *ctx) else { gcc_assert (orig_var =3D=3D var); - if (is_reference (var)) + if (omp_is_reference (var)) ref =3D build_fold_addr_expr (ref); } if (DECL_P (v)) @@ -5962,7 +5954,7 @@ lower_reduction_clauses (tree clauses, gimple_seq *st= mt_seqp, omp_context *ctx) { tree placeholder =3D OMP_CLAUSE_REDUCTION_PLACEHOLDER (c); =20 - if (is_reference (var) + if (omp_is_reference (var) && !useless_type_conversion_p (TREE_TYPE (placeholder), TREE_TYPE (ref))) ref =3D build_fold_addr_expr_loc (clause_loc, ref); @@ -6030,7 +6022,7 @@ lower_copyprivate_clauses (tree clauses, gimple_seq *= slist, gimple_seq *rlist, ref); ref =3D build_fold_indirect_ref_loc (clause_loc, ref); } - if (is_reference (var)) + if (omp_is_reference (var)) { ref =3D fold_convert_loc (clause_loc, TREE_TYPE (new_var), ref); ref =3D build_simple_mem_ref_loc (clause_loc, ref); @@ -6169,7 +6161,7 @@ lower_send_clauses (tree clauses, gimple_seq *ilist, = gimple_seq *olist, break; =20 case OMP_CLAUSE_LASTPRIVATE: - if (by_ref || is_reference (val)) + if (by_ref || omp_is_reference (val)) { if (OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE (c)) continue; @@ -6186,7 +6178,7 @@ lower_send_clauses (tree clauses, gimple_seq *ilist, = gimple_seq *olist, case OMP_CLAUSE_REDUCTION: do_in =3D true; if (val =3D=3D OMP_CLAUSE_DECL (c)) - do_out =3D !(by_ref || is_reference (val)); + do_out =3D !(by_ref || omp_is_reference (val)); else by_ref =3D TREE_CODE (TREE_TYPE (val)) =3D=3D ARRAY_TYPE; break; @@ -8829,7 +8821,7 @@ expand_omp_for_generic (struct omp_region *region, && !OMP_CLAUSE_LINEAR_NO_COPYIN (c)) { tree d =3D OMP_CLAUSE_DECL (c); - bool is_ref =3D is_reference (d); + bool is_ref =3D omp_is_reference (d); tree t =3D d, a, dest; if (is_ref) t =3D build_simple_mem_ref_loc (OMP_CLAUSE_LOCATION (c), t); @@ -9478,7 +9470,7 @@ expand_omp_for_static_nochunk (struct omp_region *reg= ion, && !OMP_CLAUSE_LINEAR_NO_COPYIN (c)) { tree d =3D OMP_CLAUSE_DECL (c); - bool is_ref =3D is_reference (d); + bool is_ref =3D omp_is_reference (d); tree t =3D d, a, dest; if (is_ref) t =3D build_simple_mem_ref_loc (OMP_CLAUSE_LOCATION (c), t); @@ -9977,7 +9969,7 @@ expand_omp_for_static_chunk (struct omp_region *regio= n, && !OMP_CLAUSE_LINEAR_NO_COPYIN (c)) { tree d =3D OMP_CLAUSE_DECL (c); - bool is_ref =3D is_reference (d); + bool is_ref =3D omp_is_reference (d); tree t =3D d, a, dest; if (is_ref) t =3D build_simple_mem_ref_loc (OMP_CLAUSE_LOCATION (c), t); @@ -15419,7 +15411,7 @@ create_task_copyfn (gomp_task *task_stmt, omp_conte= xt *ctx) sf =3D *tcctx.cb.decl_map->get (sf); src =3D build_simple_mem_ref_loc (loc, sarg); src =3D omp_build_component_ref (src, sf); - if (use_pointer_for_field (decl, NULL) || is_reference (decl)) + if (use_pointer_for_field (decl, NULL) || omp_is_reference (decl)) src =3D build_simple_mem_ref_loc (loc, src); } else @@ -15888,7 +15880,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) if (OMP_CLAUSE_CODE (c) =3D=3D OMP_CLAUSE_FIRSTPRIVATE) { gcc_assert (is_gimple_omp_oacc (ctx->stmt)); - if (is_reference (new_var)) + if (omp_is_reference (new_var)) { /* Create a local object to hold the instance value. */ @@ -15916,7 +15908,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) goto oacc_firstprivate; map_cnt++; var =3D OMP_CLAUSE_DECL (c); - if (!is_reference (var) + if (!omp_is_reference (var) && !is_gimple_reg_type (TREE_TYPE (var))) { tree new_var =3D lookup_decl (var, ctx); @@ -16122,7 +16114,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) else if (OMP_CLAUSE_CODE (c) =3D=3D OMP_CLAUSE_FIRSTPRIVATE) { gcc_assert (is_gimple_omp_oacc (ctx->stmt)); - if (!is_reference (var)) + if (!omp_is_reference (var)) { if (is_gimple_reg (var) && OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT (c)) @@ -16268,7 +16260,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) if (is_oacc_parallel (ctx)) goto oacc_firstprivate_map; ovar =3D OMP_CLAUSE_DECL (c); - if (is_reference (ovar)) + if (omp_is_reference (ovar)) talign =3D TYPE_ALIGN_UNIT (TREE_TYPE (TREE_TYPE (ovar))); else talign =3D DECL_ALIGN_UNIT (ovar); @@ -16276,7 +16268,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) x =3D build_sender_ref (ovar, ctx); tkind =3D GOMP_MAP_FIRSTPRIVATE; type =3D TREE_TYPE (ovar); - if (is_reference (ovar)) + if (omp_is_reference (ovar)) type =3D TREE_TYPE (type); if ((INTEGRAL_TYPE_P (type) && TYPE_PRECISION (type) <=3D POINTER_SIZE) @@ -16284,7 +16276,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) { tkind =3D GOMP_MAP_FIRSTPRIVATE_INT; tree t =3D var; - if (is_reference (var)) + if (omp_is_reference (var)) t =3D build_simple_mem_ref (var); else if (OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT (c)) TREE_NO_WARNING (var) =3D 1; @@ -16293,7 +16285,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) t =3D fold_convert (TREE_TYPE (x), t); gimplify_assign (x, t, &ilist); } - else if (is_reference (var)) + else if (omp_is_reference (var)) gimplify_assign (x, var, &ilist); else if (is_gimple_reg (var)) { @@ -16312,7 +16304,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) } if (tkind =3D=3D GOMP_MAP_FIRSTPRIVATE_INT) s =3D size_int (0); - else if (is_reference (var)) + else if (omp_is_reference (var)) s =3D TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ovar))); else s =3D TYPE_SIZE_UNIT (TREE_TYPE (ovar)); @@ -16346,7 +16338,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) var =3D build_fold_addr_expr (var); else { - if (is_reference (ovar)) + if (omp_is_reference (ovar)) { type =3D TREE_TYPE (type); if (TREE_CODE (type) !=3D ARRAY_TYPE) @@ -16425,13 +16417,13 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, om= p_context *ctx) if (is_gimple_omp_oacc (ctx->stmt)) break; var =3D OMP_CLAUSE_DECL (c); - if (is_reference (var) + if (omp_is_reference (var) || is_gimple_reg_type (TREE_TYPE (var))) { tree new_var =3D lookup_decl (var, ctx); tree type; type =3D TREE_TYPE (var); - if (is_reference (var)) + if (omp_is_reference (var)) type =3D TREE_TYPE (type); if ((INTEGRAL_TYPE_P (type) && TYPE_PRECISION (type) <=3D POINTER_SIZE) @@ -16443,7 +16435,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) x =3D fold_convert (type, x); gimplify_expr (&x, &new_body, NULL, is_gimple_val, fb_rvalue); - if (is_reference (var)) + if (omp_is_reference (var)) { tree v =3D create_tmp_var_raw (type, get_name (var)); gimple_add_tmp_var (v); @@ -16457,7 +16449,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) } else { - x =3D build_receiver_ref (var, !is_reference (var), ctx); + x =3D build_receiver_ref (var, !omp_is_reference (var), ctx); gimplify_expr (&x, &new_body, NULL, is_gimple_val, fb_rvalue); gimple_seq_add_stmt (&new_body, @@ -16481,7 +16473,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) if (is_gimple_omp_oacc (ctx->stmt)) break; var =3D OMP_CLAUSE_DECL (c); - if (is_reference (var)) + if (omp_is_reference (var)) { location_t clause_loc =3D OMP_CLAUSE_LOCATION (c); tree new_var =3D lookup_decl (var, ctx); @@ -16536,7 +16528,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) { tree type =3D TREE_TYPE (var); tree new_var =3D lookup_decl (var, ctx); - if (is_reference (var)) + if (omp_is_reference (var)) { type =3D TREE_TYPE (type); if (TREE_CODE (type) !=3D ARRAY_TYPE) @@ -16625,7 +16617,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) offset)); } else - is_ref =3D is_reference (var); + is_ref =3D omp_is_reference (var); if (OMP_CLAUSE_MAP_KIND (c) =3D=3D GOMP_MAP_FIRSTPRIVATE_REFERENCE) is_ref =3D false; bool ref_to_array =3D false; @@ -16705,7 +16697,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_= context *ctx) gimple_seq_add_stmt (&new_body, gimple_build_assign (new_pvar, x)); } - else if (is_reference (var) && !is_gimple_omp_oacc (ctx->stmt)) + else if (omp_is_reference (var) && !is_gimple_omp_oacc (ctx->stmt)) { location_t clause_loc =3D OMP_CLAUSE_LOCATION (c); tree new_var =3D lookup_decl (var, ctx); diff --git gcc/omp-low.h gcc/omp-low.h index b1f7885..a7bfc03 100644 --- gcc/omp-low.h +++ gcc/omp-low.h @@ -20,6 +20,8 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_OMP_LOW_H #define GCC_OMP_LOW_H =20 +#include "langhooks.h" + struct omp_region; =20 extern tree find_omp_clause (tree, enum omp_clause_code); @@ -41,4 +43,12 @@ extern int get_oacc_fn_dim_size (tree, int); extern GTY(()) vec *offload_funcs; extern GTY(()) vec *offload_vars; =20 +/* Return true if DECL is a reference type. */ + +static inline bool +omp_is_reference (tree decl) +{ + return lang_hooks.decls.omp_privatize_by_reference (decl); +} + #endif /* GCC_OMP_LOW_H */ Gr=C3=BC=C3=9Fe Thomas