Fixing PR990: http://llvm.org/PR990.
This should unbreak csretcc on Linux & mingw targets. Several tests from
llvm-test should be also restored (fftbench, bigfib).
llvm-svn: 31613
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 55022da..d5b7c1c 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -516,10 +516,9 @@
BytesToPopOnReturn = 0; // Callee pops nothing.
BytesCallerReserves = ArgOffset;
- // If this is a struct return on Darwin/X86, the callee pops the hidden struct
- // pointer.
- if (MF.getFunction()->getCallingConv() == CallingConv::CSRet &&
- Subtarget->isTargetDarwin())
+ // If this is a struct return on, the callee pops the hidden struct
+ // pointer. This is common for Darwin/X86, Linux & Mingw32 targets.
+ if (MF.getFunction()->getCallingConv() == CallingConv::CSRet)
BytesToPopOnReturn = 4;
// Return the new list of results.
@@ -680,9 +679,10 @@
// Create the CALLSEQ_END node.
unsigned NumBytesForCalleeToPush = 0;
- // If this is is a call to a struct-return function on Darwin/X86, the callee
+ // If this is is a call to a struct-return function, the callee
// pops the hidden struct pointer, so we have to push it back.
- if (CallingConv == CallingConv::CSRet && Subtarget->isTargetDarwin())
+ // This is common for Darwin/X86, Linux & Mingw32 targets.
+ if (CallingConv == CallingConv::CSRet)
NumBytesForCalleeToPush = 4;
NodeTys.clear();