From 7e78863707ced586ec2b418b21fd441d9ed53cfd Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Tue, 21 Sep 2010 20:23:19 +0000 Subject: [PATCH] Workaround LLVM bug #4434: Reorder inline assembly arguments temp2, temp, value and texp to follow the st(0), st(1), etc. style. Also mark the temp2 variable as volatile to workaround another clang bug. This allows clang to buildworld FreeBSD/i386. Submitted by: dim --- lib/libc/i386/gen/ldexp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/libc/i386/gen/ldexp.c b/lib/libc/i386/gen/ldexp.c index 88bbb048f3ef..ecf1ff8d4654 100644 --- a/lib/libc/i386/gen/ldexp.c +++ b/lib/libc/i386/gen/ldexp.c @@ -51,12 +51,16 @@ __FBSDID("$FreeBSD$"); double ldexp (double value, int exp) { - double temp, texp, temp2; + double temp, texp; +#ifdef __clang__ + volatile +#endif + double temp2; texp = exp; #ifdef __GNUC__ __asm ("fscale " - : "=u" (temp2), "=t" (temp) - : "0" (texp), "1" (value)); + : "=t" (temp), "=u" (temp2) + : "0" (value), "1" (texp)); #else #error unknown asm #endif