From 5de1b857a0f8b40d58ffb6bc6876312516ca397c Mon Sep 17 00:00:00 2001 From: jhibbits Date: Tue, 6 Jan 2015 03:50:43 +0000 Subject: Avoid use of register variables. Clang 3.5 treats this as undefined behavior, and bad things happen. MFC after: 1 week --- lib/libc/powerpc/gen/_set_tp.c | 3 +-- lib/libc/powerpc64/gen/_set_tp.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/powerpc/gen/_set_tp.c b/lib/libc/powerpc/gen/_set_tp.c index 5a89698..aa1150a 100644 --- a/lib/libc/powerpc/gen/_set_tp.c +++ b/lib/libc/powerpc/gen/_set_tp.c @@ -29,7 +29,6 @@ void _set_tp(void *tpval) { - register void *tp __asm__("r2"); - __asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7008)); + __asm __volatile("mr 2,%0" :: "r"((char*)tpval + 0x7008)); } diff --git a/lib/libc/powerpc64/gen/_set_tp.c b/lib/libc/powerpc64/gen/_set_tp.c index 9adb6a5..32137e5 100644 --- a/lib/libc/powerpc64/gen/_set_tp.c +++ b/lib/libc/powerpc64/gen/_set_tp.c @@ -29,7 +29,6 @@ void _set_tp(void *tpval) { - register void *tp __asm__("r13"); - __asm __volatile("mr %0,%1" : "=r"(tp) : "r"((char*)tpval + 0x7010)); + __asm __volatile("mr 13,%0" :: "r"((char*)tpval + 0x7010)); } -- cgit v1.1