Fix crash reported in PR7653.

llvm-svn: 108441
This commit is contained in:
Devang Patel 2010-07-15 18:45:27 +00:00
parent c4701c4f64
commit 3028e38bd8
2 changed files with 13 additions and 1 deletions

View File

@ -2476,7 +2476,7 @@ void TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
int64_t Offs = GA->getOffset();
if (C) Offs += C->getZExtValue();
Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(),
C->getDebugLoc(),
C ? C->getDebugLoc() : DebugLoc(),
Op.getValueType(), Offs));
return;
}

View File

@ -0,0 +1,12 @@
; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s -o /dev/null
; PR7653
@__FUNCTION__.1623 = external constant [4 x i8] ; <[4 x i8]*> [#uses=1]
define void @foo() nounwind {
entry:
tail call void asm sideeffect "", "s,i,~{fpsr},~{flags}"(i8* getelementptr
inbounds ([4 x i8]* @__FUNCTION__.1623, i64 0, i64 0), i8* getelementptr
inbounds ([4 x i8]* @__FUNCTION__.1623, i64 0, i64 0)) nounwind
ret void
}