From 5be05bce076a2e0ef11f80a1d9b493fb8078f8bb Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sun, 13 Nov 2016 11:14:03 -0500 Subject: [PATCH] Add CC clobber to cpuid call This should not be needed, but it does not hurt. According to Ian Lance Taylor (http://gcc.gnu.org/ml/gcc-help/2014-02/msg00023.html), the CC clobber causes GCC to forget its internal representation of flag state. It should not be needed for cpuid. However, Clang has some odd behave in a couple of versions of its compiler when using cpuid. Both JW and UB experienced it on separate occassions. --- cpu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu.cpp b/cpu.cpp index 5d0664ad..89ec3c4ab 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -113,6 +113,7 @@ bool CpuId(word32 input, word32 output[4]) # endif : "=a" (output[0]), "=D" (output[1]), "=c" (output[2]), "=d" (output[3]) : "a" (input), "c" (0) + : "cc" ); }