[llvm-commits] [llvm] r128586 - in /llvm/trunk: lib/Target/ARM/ARMISelLowering.cpp lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2011-03-30-CreateFixedObjCrash.ll
Evan Cheng
evan.cheng at apple.com
Wed Mar 30 16:44:13 PDT 2011
Author: evancheng
Date: Wed Mar 30 18:44:13 2011
New Revision: 128586
URL: http://llvm.org/viewvc/llvm-project?rev=128586&view=rev
Log:
Don't try to create zero-sized stack objects.
Added:
llvm/trunk/test/CodeGen/X86/2011-03-30-CreateFixedObjCrash.ll
Modified:
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=128586&r1=128585&r2=128586&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Mar 30 18:44:13 2011
@@ -2391,8 +2391,9 @@
// In case of tail call optimization mark all arguments mutable. Since they
// could be overwritten by lowering of arguments in case of a tail call.
if (Flags.isByVal()) {
- int FI = MFI->CreateFixedObject(Flags.getByValSize(),
- VA.getLocMemOffset(), false);
+ unsigned Bytes = Flags.getByValSize();
+ if (Bytes == 0) Bytes = 1; // Don't create zero-sized stack objects.
+ int FI = MFI->CreateFixedObject(Bytes, VA.getLocMemOffset(), false);
InVals.push_back(DAG.getFrameIndex(FI, getPointerTy()));
} else {
int FI = MFI->CreateFixedObject(VA.getLocVT().getSizeInBits()/8,
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=128586&r1=128585&r2=128586&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Mar 30 18:44:13 2011
@@ -1639,8 +1639,9 @@
// In case of tail call optimization mark all arguments mutable. Since they
// could be overwritten by lowering of arguments in case of a tail call.
if (Flags.isByVal()) {
- int FI = MFI->CreateFixedObject(Flags.getByValSize(),
- VA.getLocMemOffset(), isImmutable);
+ unsigned Bytes = Flags.getByValSize();
+ if (Bytes == 0) Bytes = 1; // Don't create zero-sized stack objects.
+ int FI = MFI->CreateFixedObject(Bytes, VA.getLocMemOffset(), isImmutable);
return DAG.getFrameIndex(FI, getPointerTy());
} else {
int FI = MFI->CreateFixedObject(ValVT.getSizeInBits()/8,
Added: llvm/trunk/test/CodeGen/X86/2011-03-30-CreateFixedObjCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2011-03-30-CreateFixedObjCrash.ll?rev=128586&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2011-03-30-CreateFixedObjCrash.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2011-03-30-CreateFixedObjCrash.ll Wed Mar 30 18:44:13 2011
@@ -0,0 +1,10 @@
+; RUN: llc < %s -march=x86
+
+; rdar://7983260
+
+%struct.T0 = type {}
+
+define void @fn4(%struct.T0* byval %arg0) nounwind ssp {
+entry:
+ ret void
+}
More information about the llvm-commits
mailing list