Fix PR4975. Avoid referencing empty vector.
llvm-svn: 99840
This commit is contained in:
parent
b355db7877
commit
742db6874a
|
@ -6051,8 +6051,10 @@ void SelectionDAGISel::LowerArguments(BasicBlock *LLVMBB) {
|
|||
}
|
||||
|
||||
if (!I->use_empty()) {
|
||||
SDValue Res = DAG.getMergeValues(&ArgValues[0], NumValues,
|
||||
SDB->getCurDebugLoc());
|
||||
SDValue Res;
|
||||
if (!ArgValues.empty())
|
||||
Res = DAG.getMergeValues(&ArgValues[0], NumValues,
|
||||
SDB->getCurDebugLoc());
|
||||
SDB->setValue(I, Res);
|
||||
|
||||
// If this argument is live outside of the entry block, insert a copy from
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
; RUN: llc < %s
|
||||
; PR4975
|
||||
|
||||
%0 = type <{ [0 x i32] }>
|
||||
%union.T0 = type { }
|
||||
|
||||
@.str = private constant [1 x i8] c" "
|
||||
|
||||
define arm_apcscc void @t(%0) nounwind {
|
||||
entry:
|
||||
%arg0 = alloca %union.T0
|
||||
%1 = bitcast %union.T0* %arg0 to %0*
|
||||
store %0 %0, %0* %1, align 1
|
||||
ret void
|
||||
}
|
||||
|
||||
declare arm_apcscc i32 @printf(i8*, ...)
|
Loading…
Reference in New Issue