[LLVMdev] "UNREACHABLE executed!" error?

Eric Christopher echristo at apple.com
Sun Aug 15 13:33:00 PDT 2010

On Aug 15, 2010, at 1:30 PM, Alec Benzer wrote:

> The dump from the function I'm running:
> define %object_structure @0() {
> entry:
>   ret %object_structure { i8 0, %object_union [double 5.000000e+00, double false] }
> }
> the only output I get after the runFunction() call is:
> UNREACHABLE executed!
> Stack dump:
> 0.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@0'
> I just noticed that my union seems to look like an array....is that actually a union or do I have a problem somewhere? The code I use to generate the union is:
> llvm::Constant* tempUnion = llvm::ConstantUnion::get(object_union_type,llvm::Constant::getNullValue(types[t]));                                                                                                              
> llvm::Value* goodUnion = builder.CreateInsertValue(tempUnion,data,t,"createuniontmp");
> object_union_type is union { double, i1 }, and (in this case) t is 0, and types[t] is double

I'm not quite sure on the IR union syntax.  It's been somewhat fluid.  That said if you attach gdb to lli and run your code through it'll let you know which particular unreachable you're running into.


More information about the llvm-dev mailing list