[X86] Fix a bug in WIN_FTOL_32/64 handling.
authorMichael Kuperstein <michael.m.kuperstein@intel.com>
Tue, 30 Jun 2015 14:38:57 +0000 (14:38 +0000)
committerMichael Kuperstein <michael.m.kuperstein@intel.com>
Tue, 30 Jun 2015 14:38:57 +0000 (14:38 +0000)
commitf8b3b92eb8408b8288552f7b4614f30443b43e71
treecbd783ab28130cebd60af533d7d3d6b52c4d4e16
parente143a3abc2a955797e7748395cbfd45759cd0840
[X86] Fix a bug in WIN_FTOL_32/64 handling.

Duplicating an FP register "as itself" is a bad idea, since it violates the
invariant that every FP register is mapped to at most one FPU stack slot.
Use the scratch FP register instead.

This fixes PR23957.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241069 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FloatingPoint.cpp
test/CodeGen/X86/win_ftol2.ll