forked from OSchip/llvm-project
Don't try to create zero-sized stack objects.
llvm-svn: 128586
This commit is contained in:
parent
280264b889
commit
ee9d45dd55
|
@ -2391,8 +2391,9 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
|
|||
// 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,
|
||||
|
|
|
@ -1639,8 +1639,9 @@ X86TargetLowering::LowerMemArgument(SDValue Chain,
|
|||
// 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,
|
||||
|
|
|
@ -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…
Reference in New Issue