<div dir="ltr">hi guys,<div><br></div><div>I have created a pull request on github <a href="https://github.com/llvm-mirror/llvm/pull/46" target="_blank">https://github.com/<wbr>llvm-mirror/llvm/pull/46</a> ,</div><div><br></div><div>My project fails on the clang 4.0,  the crash log is,</div><div><br></div><div><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;margin-bottom:16px;font-stretch:normal;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(246,248,250);border-radius:3px;color:rgb(36,41,46)"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;padding:0px;margin:0px;background:transparent;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">#0 0x0000000000dffa24 PrintStackTraceSignalHandler(<wbr>void*) (/home/bob/projects/llvm-<wbr>build/bin/llc+0xdffa24)
#1 0x0000000000dffcf6 SignalHandler(int) (/home/bob/projects/llvm-<wbr>build/bin/llc+0xdffcf6)
#2 0x0000000000f0aa50 __restore_rt (/home/bob/projects/llvm-<wbr>build/bin/llc+0xf0aa50)
#3 0x0000000000720cb3 (anonymous namespace)::<wbr>AddressingModeMatcher::<wbr>matchOperationAddr(llvm::User*<wbr>, unsigned int, unsigned int, bool*) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x720cb3)
#4 0x0000000000720147 (anonymous namespace)::<wbr>AddressingModeMatcher::<wbr>matchAddr(llvm::Value*, unsigned int) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x720147)
#5 0x000000000071a34b (anonymous namespace)::CodeGenPrepare::<wbr>optimizeMemoryInst(llvm::<wbr>Instruction*, llvm::Value*, llvm::Type*, unsigned int) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x71a34b)
#6 0x0000000000714a07 (anonymous namespace)::CodeGenPrepare::<wbr>optimizeInst(llvm::<wbr>Instruction*, bool&) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x714a07)
#7 0x000000000070d15e (anonymous namespace)::CodeGenPrepare::<wbr>runOnFunction(llvm::Function&) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x70d15e)
#8 0x00000000009d78c3 llvm::FPPassManager::<wbr>runOnFunction(llvm::Function&) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x9d78c3)
#9 0x00000000009d7ab3 llvm::FPPassManager::<wbr>runOnModule(llvm::Module&) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x9d7ab3)
#10 0x00000000009d7eba llvm::legacy::PassManagerImpl:<wbr>:run(llvm::Module&) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x9d7eba)
#11 0x000000000043de7a compileModule(char**, llvm::LLVMContext&) (/home/bob/projects/llvm-<wbr>build/bin/llc+0x43de7a)
#12 0x000000000043b0eb main (/home/bob/projects/llvm-<wbr>build/bin/llc+0x43b0eb)
#13 0x00000000011dee1d generic_start_main (/home/bob/projects/llvm-<wbr>build/bin/llc+0x11dee1d)
#14 0x00000000011df08d __libc_start_main (/home/bob/projects/llvm-<wbr>build/bin/llc+0x11df08d)
#15 0x000000000043a5ea _start (/home/bob/projects/llvm-<wbr>build/bin/llc+0x43a5ea)
Stack dump:
0.      Program arguments: /home/bob/projects/llvm-build/<wbr>bin/llc -O2 z.bc -march=thumb
1.      Running pass 'Function Pass Manager' on module 'z.bc'.
2.      Running pass 'CodeGen Prepare' on function '@f'
Segmentation fault (core dumped)</code></pre></div><div>after several hours of check, i found the crash is caused by the ConstantHoisting.cpp, the index value of GEP is translated to a bitcast value.</div><div><br></div><div> the patch is just pass the first&last and skip other operand of GEP.</div><div><br></div><div>details are list on the github pull request.</div><div><a href="https://github.com/llvm-mirror/llvm/pull/46" target="_blank">https://github.com/llvm-<wbr>mirror/llvm/pull/46</a><br></div><div><br></div><div>BR,</div><div>b0b</div></div>