This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- From: Ilya Verbin <iverbin at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Tue, 23 Jun 2015 17:54:48 +0300
- Subject: Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Authentication-results: sourceware.org; auth=none
- References: <20150615122037 dot GA45068 at msticlxl57 dot ims dot intel dot com> <20150615130609 dot GR10247 at tucnak dot redhat dot com> <20150615161827 dot GB45068 at msticlxl57 dot ims dot intel dot com> <20150615162528 dot GU10247 at tucnak dot redhat dot com> <20150615194850 dot GC45068 at msticlxl57 dot ims dot intel dot com> <20150615195840 dot GZ10247 at tucnak dot redhat dot com> <20150619213514 dot GA23723 at msticlxl57 dot ims dot intel dot com> <20150623114043 dot GC18789 at msticlxl57 dot ims dot intel dot com> <20150623115139 dot GN10247 at tucnak dot redhat dot com>
On Tue, Jun 23, 2015 at 13:51:39 +0200, Jakub Jelinek wrote:
> > + /* Set dd on target to 0 for the further check. */
> > + #pragma omp target map(always to: dd)
> > + { dd; }
>
> This reminds me that:
> if (ctx->region_type == ORT_TARGET && !(n->value & GOVD_SEEN))
> remove = true;
> in gimplify.c is not what we want, if it is has GOMP_MAP_KIND_ALWAYS,
> then we shouldn't remove it even when it is not mentioned inside of the
> region's body, because it then has side-effects.
OK for gomp-4_1-branch?
gcc/
* gimplify.c (gimplify_adjust_omp_clauses): Don't remove map clause if
it has map-type-modifier always.
libgomp/
* testsuite/libgomp.c/target-11.c (main): Remove dd from target region.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 9b2347a..74fe60b 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6870,7 +6870,8 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, tree *list_p)
if (!DECL_P (decl))
break;
n = splay_tree_lookup (ctx->variables, (splay_tree_key) decl);
- if (ctx->region_type == ORT_TARGET && !(n->value & GOVD_SEEN))
+ if (ctx->region_type == ORT_TARGET && !(n->value & GOVD_SEEN)
+ && !(OMP_CLAUSE_MAP_KIND (c) & GOMP_MAP_FLAG_ALWAYS))
remove = true;
else if (DECL_SIZE (decl)
&& TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST
diff --git a/libgomp/testsuite/libgomp.c/target-11.c b/libgomp/testsuite/libgomp.c/target-11.c
index 4562d88..0fd183b 100644
--- a/libgomp/testsuite/libgomp.c/target-11.c
+++ b/libgomp/testsuite/libgomp.c/target-11.c
@@ -13,7 +13,7 @@ int main ()
/* Set dd on target to 0 for the further check. */
#pragma omp target map(always to: dd)
- { dd; }
+ ;
dd = 1;
#pragma omp target map(tofrom: aa) map(always to: bb) \
-- Ilya
- References:
- [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data
- Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data