diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -9370,10 +9370,6 @@ } if (OpInfo.ConstraintType == TargetLowering::C_Address) { - assert(InOperandVal.getValueType() == - TLI.getPointerTy(DAG.getDataLayout()) && - "Address operands expect pointer values"); - unsigned ConstraintID = TLI.getInlineAsmMemConstraint(OpInfo.ConstraintCode); assert(ConstraintID != InlineAsm::Constraint_Unknown && diff --git a/llvm/test/CodeGen/X86/inline-asm-p-constraint.ll b/llvm/test/CodeGen/X86/inline-asm-p-constraint.ll --- a/llvm/test/CodeGen/X86/inline-asm-p-constraint.ll +++ b/llvm/test/CodeGen/X86/inline-asm-p-constraint.ll @@ -15,3 +15,12 @@ ret ptr %1 ; CHECK-NEXT: retq } + +define void @intptr() { +; Don't assert on a non-ptr operand, existing code & gcc accept these. +entry: +; CHECK-LABEL: intptr: +; CHECK: ud1l 49150(%eax), %eax + call void asm "ud1l $0(%eax), %eax", "p,~{dirflag},~{fpsr},~{flags}"(i32 49150) + unreachable +}