Closed llvmbot closed 1 year ago
Note that the code in question doesn't actually compile with g++ either:
void callcpuid( cpuidOut * p, long a )
{
// memset( p, 0xFF, sizeof(*p) ) ;
p->a = a ;
__asm__ ( "cpuid"
: "+a"(p->a), "=b"(p->b), "=c"(p->c), "=d"(p->d) // output
: // no (only) inputs
: "%rax", "%rbx", "%rcx", "%rdx" // clobbered registers
) ;
// : "a", "b", "c", "d" // clobbered registers
}
... but gcc produces a diagnostic message instead of trapping.
Appears to be fixed in Clang 4.0: https://godbolt.org/z/s1M6aEcqv
@llvm/issue-subscribers-backend-x86
Extended Description