[X86] Fix stack probing on x32 (PR41477)
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 20 Apr 2019 07:25:46 +0000 (07:25 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 20 Apr 2019 07:25:46 +0000 (07:25 +0000)
commitb75c8fc6fbac57e0bde233516fa125f65b36af84
treedf835d745d4a007ab4503ee149c6073fe6b21d1d
parentce12ea8dfc371735672342f2dcc6ecfb32e3b4d7
[X86] Fix stack probing on x32 (PR41477)

Fix for https://bugs.llvm.org/show_bug.cgi?id=41477. On the x32 ABI
with stack probing a dynamic alloca will result in a WIN_ALLOCA_32
with a 32-bit size. The current implementation tries to copy it into
RAX, resulting in a physreg copy error. Fix this by copying to EAX
instead. Also fix incorrect opcodes or registers used in subs.

llvm-svn: 358807
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86WinAllocaExpander.cpp
llvm/test/CodeGen/X86/probe-stack-x32.ll [new file with mode: 0644]