From: Ayush Mittal Date: Tue, 31 Dec 2019 10:34:34 +0000 (+0000) Subject: re PR libgomp/93065 (libgomp: destructor missing to delete goacc_cleanup_key) X-Git-Tag: misc/cutover-git~210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c8297996a7ab3496c5d2f798cdbe4cab749468e;p=thirdparty%2Fgcc.git re PR libgomp/93065 (libgomp: destructor missing to delete goacc_cleanup_key) PR libgomp/93065 * oacc-init.c (goacc_runtime_deinitialize): New function. From-SVN: r279803 --- diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 9eb3e2c25a03..a18868ba3fd7 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2019-12-31 Ayush Mittal + + PR libgomp/93065 + * oacc-init.c (goacc_runtime_deinitialize): New function. + 2019-12-28 Jakub Jelinek PR bootstrap/93074 diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c index 487a2cca61f8..6aa5fd297d6f 100644 --- a/libgomp/oacc-init.c +++ b/libgomp/oacc-init.c @@ -858,6 +858,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