Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Sep 2010 20:23:19 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r212976 - head/lib/libc/i386/gen
Message-ID:  <201009212023.o8LKNJI3005882@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Tue Sep 21 20:23:19 2010
New Revision: 212976
URL: http://svn.freebsd.org/changeset/base/212976

Log:
  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

Modified:
  head/lib/libc/i386/gen/ldexp.c

Modified: head/lib/libc/i386/gen/ldexp.c
==============================================================================
--- head/lib/libc/i386/gen/ldexp.c	Tue Sep 21 20:21:56 2010	(r212975)
+++ head/lib/libc/i386/gen/ldexp.c	Tue Sep 21 20:23:19 2010	(r212976)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009212023.o8LKNJI3005882>