Pointer comparions are failing LLVM validation if they are not the same type. One way to resolve this is to cast the pointer to integer before comparing. I am trying out following approach. In output_op_compare(), I separated out the pointer case as follows: switch (LLVMGetTypeKind(LLVMTypeOf(lhs))) { case LLVMPointerTypeKind: { lhs = LLVMBuildPtrToInt(fn->builder, lhs, LLVMIntType(C->target->bits_in_pointer), ""); if (LLVMGetTypeKind(LLVMTypeOf(rhs)) == LLVMPointerTypeKind) { rhs = LLVMBuildPtrToInt(fn->builder, rhs, LLVMIntType(C->target->bits_in_pointer), ""); } LLVMIntPredicate op = translate_op(insn->opcode); target = LLVMBuildICmp(fn->builder, op, lhs, rhs, target_name); break; } case LLVMIntegerTypeKind: { LLVMIntPredicate op = translate_op(insn->opcode); target = LLVMBuildICmp(fn->builder, op, lhs, rhs, target_name); break; } -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html