<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Infinite loop in Shrink Wrapping"
   href="https://llvm.org/bugs/show_bug.cgi?id=24823">24823</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Infinite loop in Shrink Wrapping
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kbarton@ca.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14880" name="attach_14880" title="ll file that exposes an infinite loop in shrink wrapping code">attachment 14880</a> <a href="attachment.cgi?id=14880&action=edit" title="ll file that exposes an infinite loop in shrink wrapping code">[details]</a></span>
ll file that exposes an infinite loop in shrink wrapping code

There is an infinite loop at compile time, in the shrink wrapping code when
compiling the attached test case.
The problem appears at -O3, -O2 compiled fine (I did not try other options). I
can reproduce the hang with simply: llc shrink.ll

The traceback from GDB contains:

(gdb) where
#0  0x0000000011c45eb0 in
llvm::DenseMapBase<llvm::DenseMap<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > >,
llvm::DenseMapInfo<llvm::MachineBasicBlock*>,
llvm::detail::DenseMapPair<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > > > >,
llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > >,
llvm::DenseMapInfo<llvm::MachineBasicBlock*>,
llvm::detail::DenseMapPair<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > > >
<span class="quote">>::LookupBucketFor<llvm::MachineBasicBlock*> (</span >
    this=0x100208d0030, Val=@0x3fffd4805f80: 0x10020ab9678,
FoundBucket=@0x3fffd4805f48: 0x10020aa42e8) at
/home/kbarton/llvm/src/dev.git/include/llvm/ADT/DenseMap.h:471
#1  0x0000000011c40314 in
llvm::DenseMapBase<llvm::DenseMap<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > >,
llvm::DenseMapInfo<llvm::MachineBasicBlock*>,
llvm::detail::DenseMapPair<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > > > >,
llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > >,
llvm::DenseMapInfo<llvm::MachineBasicBlock*>,
llvm::detail::DenseMapPair<llvm::MachineBasicBlock*,
std::unique_ptr<llvm::DomTreeNodeBase<llvm::MachineBasicBlock>,
std::default_delete<llvm::DomTreeNodeBase<llvm::MachineBasicBlock> > > >
<span class="quote">>::find (this=0x100208d0030, Val=@0x3fffd4805f80: 0x10020ab9678)</span >
    at /home/kbarton/llvm/src/dev.git/include/llvm/ADT/DenseMap.h:132
#2  0x0000000011c3d4e8 in
llvm::DominatorTreeBase<llvm::MachineBasicBlock>::getNode (this=0x100208d0010,
BB=0x10020ab9678) at
/home/kbarton/llvm/src/dev.git/include/llvm/Support/GenericDomTree.h:377
#3  0x0000000011c3f198 in
llvm::DominatorTreeBase<llvm::MachineBasicBlock>::dominates
(this=0x100208d0010, A=0x10020ab9678, B=0x10020ab9518) at
/home/kbarton/llvm/src/dev.git/include/llvm/Support/GenericDomTree.h:759
#4  0x0000000010c7ecd0 in llvm::MachinePostDominatorTree::dominates
(this=0x100208ada80, A=0x10020ab9678, B=0x10020ab9518) at
/home/kbarton/llvm/src/dev.git/include/llvm/CodeGen/MachinePostDominators.h:62
#5  0x0000000011e00aa8 in (anonymous
namespace)::ShrinkWrap::updateSaveRestorePoints (this=0x100208adb20, MBB=...)
at /home/kbarton/llvm/src/dev.git/lib/CodeGen/ShrinkWrap.cpp:285
#6  0x0000000011e00df8 in (anonymous
namespace)::ShrinkWrap::runOnMachineFunction (this=0x100208adb20, MF=...) at
/home/kbarton/llvm/src/dev.git/lib/CodeGen/ShrinkWrap.cpp:345
#7  0x0000000011c68130 in llvm::MachineFunctionPass::runOnFunction
(this=0x100208adb20, F=...) at
/home/kbarton/llvm/src/dev.git/lib/CodeGen/MachineFunctionPass.cpp:43
#8  0x00000000121fcdac in llvm::FPPassManager::runOnFunction
(this=0x100208c5170, F=...) at
/home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1528
#9  0x00000000121fd010 in llvm::FPPassManager::runOnModule (this=0x100208c5170,
M=...) at /home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1549
#10 0x00000000121fd59c in (anonymous namespace)::MPPassManager::runOnModule
(this=0x100208ad5b0, M=...) at
/home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1605
#11 0x00000000121fdf34 in llvm::legacy::PassManagerImpl::run
(this=0x100208ad170, M=...) at
/home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1708
#12 0x00000000121fe310 in llvm::legacy::PassManager::run (this=0x3fffd4806610,
M=...) at /home/kbarton/llvm/src/dev.git/lib/IR/LegacyPassManager.cpp:1739
#13 0x00000000108bb9b4 in compileModule (argv=0x3fffd4806e78, Context=...) at
/home/kbarton/llvm/src/dev.git/tools/llc/llc.cpp:381
#14 0x00000000108ba5e4 in main (argc=2, argv=0x3fffd4806e78) at
/home/kbarton/llvm/src/dev.git/tools/llc/llc.cpp:204</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>