Infinite loop in llc on ARMv7 (LLVM HEAD from June 17)

Hello,

it looks like I do have infinite loop in llc on linux/armv7 platform somewhere in llvm::SmallVectorImpl. Two backtraces obtained with 10 seconds delay are:

0x0099be14 in llvm::SmallVectorTemplateCommon<llvm::SDNode*>::setEnd (this=0x7ee90b38, P=0x5c06988)
     at /export/home/karel/vcs/llvm-head/include/llvm/ADT/SmallVector.h:103
103 void setEnd(T *P) { this->EndX = P; }
(gdb) where
#0 0x0099be14 in llvm::SmallVectorTemplateCommon<llvm::SDNode*>::setEnd (this=0x7ee90b38,
     P=0x5c06988) at /export/home/karel/vcs/llvm-head/include/llvm/ADT/SmallVector.h:103
#1 0x00a4849c in llvm::SmallVectorImpl<llvm::SDNode*>::pop_back (this=0x7ee90b38)
     at /export/home/karel/vcs/llvm-head/include/llvm/ADT/SmallVector.h:334
#2 0x00a483b8 in llvm::SmallVectorImpl<llvm::SDNode*>::pop_back_val (this=0x7ee90b38)
     at /export/home/karel/vcs/llvm-head/include/llvm/ADT/SmallVector.h:340
#3 0x00a6f074 in llvm::SDNode::isPredecessorOf (this=0x641bb08, N=0x6212a40)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5703
#4 0x00a057c8 in CombineToPreIndexedLoadStore (this=0x7ee90f84, N=0x6238040)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5707
#5 0x00a07544 in visitLOAD (this=0x7ee90f84, N=0x6238040)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6011
#6 0x009e307c in visit (this=0x7ee90f84, N=0x6238040)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1099
#7 0x009e3148 in combine (this=0x7ee90f84, N=0x6238040)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1112
#8 0x009e24cc in Run (this=0x7ee90f84, AtLevel=llvm::NoIllegalOperations)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:978
#9 0x00a111ac in llvm::SelectionDAG::Combine (this=0x1bea328, Level=llvm::NoIllegalOperations,
     AA=..., OptLevel=llvm::CodeGenOpt::Less)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7732
#10 0x00acd9c0 in llvm::SelectionDAGISel::CodeGenAndEmitDAG (this=0x1be9f40)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:559
#11 0x00acc9a0 in llvm::SelectionDAGISel::SelectBasicBlock (this=0x1be9f40, Begin=..., End=...,
     HadTailCall=@0x7ee91158)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:414
#12 0x00acf420 in llvm::SelectionDAGISel::SelectAllBasicBlocks (this=0x1be9f40, Fn=...)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:972
#13 0x00acbee4 in llvm::SelectionDAGISel::runOnMachineFunction (this=0x1be9f40, mf=...)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:282
#14 0x00c40d7c in llvm::MachineFunctionPass::runOnFunction (this=0x1be9f40, F=...)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/MachineFunctionPass.cpp:33
#15 0x010b6a48 in llvm::FPPassManager::runOnFunction (this=0x1be53d8, F=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1513
#16 0x010b6c80 in llvm::FPPassManager::runOnModule (this=0x1be53d8, M=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1535
#17 0x010b7030 in llvm::MPPassManager::runOnModule (this=0x16d07e8, M=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1589
#18 0x010b75f8 in llvm::PassManagerImpl::run (this=0x16d0638, M=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1671
#19 0x010b7c64 in llvm::PassManager::run (this=0x7ee91470, M=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1715
#20 0x005517a4 in main (argc=6, argv=0x7ee91644)
     at /export/home/karel/vcs/llvm-head/tools/llc/llc.cpp:338

and

llvm::SmallVectorImpl<llvm::SDNode*>::pop_back (this=0x7ee90b38)
     at /export/home/karel/vcs/llvm-head/include/llvm/ADT/SmallVector.h:334
334 this->setEnd(this->end()-1);
(gdb) where
#0 llvm::SmallVectorImpl<llvm::SDNode*>::pop_back (this=0x7ee90b38)
     at /export/home/karel/vcs/llvm-head/include/llvm/ADT/SmallVector.h:334
#1 0x00a483b8 in llvm::SmallVectorImpl<llvm::SDNode*>::pop_back_val (this=0x7ee90b38)
     at /export/home/karel/vcs/llvm-head/include/llvm/ADT/SmallVector.h:340
#2 0x00a6f074 in llvm::SDNode::isPredecessorOf (this=0x643a8a8, N=0x6348d68)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5703
#3 0x00a057c8 in CombineToPreIndexedLoadStore (this=0x7ee90f84, N=0x6237d98)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5707
#4 0x00a07544 in visitLOAD (this=0x7ee90f84, N=0x6237d98)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:6011
#5 0x009e307c in visit (this=0x7ee90f84, N=0x6237d98)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1099
#6 0x009e3148 in combine (this=0x7ee90f84, N=0x6237d98)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1112
#7 0x009e24cc in Run (this=0x7ee90f84, AtLevel=llvm::NoIllegalOperations)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:978
#8 0x00a111ac in llvm::SelectionDAG::Combine (this=0x1bea328, Level=llvm::NoIllegalOperations,
     AA=..., OptLevel=llvm::CodeGenOpt::Less)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7732
#9 0x00acd9c0 in llvm::SelectionDAGISel::CodeGenAndEmitDAG (this=0x1be9f40)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:559
#10 0x00acc9a0 in llvm::SelectionDAGISel::SelectBasicBlock (this=0x1be9f40, Begin=..., End=...,
     HadTailCall=@0x7ee91158)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:414
#11 0x00acf420 in llvm::SelectionDAGISel::SelectAllBasicBlocks (this=0x1be9f40, Fn=...)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:972
#12 0x00acbee4 in llvm::SelectionDAGISel::runOnMachineFunction (this=0x1be9f40, mf=...)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:282
#13 0x00c40d7c in llvm::MachineFunctionPass::runOnFunction (this=0x1be9f40, F=...)
     at /export/home/karel/vcs/llvm-head/lib/CodeGen/MachineFunctionPass.cpp:33
#14 0x010b6a48 in llvm::FPPassManager::runOnFunction (this=0x1be53d8, F=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1513
#15 0x010b6c80 in llvm::FPPassManager::runOnModule (this=0x1be53d8, M=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1535
#16 0x010b7030 in llvm::MPPassManager::runOnModule (this=0x16d07e8, M=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1589
#17 0x010b75f8 in llvm::PassManagerImpl::run (this=0x16d0638, M=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1671
#18 0x010b7c64 in llvm::PassManager::run (this=0x7ee91470, M=...)
     at /export/home/karel/vcs/llvm-head/lib/VMCore/PassManager.cpp:1715
#19 0x005517a4 in main (argc=6, argv=0x7ee91644)
     at /export/home/karel/vcs/llvm-head/tools/llc/llc.cpp:338

LLC is invoked with flags:

llc -O1 -relocation-model=static/tmp/ghc1436_0/ghc1436_0.bc -o /tmp/ghc1436_0/ghc1436_0.lm_s

The LLC is from LLVM head as of June 17, the HEAD is:

commit ed6fa188c4cf2d382991dd054f7c5157420908c3
Author: Galina Kistanova <gkistanova@gmail.com>

     est 2008-06-04-indirectmem.ll is X86-specific. Move to X86 folder.

     git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133275 91177308-0d34-0410-b5e6-96231b3b80

Whole LLVM was build as debug build with assertions enabled, original .ll file was produced by GHC HEAD LLVM backend while compiling Haskell file from GHC source tree.

My question is if it is a known bug or unknown in which case where to report it and if also include compiled *.bc file or not.

Thanks,
Karel

Haven't seen it before... see
http://llvm.org/docs/HowToSubmitABug.html , and please do include the
.bc file (assuming you don't mind it being publicly visible).

-Eli

.bc file is free as it is produced from the free code. However shall I submit bug in a special way as described on your recommended page? If so, then please tell me what to use "crashing bug?" or "miscompilation" or "incorrect code generation"?

Thanks!
Karel

If you're not sure how, don't bother trying to reduce it; just file
the report at http://llvm.org/bugs/enter_bug.cgi with clear
reproduction steps.

-Eli

Thanks a lot for dealing with this, the bugreport is here: http://llvm.org/bugs/show_bug.cgi?id=10186

Karel