From: Richard Henderson <rth@twiddle.net>
To: libc-ports@sourceware.org
Subject: [PATCH] alpha: Fix tls-macros.h
Date: Fri, 24 Jan 2014 17:09:00 -0000 [thread overview]
Message-ID: <1390583311-13457-1-git-send-email-rth@twiddle.net> (raw)
Reported to the gcc bugzilla, there was a missing dependency on $gp
that let the compiler generated $gp reload be scheduled across the
macros here.
---
ports/ChangeLog.alpha | 5 +++++
ports/sysdeps/alpha/tls-macros.h | 22 +++++++++++-----------
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/ports/ChangeLog.alpha b/ports/ChangeLog.alpha
index 24540e4..a23ada5 100644
--- a/ports/ChangeLog.alpha
+++ b/ports/ChangeLog.alpha
@@ -1,3 +1,8 @@
+2014-01-24 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/alpha/tls-macros.h (TLS_GD): Add dependency on $gp.
+ (TLS_LD, TLS_IE): Likewise.
+
2013-12-07 Richard Henderson <rth@redhat.com>
* sysdeps/unix/sysv/linux/alpha/bits/mman.h: Use <bits/mman-linux.h>,
diff --git a/ports/sysdeps/alpha/tls-macros.h b/ports/sysdeps/alpha/tls-macros.h
index 0385d93..00489c2 100644
--- a/ports/sysdeps/alpha/tls-macros.h
+++ b/ports/sysdeps/alpha/tls-macros.h
@@ -2,21 +2,21 @@
extern void *__tls_get_addr (void *);
-# define TLS_GD(x) \
- ({ void *__result; \
- asm ("lda %0, " #x "($gp) !tlsgd" : "=r" (__result)); \
+# define TLS_GD(x) \
+ ({ register void *__gp asm ("$29"); void *__result; \
+ asm ("lda %0, " #x "($gp) !tlsgd" : "=r" (__result) : "r"(__gp)); \
__tls_get_addr (__result); })
-# define TLS_LD(x) \
- ({ void *__result; \
- asm ("lda %0, " #x "($gp) !tlsldm" : "=r" (__result)); \
- __result = __tls_get_addr (__result); \
- asm ("lda %0, " #x "(%0) !dtprel" : "+r" (__result)); \
+# define TLS_LD(x) \
+ ({ register void *__gp asm ("$29"); void *__result; \
+ asm ("lda %0, " #x "($gp) !tlsldm" : "=r" (__result) : "r"(__gp)); \
+ __result = __tls_get_addr (__result); \
+ asm ("lda %0, " #x "(%0) !dtprel" : "+r" (__result)); \
__result; })
-# define TLS_IE(x) \
- ({ long ofs; \
- asm ("ldq %0, " #x "($gp) !gottprel" : "=r"(ofs)); \
+# define TLS_IE(x) \
+ ({ register void *__gp asm ("$29"); long ofs; \
+ asm ("ldq %0, " #x "($gp) !gottprel" : "=r"(ofs) : "r"(__gp)); \
__builtin_thread_pointer () + ofs; })
# define TLS_LE(x) \
--
1.8.4.2
reply other threads:[~2014-01-24 17:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1390583311-13457-1-git-send-email-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=libc-ports@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).