[LLVMdev] Error "Cannot emit physreg copy instruction"

edA-qa mort-ora-y eda-qa at disemia.com
Sat Nov 9 07:45:47 PST 2013


I can make the problem go away, but perhaps there is still an issue in
LLVM. At least a missing assert somewhere. It's strange that only this
very particular structure causes the failure.

If I change the personality routine return value to i32 from i64 then it
works.

On 09/11/13 13:53, edA-qa mort-ora-y wrote:
> I've reduced the example down to a minimum. The error is quite
> perplexing since the IR appears fine. It is a nonsensical infinite loop
> now, but that shouldn't be a problem.
> 
> declare i64 @leaf_exception_personality(i64, i32, i64, i8*, i8*)
> 
> declare i8* @count_malloc(i64)
> 
> define internal i8 @junk___init_module_get_args_3() #0 {
> entry:
>   %_exception = alloca { i8*, i64 }
>   %ignore0 = invoke i8* @count_malloc(i64 10)
>           to label %loop_cond_7 unwind label %defer_error_land_4
> 
> defer_error_land_4:
>   %lpres = landingpad { i8*, i64 } personality i64 (i64, i32, i64, i8*,
> i8*)* @leaf_exception_personality
>           cleanup
>   store { i8*, i64 } %lpres, { i8*, i64 }* %_exception
>   ret i8 0
> 
> loop_cond_7:
>   %ignore1 = invoke i8* @count_malloc(i64 40)
>           to label %loop_cond_7 unwind label %defer_error_land_4
> }
> 
> 
> On 09/11/13 12:47, edA-qa mort-ora-y wrote:
>> I'm getting an error that I don't know how to fix. I've isolated the
>> input as much as I easily can. I've attached the file that produces the
>> problem. Just calling "llc err.ll -o err.s" generates the error.
>>
>> I'm going to try and isolate even further, but as I'm not sure what I'm
>> looking for I don't know if I'll be successful. Does anybody know what
>> this error means?
>>
>> Cannot emit physreg copy instruction
>> UNREACHABLE executed at X86InstrInfo.cpp:2899!
>> 0  libLLVM-3.3.so  0x00007f9f68ddf642
>> llvm::sys::PrintStackTrace(_IO_FILE*) + 34
>> 1  libLLVM-3.3.so  0x00007f9f68dde9a9
>> 2  libpthread.so.0 0x00007f9f67a07cb0
>> 3  libc.so.6       0x00007f9f67156425 gsignal + 53
>> 4  libc.so.6       0x00007f9f67159b8b abort + 379
>> 5  libLLVM-3.3.so  0x00007f9f68dc1e7c
>> 6  libLLVM-3.3.so  0x00007f9f68fd1832
>> llvm::X86InstrInfo::copyPhysReg(llvm::MachineBasicBlock&,
>> llvm::MachineBasicBlock::bundle_iterator<llvm::MachineInstr,
>> llvm::ilist_iterator<llvm::MachineInstr> >, llvm::DebugLoc, unsigned
>> int, unsigned int, bool) const + 1762
>> 7  libLLVM-3.3.so  0x00007f9f683afab1
>> 8  libLLVM-3.3.so  0x00007f9f6864c417
>> llvm::FPPassManager::runOnFunction(llvm::Function&) + 487
>> 9  libLLVM-3.3.so  0x00007f9f6864c50b
>> llvm::FPPassManager::runOnModule(llvm::Module&) + 43
>> 10 libLLVM-3.3.so  0x00007f9f6864beff
>> llvm::MPPassManager::runOnModule(llvm::Module&) + 559
>> 11 libLLVM-3.3.so  0x00007f9f6864c165
>> llvm::PassManagerImpl::run(llvm::Module&) + 245
>> 12 llc             0x000000000040d217
>> 13 llc             0x0000000000409a58 main + 360
>> 14 libc.so.6       0x00007f9f6714176d __libc_start_main + 237
>> 15 llc             0x0000000000409ae1
>> Stack dump:
>> 0.  Program arguments: /opt/llvm/install/bin/llc err.ll -o err.s
>> 1.  Running pass 'Function Pass Manager' on module 'err.ll'.
>> 2.  Running pass 'Post-RA pseudo instruction expansion pass' on function
>> '@junk___init_module_get_args_3'
>>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
> 
> 


-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.



More information about the llvm-dev mailing list