patch for crash on thumb backend by constanthoisting

Bob Pan via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 10 11:23:06 PDT 2017


hi guys,

I have created a pull request on github https://github.com/
llvm-mirror/llvm/pull/46 ,

My project fails on the clang 4.0,  the crash log is,

#0 0x0000000000dffa24 PrintStackTraceSignalHandler(void*)
(/home/bob/projects/llvm-build/bin/llc+0xdffa24)
#1 0x0000000000dffcf6 SignalHandler(int)
(/home/bob/projects/llvm-build/bin/llc+0xdffcf6)
#2 0x0000000000f0aa50 __restore_rt
(/home/bob/projects/llvm-build/bin/llc+0xf0aa50)
#3 0x0000000000720cb3 (anonymous
namespace)::AddressingModeMatcher::matchOperationAddr(llvm::User*,
unsigned int, unsigned int, bool*)
(/home/bob/projects/llvm-build/bin/llc+0x720cb3)
#4 0x0000000000720147 (anonymous
namespace)::AddressingModeMatcher::matchAddr(llvm::Value*, unsigned
int) (/home/bob/projects/llvm-build/bin/llc+0x720147)
#5 0x000000000071a34b (anonymous
namespace)::CodeGenPrepare::optimizeMemoryInst(llvm::Instruction*,
llvm::Value*, llvm::Type*, unsigned int)
(/home/bob/projects/llvm-build/bin/llc+0x71a34b)
#6 0x0000000000714a07 (anonymous
namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&)
(/home/bob/projects/llvm-build/bin/llc+0x714a07)
#7 0x000000000070d15e (anonymous
namespace)::CodeGenPrepare::runOnFunction(llvm::Function&)
(/home/bob/projects/llvm-build/bin/llc+0x70d15e)
#8 0x00000000009d78c3
llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/bob/projects/llvm-build/bin/llc+0x9d78c3)
#9 0x00000000009d7ab3 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/bob/projects/llvm-build/bin/llc+0x9d7ab3)
#10 0x00000000009d7eba
llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/bob/projects/llvm-build/bin/llc+0x9d7eba)
#11 0x000000000043de7a compileModule(char**, llvm::LLVMContext&)
(/home/bob/projects/llvm-build/bin/llc+0x43de7a)
#12 0x000000000043b0eb main (/home/bob/projects/llvm-build/bin/llc+0x43b0eb)
#13 0x00000000011dee1d generic_start_main
(/home/bob/projects/llvm-build/bin/llc+0x11dee1d)
#14 0x00000000011df08d __libc_start_main
(/home/bob/projects/llvm-build/bin/llc+0x11df08d)
#15 0x000000000043a5ea _start (/home/bob/projects/llvm-build/bin/llc+0x43a5ea)
Stack dump:
0.      Program arguments: /home/bob/projects/llvm-build/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)

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.

 the patch is just pass the first&last and skip other operand of GEP.

details are list on the github pull request.
https://github.com/llvm-mirror/llvm/pull/46

BR,
b0b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170611/6fa5be3c/attachment.html>


More information about the llvm-commits mailing list