aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-07-15 18:45:27 +0000
committerDevang Patel <dpatel@apple.com>2010-07-15 18:45:27 +0000
commit4ef0321f497397e58d7293973f6ed24253435f1d (patch)
tree907f56f9d743b0ac6b85cf98ea7cd8283c14b415
parent1ff672189788b92641eb9fd8659712710f54bbd8 (diff)
downloadexternal_llvm-4ef0321f497397e58d7293973f6ed24253435f1d.zip
external_llvm-4ef0321f497397e58d7293973f6ed24253435f1d.tar.gz
external_llvm-4ef0321f497397e58d7293973f6ed24253435f1d.tar.bz2
Fix crash reported in PR7653.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108441 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp2
-rw-r--r--test/CodeGen/X86/2010-07-15-Crash.ll12
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 4f38669..fb3f7c0 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -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;
}
diff --git a/test/CodeGen/X86/2010-07-15-Crash.ll b/test/CodeGen/X86/2010-07-15-Crash.ll
new file mode 100644
index 0000000..3ac4cf5
--- /dev/null
+++ b/test/CodeGen/X86/2010-07-15-Crash.ll
@@ -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
+}