致命错误:后端错误:无法选择:0x7793fa0:f64 = xor 0x74291b0,常量:i8< -3> [英] fatal error: error in backend: Cannot select: 0x7793fa0: f64 = xor 0x74291b0, Constant:i8<-3>

查看:235
本文介绍了致命错误:后端错误:无法选择:0x7793fa0:f64 = xor 0x74291b0,常量:i8< -3>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我使用以下命令时的错误消息:

This is the error message when I use the following command:

clang++ test.cpp -mypass -fno-use-cxa-atexit

直接使用我的转换过程编译我的test.cpp源文件.

to compile my test.cpp source file directly with my transform pass.

Error message:
fatal error: error in backend: Cannot select: 0x7793fa0: f64 = xor 0x74291b0,
      Constant:i8<-3>
  0x74291b0: f64,ch = load<LD8[%1064](align=1)> 0x732b440, 0x74317d0, undef:i64
    0x74317d0: i64 = add 0x7794390, 0x7428f10
      0x7794390: i64 = shl 0x7464360, Constant:i8<3>
        0x7464360: i64 = sign_extend 0x7430d50
          0x7430d50: i32,ch = CopyFromReg 0x732b440, Register:i32 %vreg212
            0x77949b0: i32 = Register %vreg212
        0x77bbd40: i8 = Constant<3>
      0x7428f10: i64 = X86ISD::Wrapper TargetGlobalAddress:i64<[27 x double]* @_ZZ9test_mainiPPcE5valsA.291> 0
        0x77904a0: i64 = TargetGlobalAddress<[27 x double]* @_ZZ9test_mainiPPcE5valsA.291> 0
    0x7431990: i64 = undef
  0x77bbdb0: i8 = Constant<-3>
In function: .datadiv_decode15430557481081536446
clang-3.9: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 3.9.1 (tags/RELEASE_391/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/oubotong/obf/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-3.9: note: diagnostic msg: 
********************

但是,当我使用以下命令分别编译时:

However, when I use the following command to compile seperately:

clang++ -emit-llvm -S test.cpp -mypass -fno-use-cxa-atexit

此命令生成test.ll,然后使用:

This command generate test.ll and then use:

llvm-as test.ll -o test.bc

生成test.bc并最终使用:

lli test.bc

运行程序. 没有错误,我的程序运行良好. 那么为什么直接编译test.cpp时出现错误? 这是我通过的源代码的一部分:

to run the program. There are no errors and my program works well. Then why the error came when I compile the test.cpp directly? Here is part of my source code in pass:

LoadInst *Load=builder.CreateLoad(gvar);
Load->setAlignment(8);
Value* indexList[2] = {ConstantInt::get(variable->getType(), 0), variable};                                 
Value *const_key=builder.getInt8(key);
Value *GEP=builder.CreateGEP(gvar,ArrayRef<Value*>(indexList, 2),"arrayIdx");
LoadInst *loadElement=builder.CreateLoad(GEP);
loadElement->setAlignment(1);
Value *Xor = builder.CreateXor(loadElement,const_key,"xor");
StoreInst *Store = builder.CreateStore(Xor, GEP);
Store->setAlignment(1);

推荐答案

答案很晚,但是实际上,当您拥有.ll文件时,llc命令可以为您提供一些有意义的提示,说明为什么事情没有编译

Pretty late answer but actually, when you have the .ll file, the llc command can give you some meaningful hints on why things aren't compiling.

Cannot select错误更加隐秘.

这篇关于致命错误:后端错误:无法选择:0x7793fa0:f64 = xor 0x74291b0,常量:i8&lt; -3&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆