mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-27 02:31:09 +00:00
Don't try to create zero-sized stack objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
40829ed6f5
commit
ee2e0e347e
@ -2391,8 +2391,9 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
|
|||||||
// In case of tail call optimization mark all arguments mutable. Since they
|
// 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.
|
// could be overwritten by lowering of arguments in case of a tail call.
|
||||||
if (Flags.isByVal()) {
|
if (Flags.isByVal()) {
|
||||||
int FI = MFI->CreateFixedObject(Flags.getByValSize(),
|
unsigned Bytes = Flags.getByValSize();
|
||||||
VA.getLocMemOffset(), false);
|
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()));
|
InVals.push_back(DAG.getFrameIndex(FI, getPointerTy()));
|
||||||
} else {
|
} else {
|
||||||
int FI = MFI->CreateFixedObject(VA.getLocVT().getSizeInBits()/8,
|
int FI = MFI->CreateFixedObject(VA.getLocVT().getSizeInBits()/8,
|
||||||
|
@ -1639,8 +1639,9 @@ X86TargetLowering::LowerMemArgument(SDValue Chain,
|
|||||||
// In case of tail call optimization mark all arguments mutable. Since they
|
// 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.
|
// could be overwritten by lowering of arguments in case of a tail call.
|
||||||
if (Flags.isByVal()) {
|
if (Flags.isByVal()) {
|
||||||
int FI = MFI->CreateFixedObject(Flags.getByValSize(),
|
unsigned Bytes = Flags.getByValSize();
|
||||||
VA.getLocMemOffset(), isImmutable);
|
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());
|
return DAG.getFrameIndex(FI, getPointerTy());
|
||||||
} else {
|
} else {
|
||||||
int FI = MFI->CreateFixedObject(ValVT.getSizeInBits()/8,
|
int FI = MFI->CreateFixedObject(ValVT.getSizeInBits()/8,
|
||||||
|
10
test/CodeGen/X86/2011-03-30-CreateFixedObjCrash.ll
Normal file
10
test/CodeGen/X86/2011-03-30-CreateFixedObjCrash.ll
Normal file
@ -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
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user