This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[COMMITTED PATCH] MicroBlaze: Fix volatile-register-var warning in READ_THREAD_POINTER
- From: David Holsgrove <david dot holsgrove at xilinx dot com>
- To: <libc-alpha at sourceware dot org>
- Cc: <david dot holsgrove at xilinx dot com>
- Date: Fri, 9 Jan 2015 17:48:35 +1000
- Subject: [COMMITTED PATCH] MicroBlaze: Fix volatile-register-var warning in READ_THREAD_POINTER
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 149.199.60.83) smtp dot mailfrom=david dot holsgrove at xilinx dot com;
- References: <1420789716-19858-1-git-send-email-david dot holsgrove at xilinx dot com>
Resolves warning: 'optimization may eliminate reads and/or writes to
register variables'
2015-01-06 David Holsgrove <david.holsgrove@xilinx.com>
* sysdeps/microblaze/nptl/tls.h: Remove inline
__microblaze_get_thread_area and update READ_THREAD_POINTER.
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
---
ChangeLog | 6 ++++++
sysdeps/microblaze/nptl/tls.h | 11 +++--------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 834e23c..2a925cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2015-01-09 David Holsgrove <david.holsgrove@xilinx.com>
+ * sysdeps/microblaze/nptl/tls.h (__microblaze_get_thread_area): Function
+ removed.
+ (READ_THREAD_POINTER): Use __microblaze_thread_area instead.
+
+2015-01-09 David Holsgrove <david.holsgrove@xilinx.com>
+
* sysdeps/microblaze/nptl/tls.h (TLS_INIT_TP): Use NULL instead
of 0.
diff --git a/sysdeps/microblaze/nptl/tls.h b/sysdeps/microblaze/nptl/tls.h
index fb4a71a..171a745 100644
--- a/sysdeps/microblaze/nptl/tls.h
+++ b/sysdeps/microblaze/nptl/tls.h
@@ -59,14 +59,9 @@ typedef struct
void *private;
} tcbhead_t;
-static inline void *__microblaze_get_thread_area (void)
-{
- register void * volatile __microblaze_thread_area asm ("r21");
- return (void *) __microblaze_thread_area;
-}
-
-# define READ_THREAD_POINTER() \
- ({ __microblaze_get_thread_area(); })
+#define READ_THREAD_POINTER() \
+ ({ register void *__microblaze_thread_area asm ("r21"); \
+ __microblaze_thread_area; })
/* This is the size of the initial TCB. */
# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
--
2.1.1