From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15813 invoked by alias); 24 Jan 2014 17:09:08 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 15796 invoked by uid 89); 24 Jan 2014 17:09:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f182.google.com Received: from mail-qc0-f182.google.com (HELO mail-qc0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 24 Jan 2014 17:09:05 +0000 Received: by mail-qc0-f182.google.com with SMTP id c9so4668820qcz.41 for ; Fri, 24 Jan 2014 09:09:03 -0800 (PST) X-Received: by 10.140.35.168 with SMTP id n37mr21129424qgn.80.1390583343783; Fri, 24 Jan 2014 09:09:03 -0800 (PST) Received: from anchor.com (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPSA id 42sm1084631qgi.16.2014.01.24.09.09.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jan 2014 09:09:03 -0800 (PST) From: Richard Henderson To: libc-ports@sourceware.org Subject: [PATCH] alpha: Fix tls-macros.h Date: Fri, 24 Jan 2014 17:09:00 -0000 Message-Id: <1390583311-13457-1-git-send-email-rth@twiddle.net> X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00057.txt.bz2 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 + + * sysdeps/alpha/tls-macros.h (TLS_GD): Add dependency on $gp. + (TLS_LD, TLS_IE): Likewise. + 2013-12-07 Richard Henderson * sysdeps/unix/sysv/linux/alpha/bits/mman.h: Use , 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