summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-18 16:43:28 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-09-18 16:43:28 +0000
commit66579ffae2db9814260d91853357cf3f7e2a9453 (patch)
tree29355c71634ce536e2f8aaf0e6ebc5adb9ec9423 /libgomp
parent8b4e342747ab9d0d6a896b174f36d2ad285c6626 (diff)
downloadgcc-66579ffae2db9814260d91853357cf3f7e2a9453.tar.gz
PR c++/63248
* semantics.c (finish_omp_clauses): Don't call cp_omp_mappable_type on type of type dependent expressions, and don't call it if handle_omp_array_sections has kept TREE_LIST because something was type dependent. * pt.c (tsubst_expr) <case OMP_TARGET, case OMP_TARGET_DATA>: Use keep_next_level, begin_omp_structured_block and finish_omp_structured_block instead of push_stmt_list and pop_stmt_list. libgomp/ * testsuite/libgomp.c++/pr63248.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215359 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr63248.C62
2 files changed, 67 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index ee73689e702..72caab9ac8b 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2014-09-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/63248
+ * testsuite/libgomp.c++/pr63248.C: New test.
+
2014-08-04 Jakub Jelinek <jakub@redhat.com>
* task.c (GOMP_taskgroup_end): If taskgroup->num_children
diff --git a/libgomp/testsuite/libgomp.c++/pr63248.C b/libgomp/testsuite/libgomp.c++/pr63248.C
new file mode 100644
index 00000000000..48d3f0af797
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr63248.C
@@ -0,0 +1,62 @@
+// PR c++/63248
+// { dg-do run }
+
+int *v;
+
+template <typename T>
+T
+foo (T A, T B)
+{
+ T a = 2;
+ T b = 4;
+
+#pragma omp target map(v[a:b])
+ v[a] = 1;
+
+#pragma omp target map(v[A:B])
+ v[a] = 2;
+
+#pragma omp target map(A)
+ A = 19;
+ return A;
+}
+
+template <int N>
+int
+bar (int A, int B)
+{
+#pragma omp target map(A)
+ A = 8;
+ if (A != 8)
+ __builtin_abort ();
+#pragma omp target map(A, B)
+ {
+ A = 1;
+ B = 2;
+ }
+ return A + B;
+}
+
+int
+baz (int A, int B)
+{
+#pragma omp target map(A)
+ A = 8;
+ if (A != 8)
+ __builtin_abort ();
+#pragma omp target map(A, B)
+ {
+ A = 1;
+ B = 2;
+ }
+ return A + B;
+}
+
+int
+main ()
+{
+ int a[10] = { 0 };
+ v = a;
+ if (foo (1, 5) != 19 || v[2] != 2 || bar<0> (5, 7) != 3 || baz (5, 7) != 3)
+ __builtin_abort ();
+}