This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING^5] PR 54805: __gthread_tsd* in vxlib-tls.c
- From: rbmj <rbmj at verizon dot net>
- To: Maxim Kuvyrkov <maxim dot kuvyrkov at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Mike Stump <mikestump at comcast dot net>
- Date: Wed, 13 Feb 2013 16:18:53 -0500
- Subject: Re: [PING^5] PR 54805: __gthread_tsd* in vxlib-tls.c
- References: <5097FE1B.6060409@verizon.net> <50A30E90.7080704@verizon.net> <50B3B47F.9010905@verizon.net> <50C0B657.2000004@verizon.net> <50E8FB30.2010202@verizon.net> <50F89FF1.9080107@verizon.net> <9B9BDD08-8F90-4073-93D4-659D1FABCDA0@comcast.net> <FCA895D0-8ACD-4D92-AF9C-A850C905609B@gmail.com> <50F9AE31.9040109@verizon.net> <7AC2CAB1-8248-4AF5-B49F-9764512E13B6@gmail.com>
On 18-Jan-13 20:35, Maxim Kuvyrkov wrote:
On 19/01/2013, at 9:18 AM, rbmj wrote:
-150,7 +158,7 @@ static __gthread_once_t tls_init_guard =
need to read tls_keys.dtor[key] atomically. */
static void
-tls_delete_hook (void *tcb ATTRIBUTE_UNUSED)
+tls_delete_hook (void *tcb)
Don't remove ATTRIBUTE_UNUSED. TCB was and will remain unused #ifdef __RTP__.
And #ifndef __RTP__ ?
No, simply leave that line as is. ATTRIBUTE_UNUSED tells the compiler that a variable can be unused, but not necessarily is unused. It's fine to have this attribute set on variables that are used under certain preprocessor configurations.
Seems like I kept this email in drafts and never sent it out...
Sorry about that.
Here's the updated, (trivial) patch.
--
Robert Mason
diff a/libgcc/config/vxlib-tls.c b/libgcc/config/vxlib-tls.c
--- a/libgcc/config/vxlib-tls.c
+++ b/libgcc/config/vxlib-tls.c
@@ -102,6 +102,14 @@ extern void __gthread_set_tls_data (void
extern void __gthread_enter_tls_dtor_context (void);
extern void __gthread_leave_tls_dtor_context (void);
+#ifndef __RTP__
+
+extern void *__gthread_get_tsd_data (WIND_TCB *tcb);
+extern void __gthread_set_tsd_data (WIND_TCB *tcb, void *data);
+extern void __gthread_enter_tsd_dtor_context (WIND_TCB *tcb);
+extern void __gthread_leave_tsd_dtor_context (WIND_TCB *tcb);
+
+#endif /* __RTP__ */
/* This is a global structure which records all of the active keys.
@@ -185,7 +193,7 @@ tls_delete_hook (void *tcb ATTRIBUTE_UNU
#ifdef __RTP__
__gthread_leave_tls_dtor_context ();
#else
- __gthread_leave_tsd_dtor_context ();
+ __gthread_leave_tsd_dtor_context (tcb);
#endif
#ifdef __RTP__
-- 1.7.10.4