http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55712
--- Comment #2 from Leif Ekblad <leif at rdos dot net> 2012-12-23 22:47:13 UTC --- Comment on attachment 29038 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29038 Save rbx and use another file for ebx parameter to cpuid >diff -crNB gcc-4.8-20121216/gcc/config/i386/cpuid.h >gcc-work/gcc/config/i386/cpuid.h >*** gcc-4.8-20121216/gcc/config/i386/cpuid.h 2012-10-26 11:45:46.000000000 >+0200 >--- gcc-work/gcc/config/i386/cpuid.h 2012-12-23 23:06:08.000000000 +0100 >*************** >*** 166,171 **** >--- 166,189 ---- > : "0" (level), "2" (count)) > #endif > #else >+ >+ #if defined(__x86_64__) && defined(__PIC__) >+ #define __cpuid(level, a, b, c, d) \ >+ __asm__ ("pushq %%rbx\n\t" \ >+ "cpuid\n\t" \ >+ "movl %%ebx, %1\n\t" \ >+ "popq %%rbx\n\t" \ >+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ >+ : "0" (level)) >+ >+ #define __cpuid_count(level, count, a, b, c, d) \ >+ __asm__ ("pushq %%rbx\n\t" \ >+ "cpuid\n\t" \ >+ "movl %%ebx, %1\n\t" \ >+ "popq %%rbx\n\t" \ >+ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ >+ : "0" (level), "2" (count)) >+ #else > #define __cpuid(level, a, b, c, d) \ > __asm__ ("cpuid\n\t" \ > : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ >*************** >*** 176,181 **** >--- 194,200 ---- > : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ > : "0" (level), "2" (count)) > #endif >+ #endif > > /* Return highest supported input value for cpuid instruction. ext can > be either 0x0 or 0x8000000 to return highest supported value for