]> granicus.if.org Git - clang/commit
Fix bugs in cpuid.h.
authorAkira Hatanaka <ahatanaka@apple.com>
Sat, 20 Sep 2014 01:31:09 +0000 (01:31 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Sat, 20 Sep 2014 01:31:09 +0000 (01:31 +0000)
commit4d43b42fa583e993d0445fb9a35f4bdfe62ffc01
tree4f3ca53e84cb8eecd4aabab9b1d545708478b9a2
parent5305cff6f260894fa8642805ad004847889fb2a4
Fix bugs in cpuid.h.

This commit makes two changes:

- Remove the push and pop instructions that were saving and restoring %ebx
  before and after cpuid in 32-bit pic mode. We were doing this to ensure we
  don't lose the GOT address in pic register %ebx, but this isn't necessary
  because the GOT address is kept in a virtual register.

- In 64-bit mode, preserve base register %rbx around cpuid.

This fixes PR20311 and rdar://problem/17686779.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218173 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Headers/cpuid.h
test/Headers/cpuid.c [new file with mode: 0644]