Llvm 断言失败:(LHSCst!=RHSCst&“上面没有折叠比较?”)

Llvm 断言失败:(LHSCst!=RHSCst&“上面没有折叠比较?”),llvm,alchemy,llvm-gcc,Llvm,Alchemy,Llvm Gcc,我试图使用编译v4.8.1,但遇到了LLVM问题: Assertion failed: (LHSCst != RHSCst && "Compares not folded above?"), function visitAnd, file /Volumes/data/dev/FlaCC/llvm-2.1/lib/Transforms/Scalar/InstructionCombining.cpp, line 3465. 0 llvm-ld

我试图使用编译v4.8.1,但遇到了LLVM问题:

Assertion failed: (LHSCst != RHSCst && "Compares not folded above?"), function visitAnd, file /Volumes/data/dev/FlaCC/llvm-2.1/lib/Transforms/Scalar/InstructionCombining.cpp, line 3465.
0   llvm-ld                             0x00264aee _ZNSt8_Rb_treeIN4llvm3sys4PathES2_St9_IdentityIS2_ESt4lessIS2_ESaIS2_EE13insert_uniqueERKS2_ + 6078
1   llvm-ld                             0x00265092 _ZNSt8_Rb_treeIN4llvm3sys4PathES2_St9_IdentityIS2_ESt4lessIS2_ESaIS2_EE13insert_uniqueERKS2_ + 7522
2   libSystem.B.dylib                   0x970a805b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libSystem.B.dylib                   0x971355a5 raise + 26
5   libSystem.B.dylib                   0x9714b6e4 abort + 93
6   libSystem.B.dylib                   0x9713820f __assert_rtn + 252
7   llvm-ld                             0x000a0816 _ZN4llvm15callDefaultCtorIN91_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Transforms_Scalar_GVN.cpp_00000000_4964B02A3GVNEEEPNS_4PassEv + 252214
8   llvm-ld                             0x000cf25e _ZN4llvm11InstVisitorIN108_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Transforms_Scalar_InstructionCombining.cpp_00000000_6BB61AFF12InstCombinerEPNS_11InstructionEE5visitERS3_ + 766
9   llvm-ld                             0x000c5895 _ZN4llvm15callDefaultCtorIN91_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Transforms_Scalar_GVN.cpp_00000000_4964B02A3GVNEEEPNS_4PassEv + 403893
10  llvm-ld                             0x000c631c _ZN4llvm15callDefaultCtorIN91_GLOBAL__N__Volumes_data_dev_FlaCC_llvm_2.1_lib_Transforms_Scalar_GVN.cpp_00000000_4964B02A3GVNEEEPNS_4PassEv + 406588
11  llvm-ld                             0x002004a6 _ZN4llvm12FunctionPassD1Ev + 20998
12  llvm-ld                             0x002008fa _ZN4llvm12FunctionPassD1Ev + 22106
13  llvm-ld                             0x00200e51 _ZN4llvm12FunctionPassD1Ev + 23473
14  llvm-ld                             0x0020125a _ZN4llvm12FunctionPassD1Ev + 24506
15  llvm-ld                             0x002012da _ZN4llvm12FunctionPassD1Ev + 24634
16  llvm-ld                             0x00002f10 0x0 + 12048
17  llvm-ld                             0x000091e2 _ZN4llvm2cl3optINS_12PluginLoaderELb0ENS0_6parserISsEEE16handleOccurrenceEjPKcRKSs + 11986
18  llvm-ld                             0x00002706 0x0 + 9990
make[2]: *** [../../bin/genrb] Error 6
make[1]: *** [all-recursive] Error 2
make: *** [all-recursive] Error 2

什么样的代码导致链接器出现此问题?这似乎与铸造左手侧铸造有关!=右侧浇铸。我不愿意修改ICU代码以使其可编译,但我不确定要修改什么。

可能有很多事情。可能的原因是将坏的llvm IR馈送到链接器。你最好的办法是和炼金术专家谈谈,看看他们在做什么,然后让他们调试。

这是llvm ld的崩溃,而不是炼金术。Alchemy的代码直到llvm ld完成后才开始使用。那么,用于生成IR的前端是什么呢?那么,您最好在llvm.org上提交一个bug,并提供一个可复制的测试用例,以便我们可以查看它。您正在使用哪个版本的llvm gcc以及哪个主机/目标?Alchemy的llvm非常旧:v2.1。不幸的是,无法升级,因为将IR转换为AVM2字节码的后端是封闭源代码,并且依赖于此特定版本的IR格式。虽然我希望修补v2.1来解决这个问题,但我需要llvm社区的一些帮助。我想我会提交一个bug,看看它会去哪里。。。