bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in gmp on Opteron


From: Greg Lindahl
Subject: bug in gmp on Opteron
Date: Thu, 18 Dec 2003 17:02:14 -0800
User-agent: Mutt/1.2.5.1i

gmp's longlong.h count_trailing_zeros.h macro must be called with
count that's a long. Modern assemblers (such as the one in RedHat
Taroon) flag an error because it's a 64-bit move to a 32-bit
variable.

This patch works around it:

--- longlong.h~ 2002-12-17 13:57:20.000000000 -0800
+++ longlong.h  2003-12-18 16:29:52.575408366 -0800
@@ -715,8 +715,10 @@
   } while (0)
 #define count_trailing_zeros(count, x)                                 \
   do {                                                                 \
+    long __bug_temp;                                                    \
     ASSERT ((x) != 0);                                                 \
-    __asm__ ("bsfq %1,%0" : "=r" (count) : "rm" ((UDItype)(x)));       \
+    __asm__ ("bsfq %1,%0" : "=r" (__bug_temp) : "rm" ((UDItype)(x)));  \
+    count = __bug_temp;                                                 \
   } while (0)
 #endif /* x86_64 */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]