diff options
author | tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-29 09:07:55 +0000 |
---|---|---|
committer | tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-29 09:07:55 +0000 |
commit | 1e71966213373c01cca22ab4afacd4ec97f9917a (patch) | |
tree | ac33ee316b6b522dd641c67c7578efe8d5e4fb07 | |
parent | add534fe16bacdca53011580fa72048f2e080b3f (diff) |
Fix OpenMP's target update directive in templated code.
FAIL: g++.dg/gomp/tpl-target-update.C -std=c++98 (internal compiler error)
FAIL: g++.dg/gomp/tpl-target-update.C -std=c++98 (test for excess errors)
FAIL: g++.dg/gomp/tpl-target-update.C -std=c++11 (internal compiler error)
FAIL: g++.dg/gomp/tpl-target-update.C -std=c++11 (test for excess errors)
FAIL: g++.dg/gomp/tpl-target-update.C -std=c++14 (internal compiler error)
FAIL: g++.dg/gomp/tpl-target-update.C -std=c++14 (test for excess errors)
[...]/source-gcc/gcc/testsuite/g++.dg/gomp/tpl-target-update.C: In instantiation of 'void f(T, T) [with T = int]':
[...]/source-gcc/gcc/testsuite/g++.dg/gomp/tpl-target-update.C:19:9: required from here
[...]/source-gcc/gcc/testsuite/g++.dg/gomp/tpl-target-update.C:10:9: internal compiler error: tree check: expected oacc_parallel or oacc_kernels or oacc_data or oacc_host_data or omp_parallel or omp_task or omp_for or omp_simd or cilk_simd or cilk_for or omp_distribute or oacc_loop or omp_teams or omp_target_data or omp_target or omp_sections or omp_single, have omp_target_update in tsubst_expr, at cp/pt.c:14209
0xf5aae1 tree_range_check_failed(tree_node const*, char const*, int, char const*, tree_code, tree_code)
[...]/source-gcc/gcc/tree.c:9384
0x66e201 tree_range_check
[...]/source-gcc/gcc/tree.h:2979
0x66e201 tsubst_expr
[...]/source-gcc/gcc/cp/pt.c:14209
0x6695e3 tsubst_expr
[...]/source-gcc/gcc/cp/pt.c:13752
0x66ac07 tsubst_expr
[...]/source-gcc/gcc/cp/pt.c:13938
0x667c41 instantiate_decl(tree_node*, int, bool)
[...]/source-gcc/gcc/cp/pt.c:20367
0x6ae386 instantiate_pending_templates(int)
[...]/source-gcc/gcc/cp/pt.c:20484
0x6edc3d cp_write_global_declarations()
[...]/source-gcc/gcc/cp/decl2.c:4456
Backport from trunk r222564:
gcc/cp/
* pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use
OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES.
gcc/testsuite/
* g++.dg/gomp/tpl-target-update.C: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@222565 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/gomp/tpl-target-update.C | 20 |
4 files changed, 38 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a707f5ad889..33f543ac185 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2015-04-29 Thomas Schwinge <thomas@codesourcery.com> + + Backport from trunk r222564: + + 2015-04-29 Thomas Schwinge <thomas@codesourcery.com> + + * pt.c (tsubst_expr) <OMP_TARGET_UPDATE>: Use + OMP_TARGET_UPDATE_CLAUSES instead of OMP_CLAUSES. + 2015-04-28 Jason Merrill <jason@redhat.com> PR c++/65896 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 28a85ebeeb7..d65c9d508b6 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -14249,7 +14249,7 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl, tmp = tsubst_omp_clauses (OMP_TARGET_UPDATE_CLAUSES (t), false, args, complain, in_decl); t = copy_node (t); - OMP_CLAUSES (t) = tmp; + OMP_TARGET_UPDATE_CLAUSES (t) = tmp; add_stmt (t); break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 00196ff5e3d..767b73a7b8f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-04-29 Thomas Schwinge <thomas@codesourcery.com> + + Backport from trunk r222564: + + 2015-04-29 Thomas Schwinge <thomas@codesourcery.com> + + * g++.dg/gomp/tpl-target-update.C: New file. + 2015-04-28 Bill Schmidt <wschmidt@linux.vnet.ibm.com> Backport from mainline diff --git a/gcc/testsuite/g++.dg/gomp/tpl-target-update.C b/gcc/testsuite/g++.dg/gomp/tpl-target-update.C new file mode 100644 index 00000000000..6226ebf9ca0 --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/tpl-target-update.C @@ -0,0 +1,20 @@ +// { dg-do compile } + +template <typename T> +void f(T A, T B) +{ + extern int *v; + T a = 2; + T b = 4; + +#pragma omp target update to(v[a:b]) + v[a] = 0; + +#pragma omp target update to(v[A:B]) + v[a] = 0; +} + +void g() +{ + f(1, 5); +} |