From: Jakub Jelinek Date: Wed, 22 Jan 2020 16:42:45 +0000 (+0100) Subject: re PR libgomp/93065 (libgomp: destructor missing to delete goacc_cleanup_key) X-Git-Tag: releases/gcc-9.3.0~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26e1a1c66f2c651a3b1b5e5b5a00e4275df2ee51;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. --- diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index da2b99fa933b..bcc1b0e71317 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,11 @@ +2020-01-22 Jakub Jelinek + + Backported from mainline + 2019-12-31 Ayush Mittal + + PR libgomp/93065 + * oacc-init.c (goacc_runtime_deinitialize): New function. + 2019-12-20 Jakub Jelinek Backported from mainline diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c index f30cf2f81d8d..033fac463c6a 100644 --- a/libgomp/oacc-init.c +++ b/libgomp/oacc-init.c @@ -657,6 +657,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