summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386/gen
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-09-21 20:23:19 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-09-21 20:23:19 +0000
commit8ea412c784147b476b764cc5278c44f886d3221d (patch)
tree44b3bea9036827886a19aab2eae26846a174f78a /lib/libc/i386/gen
parente350ad793087b30ced8e7d1458e45104406a7bee (diff)
downloadFreeBSD-src-8ea412c784147b476b764cc5278c44f886d3221d.zip
FreeBSD-src-8ea412c784147b476b764cc5278c44f886d3221d.tar.gz
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
Diffstat (limited to 'lib/libc/i386/gen')
-rw-r--r--lib/libc/i386/gen/ldexp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libc/i386/gen/ldexp.c b/lib/libc/i386/gen/ldexp.c
index 88bbb04..ecf1ff8 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
OpenPOWER on IntegriCloud