[X86] Teach X86SelectionDAGInfo::EmitTargetCodeForMemcpy about GNUX32
authorCraig Topper <craig.topper@intel.com>
Wed, 12 Sep 2018 01:57:22 +0000 (01:57 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 12 Sep 2018 01:57:22 +0000 (01:57 +0000)
commitdc32e91bc6015bb394d26de18f3c42225b00a41e
tree922d87ba874b0acf925cc21709f17f9a71f0fc69
parentee9bb8761c4bf51658a806641fff3e452d3116f5
[X86] Teach X86SelectionDAGInfo::EmitTargetCodeForMemcpy about GNUX32

Summary:
In GNUX23, is64BitMode returns true, but pointers are 32-bits. So we shouldn't copy pointer values into RSI/RDI since the widths don't match.

Fixes PR38865 despite what the title says. I think the llvm_unreachable in the copyPhysReg code tricked the optimizer and made the fatal error trigger.

Reviewers: rnk, efriedma, MatzeB, echristo

Reviewed By: efriedma

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D51893

llvm-svn: 342015
llvm/lib/Target/X86/X86InstrCompiler.td
llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
llvm/test/CodeGen/X86/pr38865.ll [new file with mode: 0644]