aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libgomp
diff options
context:
space:
mode:
authorYiran Wang <yiran@google.com>2015-06-23 15:33:17 -0700
committerYiran Wang <yiran@google.com>2015-06-29 10:56:28 -0700
commit1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch)
tree3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/libgomp
parentf378ebf14df0952eae870c9865bab8326aa8f137 (diff)
downloadtoolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz
toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2
toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/libgomp')
-rw-r--r--gcc-4.9/libgomp/ChangeLog32
-rw-r--r--gcc-4.9/libgomp/configure.tgt2
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c++/pr63248.C62
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c/pr61200.c87
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.c/pr64734.c55
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.fortran/pr63938-1.f9014
-rw-r--r--gcc-4.9/libgomp/testsuite/libgomp.fortran/pr63938-2.f9018
7 files changed, 269 insertions, 1 deletions
diff --git a/gcc-4.9/libgomp/ChangeLog b/gcc-4.9/libgomp/ChangeLog
index d9d5db7c3..81c62da38 100644
--- a/gcc-4.9/libgomp/ChangeLog
+++ b/gcc-4.9/libgomp/ChangeLog
@@ -1,3 +1,35 @@
+2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/64734
+ * libgomp.c/pr64734.c: New test.
+
+2014-12-03 Uros Bizjak <ubizjak@gmail.com>
+
+ * configure.tgt (x86_64-*-linux*): Tune -m32 multilib to generic.
+
+2014-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2014-11-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/63938
+ * libgomp.fortran/pr63938-1.f90: New test.
+ * libgomp.fortran/pr63938-2.f90: New test.
+
+2014-10-30 Release Manager
+
+ * GCC 4.9.2 released.
+
+2014-10-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgomp/61200
+ * testsuite/libgomp.c/pr61200.c: New test.
+
+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/gcc-4.9/libgomp/configure.tgt b/gcc-4.9/libgomp/configure.tgt
index f9aab70ff..e4721dd70 100644
--- a/gcc-4.9/libgomp/configure.tgt
+++ b/gcc-4.9/libgomp/configure.tgt
@@ -83,7 +83,7 @@ if test $enable_linux_futex = yes; then
config_path="linux/x86 linux posix"
case " ${CC} ${CFLAGS} " in
*" -m32 "*)
- XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
+ XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
;;
esac
;;
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c++/pr63248.C b/gcc-4.9/libgomp/testsuite/libgomp.c++/pr63248.C
new file mode 100644
index 000000000..48d3f0af7
--- /dev/null
+++ b/gcc-4.9/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 ();
+}
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c/pr61200.c b/gcc-4.9/libgomp/testsuite/libgomp.c/pr61200.c
new file mode 100644
index 000000000..ba3ed37e0
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.c/pr61200.c
@@ -0,0 +1,87 @@
+/* PR libgomp/61200 */
+/* { dg-do run } */
+
+#include <omp.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+volatile int x;
+
+void
+foo ()
+{
+ int var = 1;
+ int i;
+
+ for (i = 0; i < 2; i++)
+ {
+ if (i == 1)
+ {
+ #pragma omp parallel num_threads(2)
+ if (x)
+ var++;
+ else
+ {
+ #pragma omp single
+ sleep (2);
+ }
+ }
+ else
+ {
+ #pragma omp task shared(var)
+ {
+ sleep (1);
+ var = 2;
+ }
+ }
+ }
+ #pragma omp taskwait
+ if (var != 2)
+ abort ();
+}
+
+void
+bar ()
+{
+ int var = 1;
+ int i;
+
+ for (i = 0; i < 2; i++)
+ {
+ if (i == 0)
+ {
+ #pragma omp task shared(var)
+ {
+ sleep (1);
+ var = 2;
+ }
+ }
+ else
+ {
+ #pragma omp parallel num_threads(2)
+ if (x)
+ var++;
+ else
+ {
+ #pragma omp single
+ sleep (2);
+ }
+ }
+ }
+ #pragma omp taskwait
+ if (var != 2)
+ abort ();
+}
+
+int
+main ()
+{
+ omp_set_nested (1);
+ #pragma omp parallel num_threads(2)
+ #pragma omp single
+ foo ();
+ #pragma omp parallel num_threads(2)
+ #pragma omp single
+ bar ();
+ return 0;
+}
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.c/pr64734.c b/gcc-4.9/libgomp/testsuite/libgomp.c/pr64734.c
new file mode 100644
index 000000000..457f481ae
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.c/pr64734.c
@@ -0,0 +1,55 @@
+/* PR middle-end/64734 */
+
+#include <stdlib.h>
+
+void
+foo (int *x, int *y)
+{
+ #pragma omp target map (alloc:x[0]) map (alloc:y[0:8])
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ if (y[i] != 2 + i)
+ break;
+ if (i != 8 || *x != 1)
+ *x = 6;
+ else
+ {
+ *x = 8;
+ for (i = 0; i < 8; i++)
+ y[i] = 9 + i;
+ }
+ }
+ #pragma omp target update from (y[0:8]) from (x[0])
+}
+
+void
+bar (void)
+{
+ int x = 1, y[32] = { 0 };
+ #pragma omp target data map (to:y[0:32]) map (to:x)
+ ;
+}
+
+int
+main ()
+{
+ int x = 1, y[8] = { 2, 3, 4, 5, 6, 7, 8, 9 }, i;
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ ;
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ {
+ #pragma omp target update from (y[0:8]) from (x)
+ }
+
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ foo (&x, &y[0]);
+
+ if (x != 8)
+ abort ();
+ for (i = 0; i < 8; i++)
+ if (y[i] != 9 + i)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.fortran/pr63938-1.f90 b/gcc-4.9/libgomp/testsuite/libgomp.fortran/pr63938-1.f90
new file mode 100644
index 000000000..27501b2f8
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.fortran/pr63938-1.f90
@@ -0,0 +1,14 @@
+! PR fortran/63938
+! { dg-do run }
+
+program pr63938_1
+ integer :: i, x(1)
+ x(1) = 0
+!$omp parallel do
+ do i = 1, 1000
+ !$omp atomic
+ x(1) = x(1) + 1
+ end do
+!$omp end parallel do
+ if (x(1) .ne. 1000) call abort
+end program pr63938_1
diff --git a/gcc-4.9/libgomp/testsuite/libgomp.fortran/pr63938-2.f90 b/gcc-4.9/libgomp/testsuite/libgomp.fortran/pr63938-2.f90
new file mode 100644
index 000000000..e5f37ba76
--- /dev/null
+++ b/gcc-4.9/libgomp/testsuite/libgomp.fortran/pr63938-2.f90
@@ -0,0 +1,18 @@
+! PR fortran/63938
+! { dg-do run }
+
+program pr63938_2
+ type t
+ integer :: x
+ end type
+ integer :: i
+ type(t) :: x
+ x%x = 0
+!$omp parallel do
+ do i = 1, 1000
+ !$omp atomic
+ x%x = x%x + 1
+ end do
+!$omp end parallel do
+ if (x%x .ne. 1000) call abort
+end program pr63938_2