aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-02-06 11:34:53 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2013-02-06 11:34:53 +0100
commit6d840d998086aa54b0a43c45b7a323f0408bf308 (patch)
tree091d383fc8916e747be9e17db128fffaa6963396 /libgomp
parentca4a4fe903f536b400f1708437a69df637cf2c7f (diff)
downloadgcc-6d840d998086aa54b0a43c45b7a323f0408bf308.zip
gcc-6d840d998086aa54b0a43c45b7a323f0408bf308.tar.gz
gcc-6d840d998086aa54b0a43c45b7a323f0408bf308.tar.bz2
re PR c++/56217 (ICE: OpenMP: when combining shared() and a move constructor)
PR middle-end/56217 * omp-low.c (use_pointer_for_field): Return false if lower_send_shared_vars doesn't generate any copy-out code. * g++.dg/gomp/pr56217.C: New test. * testsuite/libgomp.c++/pr56217.C: New test. From-SVN: r195796
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c++/pr56217.C36
2 files changed, 41 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 2bbb789..b0dc764 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/56217
+ * testsuite/libgomp.c++/pr56217.C: New test.
+
2013-02-01 Alan Modra <amodra@gmail.com>
* task.c (GOMP_task, GOMP_taskwait): Comment.
diff --git a/libgomp/testsuite/libgomp.c++/pr56217.C b/libgomp/testsuite/libgomp.c++/pr56217.C
new file mode 100644
index 0000000..19da918
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/pr56217.C
@@ -0,0 +1,36 @@
+// PR middle-end/56217
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+extern "C" void abort ();
+
+template <typename T>
+struct ptr {
+ T *p;
+ ptr () : p () {}
+ ptr (ptr &) = delete;
+ ptr (ptr &&o) : p(o) {}
+ operator T * () { return p; }
+};
+
+int a[6] = { 100, 101, 102, 103, 104, 105 };
+
+static ptr<int>
+f ()
+{
+ ptr<int> pt;
+ #pragma omp task shared (pt)
+ pt.p = a + 2;
+ #pragma omp taskwait
+ return pt;
+}
+
+int
+main ()
+{
+ ptr<int> pt;
+ #pragma omp parallel
+ #pragma omp single
+ if (f () != a + 2 || *f () != 102)
+ abort ();
+}