diff options
author | Cameron Esfahani <dirty@apple.com> | 2010-09-22 22:35:21 +0000 |
---|---|---|
committer | Cameron Esfahani <dirty@apple.com> | 2010-09-22 22:35:21 +0000 |
commit | 4af1eaee70a8de71f805ef7c3eca581ff6a014e8 (patch) | |
tree | bf1864acc69dc3a463772ce691eb7cd20546bb52 | |
parent | e5cb26fab9ecc44e30cd6de462de030696b45f6d (diff) |
Fix PR8201: Update the code to call via X86::CALL64pcrel32 in the 64-bit case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114597 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86RegisterInfo.cpp | 5 | ||||
-rw-r--r-- | test/CodeGen/X86/win_chkstk.ll | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp index 3654f4e509..94aadd11f7 100644 --- a/lib/Target/X86/X86RegisterInfo.cpp +++ b/lib/Target/X86/X86RegisterInfo.cpp @@ -1086,10 +1086,11 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { const char *StackProbeSymbol = Subtarget->isTargetWindows() ? "_chkstk" : "_alloca"; + unsigned CallOp = Is64Bit ? X86::CALL64pcrel32 : X86::CALLpcrel32; if (!isEAXAlive) { BuildMI(MBB, MBBI, DL, TII.get(X86::MOV32ri), X86::EAX) .addImm(NumBytes); - BuildMI(MBB, MBBI, DL, TII.get(X86::CALLpcrel32)) + BuildMI(MBB, MBBI, DL, TII.get(CallOp)) .addExternalSymbol(StackProbeSymbol) .addReg(StackPtr, RegState::Define | RegState::Implicit) .addReg(X86::EFLAGS, RegState::Define | RegState::Implicit); @@ -1102,7 +1103,7 @@ void X86RegisterInfo::emitPrologue(MachineFunction &MF) const { // allocated bytes for EAX. BuildMI(MBB, MBBI, DL, TII.get(X86::MOV32ri), X86::EAX) .addImm(NumBytes - 4); - BuildMI(MBB, MBBI, DL, TII.get(X86::CALLpcrel32)) + BuildMI(MBB, MBBI, DL, TII.get(CallOp)) .addExternalSymbol(StackProbeSymbol) .addReg(StackPtr, RegState::Define | RegState::Implicit) .addReg(X86::EFLAGS, RegState::Define | RegState::Implicit); diff --git a/test/CodeGen/X86/win_chkstk.ll b/test/CodeGen/X86/win_chkstk.ll index 2933eeb540..c05b85c16f 100644 --- a/test/CodeGen/X86/win_chkstk.ll +++ b/test/CodeGen/X86/win_chkstk.ll @@ -15,7 +15,7 @@ entry: ; WIN_X32: calll __chkstk ; WIN_X64: call __chkstk ; MINGW_X32: calll __alloca -; MINGW_X64: calll _alloca +; MINGW_X64: callq _alloca ; LINUX-NOT: call __chkstk %array4096 = alloca [4096 x i8], align 16 ; <[4096 x i8]*> [#uses=0] ret i32 0 @@ -34,7 +34,7 @@ entry: ; WIN_X64: ret ; MINGW_X64: # BB#0: -; MINGW_X64-NOT: call _alloca +; MINGW_X64-NOT: callq _alloca ; MINGW_X64: ret ; LINUX: # BB#0: |