From 4c0e59e6ad6b697a28f7c57540fb2eb0042d04d0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 8 Sep 2010 13:20:47 +0200 Subject: Work around a compiler bug on 64-bit. Some GCC versions seem to think that the EBX register is the PIC register even on 64-bit. So instead of telling GCC that we clobbered it, save it instead on a temporary register. Reviewed-by: Trust Me --- src/corelib/tools/qsimd.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index a9c33f1..7babf3a 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -286,10 +286,13 @@ static inline uint detectProcessorFeatures() uint feature_result = 0; #if defined(Q_CC_GNU) - asm ("cpuid" - : "=c" (feature_result) + long tmp; + asm ("xchg %%rbx, %1\n" + "cpuid\n" + "xchg %%rbx, %1\n" + : "=c" (feature_result), "=&r" (tmp) : "a" (1) - : "%ebx", "%edx" + : "%edx" ); #elif defined (Q_OS_WIN64) { -- cgit v0.12