aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2020-03-05 14:47:08 +0100
committerTobias Burnus <tobias@codesourcery.com>2020-03-05 14:47:08 +0100
commit34fdecb2eb442640e3f5ad40320bd5859392c9f7 (patch)
tree1888dfe450cca45c5f1b4cf70bb6ec2fba62e1e4 /libgomp
parent526632f93d07589d0e8ebe401b4761ff0159d0df (diff)
parent7beafc829c5b122298093ba517023015611aeca8 (diff)
downloadgcc-34fdecb2eb442640e3f5ad40320bd5859392c9f7.zip
gcc-34fdecb2eb442640e3f5ad40320bd5859392c9f7.tar.gz
gcc-34fdecb2eb442640e3f5ad40320bd5859392c9f7.tar.bz2
Merge remote-tracking branch 'origin/releases/gcc-9' into devel/omp/gcc-9
Update all GCC 9 commits between tag 'releases/gcc-9.2.0' (r9-7613) and today's GCC 9 branch (r9-8340-g7beafc829c5b122298093ba517023015611aeca8).
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog58
-rw-r--r--libgomp/affinity-fmt.c4
-rw-r--r--libgomp/libgomp.h2
-rw-r--r--libgomp/oacc-init.c9
-rw-r--r--libgomp/omp_lib.h.in4
-rw-r--r--libgomp/target.c2
-rw-r--r--libgomp/testsuite/libgomp.c++/udr-20.C54
-rw-r--r--libgomp/testsuite/libgomp.c++/udr-21.C54
-rw-r--r--libgomp/testsuite/libgomp.c-c++-common/pr93515.c36
-rw-r--r--libgomp/testsuite/libgomp.fortran/atomic1.f9046
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/routine-7.f902
11 files changed, 265 insertions, 6 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 958572a..b90fddf 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,61 @@
+2020-02-13 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2020-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgomp/93515
+ * testsuite/libgomp.c-c++-common/pr93515.c: New test.
+
+2020-01-22 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2020-01-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgomp/93219
+ * libgomp.h (gomp_print_string): Change return type from void to int.
+ * affinity-fmt.c (gomp_print_string): Likewise. Return true if
+ not all characters have been written.
+
+ 2019-12-31 Ayush Mittal <ayush.m@samsung.com>
+
+ PR libgomp/93065
+ * oacc-init.c (goacc_runtime_deinitialize): New function.
+
+2019-12-20 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-12-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/92899
+ * testsuite/libgomp.fortran/atomic1.f90: New test.
+
+ 2019-11-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/60228
+ * testsuite/libgomp.c++/udr-20.C: New test.
+ * testsuite/libgomp.c++/udr-21.C: New test.
+
+2019-12-11 Thomas Schwinge <thomas@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+
+ * target.c (gomp_load_image_to_device, omp_target_associate_ptr):
+ Initialize 'dynamic_refcount' whenever we initialize 'refcount'.
+
+2019-12-11 Tobias Burnus <tobias@codesourcery.com>
+
+ Backported from mainline
+ 2019-12-11 Tobias Burnus <tobias@codesourcery.com>
+
+ * omp_lib.h.in: Fix spelling of function declaration
+ omp_get_cancell(l)ation.
+
+2019-08-13 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/91422
+ * testsuite/libgomp.oacc-fortran/routine-7.f90: Correct array
+ dimension.
+
2019-08-12 Release Manager
* GCC 9.2.0 released.
diff --git a/libgomp/affinity-fmt.c b/libgomp/affinity-fmt.c
index cd5783f..09a66f0 100644
--- a/libgomp/affinity-fmt.c
+++ b/libgomp/affinity-fmt.c
@@ -37,10 +37,10 @@
#include <sys/utsname.h>
#endif
-void
+bool
gomp_write_string (const char *str, size_t len)
{
- fwrite (str, 1, len, stderr);
+ return fwrite (str, 1, len, stderr) != len;
}
void
diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h
index ab216a3..a59bc33 100644
--- a/libgomp/libgomp.h
+++ b/libgomp/libgomp.h
@@ -769,7 +769,7 @@ extern void gomp_display_affinity_place (char *, size_t, size_t *, int);
/* affinity-fmt.c */
-extern void gomp_write_string (const char *str, size_t len);
+extern bool gomp_write_string (const char *str, size_t len);
extern void gomp_set_affinity_format (const char *, size_t);
extern void gomp_display_string (char *, size_t, size_t *, const char *,
size_t);
diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c
index c9896e7..beeeb48 100644
--- a/libgomp/oacc-init.c
+++ b/libgomp/oacc-init.c
@@ -905,6 +905,15 @@ goacc_runtime_initialize (void)
goacc_host_init ();
}
+static void __attribute__((destructor))
+goacc_runtime_deinitialize (void)
+{
+#if !(defined HAVE_TLS || defined USE_EMUTLS)
+ pthread_key_delete (goacc_tls_key);
+#endif
+ pthread_key_delete (goacc_cleanup_key);
+}
+
/* Compiler helper functions */
attribute_hidden void
diff --git a/libgomp/omp_lib.h.in b/libgomp/omp_lib.h.in
index a0fc04c..2c33ce8 100644
--- a/libgomp/omp_lib.h.in
+++ b/libgomp/omp_lib.h.in
@@ -102,8 +102,8 @@
external omp_in_final
logical(4) omp_in_final
- external omp_get_cancelllation
- logical(4) omp_get_cancelllation
+ external omp_get_cancellation
+ logical(4) omp_get_cancellation
external omp_get_proc_bind
integer(omp_proc_bind_kind) omp_get_proc_bind
diff --git a/libgomp/target.c b/libgomp/target.c
index 683a42b..9a5b259 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -2172,6 +2172,7 @@ gomp_load_image_to_device (struct gomp_device_descr *devicep, unsigned version,
k->refcount = REFCOUNT_INFINITY;
k->virtual_refcount = 0;
k->u.attach_count = NULL;
+ k->u.link_key = NULL;
array->left = NULL;
array->right = NULL;
splay_tree_insert (&devicep->mem_map, array);
@@ -2205,6 +2206,7 @@ gomp_load_image_to_device (struct gomp_device_descr *devicep, unsigned version,
k->refcount = target_size & link_bit ? REFCOUNT_LINK : REFCOUNT_INFINITY;
k->virtual_refcount = 0;
k->u.attach_count = NULL;
+ k->u.link_key = NULL;
array->left = NULL;
array->right = NULL;
splay_tree_insert (&devicep->mem_map, array);
diff --git a/libgomp/testsuite/libgomp.c++/udr-20.C b/libgomp/testsuite/libgomp.c++/udr-20.C
new file mode 100644
index 0000000..8338875
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/udr-20.C
@@ -0,0 +1,54 @@
+// PR c++/60228
+// { dg-additional-options "-std=c++11" }
+
+extern "C" void abort ();
+
+struct A
+{
+ typedef int T;
+ #pragma omp declare reduction (x : T : omp_out += omp_in + [](){ return 0; }()) initializer (omp_priv = [](){ return 0; }())
+ static void foo ();
+};
+
+template <typename T>
+struct B
+{
+ #pragma omp declare reduction (x : T : omp_out += omp_in + [](){ return T (0); }()) initializer (omp_priv = [](){ return T (0); }())
+ static void foo ();
+};
+
+void
+A::foo ()
+{
+ int r = 0, s = 0;
+ #pragma omp parallel for reduction (x : r, s)
+ for (int i = 0; i < 64; i++)
+ {
+ r++;
+ s += i;
+ }
+ if (r != 64 || s != (64 * 63) / 2)
+ abort ();
+}
+
+template <typename T>
+void
+B<T>::foo ()
+{
+ T r = 0, s = 0;
+ #pragma omp parallel for reduction (x : r, s)
+ for (int i = 0; i < 64; i++)
+ {
+ r++;
+ s += i;
+ }
+ if (r != 64 || s != (64 * 63) / 2)
+ abort ();
+}
+
+int
+main ()
+{
+ A::foo ();
+ B<long>::foo ();
+}
diff --git a/libgomp/testsuite/libgomp.c++/udr-21.C b/libgomp/testsuite/libgomp.c++/udr-21.C
new file mode 100644
index 0000000..9ec6557
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/udr-21.C
@@ -0,0 +1,54 @@
+// PR c++/60228
+// { dg-additional-options "-std=c++11" }
+
+extern "C" void abort ();
+
+struct A
+{
+ typedef int T;
+ #pragma omp declare reduction (y : T : [&omp_out, &omp_in]() { omp_out += omp_in; return 0; }()) initializer (omp_priv = [omp_orig]() { return omp_orig; }())
+ static void foo ();
+};
+
+template <typename T>
+struct B
+{
+ #pragma omp declare reduction (y : T : [&omp_out, &omp_in]() { omp_out += omp_in; return 0; }()) initializer (omp_priv = [omp_orig]() { return omp_orig; }())
+ static void foo ();
+};
+
+void
+A::foo ()
+{
+ int r = 0, s = 0;
+ #pragma omp parallel for reduction (y : r, s)
+ for (int i = 0; i < 64; i++)
+ {
+ r++;
+ s += i;
+ }
+ if (r != 64 || s != (64 * 63) / 2)
+ abort ();
+}
+
+template <typename T>
+void
+B<T>::foo ()
+{
+ T r = 0, s = 0;
+ #pragma omp parallel for reduction (y : r, s)
+ for (int i = 0; i < 64; i++)
+ {
+ r++;
+ s += i;
+ }
+ if (r != 64 || s != (64 * 63) / 2)
+ abort ();
+}
+
+int
+main ()
+{
+ A::foo ();
+ B<short>::foo ();
+}
diff --git a/libgomp/testsuite/libgomp.c-c++-common/pr93515.c b/libgomp/testsuite/libgomp.c-c++-common/pr93515.c
new file mode 100644
index 0000000..8a69088
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c-c++-common/pr93515.c
@@ -0,0 +1,36 @@
+/* PR libgomp/93515 */
+
+#include <omp.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+ int i;
+ int a = 42;
+#pragma omp target teams distribute parallel for defaultmap(tofrom: scalar)
+ for (i = 0; i < 64; ++i)
+ if (omp_get_team_num () == 0)
+ if (omp_get_thread_num () == 0)
+ a = 142;
+ if (a != 142)
+ __builtin_abort ();
+ a = 42;
+#pragma omp target parallel for defaultmap(tofrom: scalar)
+ for (i = 0; i < 64; ++i)
+ if (omp_get_thread_num () == 0)
+ a = 143;
+ if (a != 143)
+ __builtin_abort ();
+ a = 42;
+#pragma omp target firstprivate(a)
+ {
+ #pragma omp parallel for
+ for (i = 0; i < 64; ++i)
+ if (omp_get_thread_num () == 0)
+ a = 144;
+ if (a != 144)
+ abort ();
+ }
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.fortran/atomic1.f90 b/libgomp/testsuite/libgomp.fortran/atomic1.f90
new file mode 100644
index 0000000..e0c1353
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/atomic1.f90
@@ -0,0 +1,46 @@
+! PR fortran/92899
+
+program pr92899
+ real :: x = 1.0
+ double precision :: y
+ integer(kind=4) :: z = 4
+ integer(kind=8) :: w
+ !$omp atomic capture
+ y = x
+ x = 2.0
+ !$omp end atomic
+ if (y /= 1.0 .or. x /= 2.0) stop 1
+ !$omp atomic capture
+ x = y
+ y = 3.0
+ !$omp end atomic
+ if (x /= 1.0 .or. y /= 3.0) stop 2
+ !$omp atomic capture
+ w = z
+ z = 5
+ !$omp end atomic
+ if (w /= 4 .or. z /= 5) stop 3
+ !$omp atomic capture
+ z = w
+ w = 6
+ !$omp end atomic
+ if (z /= 4 .or. w /= 6) stop 4
+ !$omp atomic write
+ x = y
+ !$omp end atomic
+ if (x /= 3.0 .or. y /= 3.0) stop 5
+ x = 7.0
+ !$omp atomic write
+ y = x
+ !$omp end atomic
+ if (x /= 7.0 .or. y /= 7.0) stop 6
+ !$omp atomic write
+ z = w
+ !$omp end atomic
+ if (z /= 6 .or. w /= 6) stop 7
+ z = 8
+ !$omp atomic write
+ w = z
+ !$omp end atomic
+ if (z /= 8 .or. w /= 8) stop 8
+end
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/routine-7.f90 b/libgomp/testsuite/libgomp.oacc-fortran/routine-7.f90
index a83e92a..005d90b 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/routine-7.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-7.f90
@@ -108,7 +108,7 @@ end subroutine gang
subroutine seq (a)
!$acc routine seq
- integer, intent (inout) :: a(M)
+ integer, intent (inout) :: a(N)
integer :: i
do i = 1, N