<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 object file generation related to branching, aggregates and inlining"
   href="https://bugs.llvm.org/show_bug.cgi?id=33094">33094</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Infinite loop in object file generation related to branching, aggregates and inlining
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>benoit.vey@etu.upmc.fr
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18469" name="attach_18469" title="Minimal case">attachment 18469</a> <a href="attachment.cgi?id=18469&action=edit" title="Minimal case">[details]</a></span>
Minimal case

Trying to generate an object file for the optimised version of the attached
minimal case (either via llc or the LLVM API) results in an infinite loop.

Here is the deepest debugger backtrace that I've managed to get (from llc):

  #0  0x00007ffff57bd642 in
llvm::SelectionDAG::TransferDbgValues(llvm::SDValue, llvm::SDValue) () from
/usr/bin/../lib/libLLVM-4.0.so
  #1  0x00007ffff57be516 in
llvm::SelectionDAG::ReplaceAllUsesOfValueWith(llvm::SDValue, llvm::SDValue) ()
from /usr/bin/../lib/libLLVM-4.0.so
  #2  0x00007ffff56986c8 in ?? () from /usr/bin/../lib/libLLVM-4.0.so
  #3  0x00007ffff5699a6f in ?? () from /usr/bin/../lib/libLLVM-4.0.so
  #4  0x00007ffff569af2d in llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults&, llvm::CodeGenOpt::Level) () from
/usr/bin/../lib/libLLVM-4.0.so
  #5  0x00007ffff57c85de in llvm::SelectionDAGISel::CodeGenAndEmitDAG() () from
/usr/bin/../lib/libLLVM-4.0.so
  #6  0x00007ffff57d10b7 in
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) () from
/usr/bin/../lib/libLLVM-4.0.so
  #7  0x00007ffff57d2d49 in
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) () from
/usr/bin/../lib/libLLVM-4.0.so
  #8  0x00007ffff6a09e74 in ?? () from /usr/bin/../lib/libLLVM-4.0.so
  #9  0x00007ffff54ae841 in
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) () from
/usr/bin/../lib/libLLVM-4.0.so
  #10 0x00007ffff532eb32 in llvm::FPPassManager::runOnFunction(llvm::Function&)
() from /usr/bin/../lib/libLLVM-4.0.so
  #11 0x00007ffff532ebd3 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
from /usr/bin/../lib/libLLVM-4.0.so
  #12 0x00007ffff532f584 in llvm::legacy::PassManagerImpl::run(llvm::Module&)
() from /usr/bin/../lib/libLLVM-4.0.so
  #13 0x000000000041eb46 in ?? ()
  #14 0x0000000000413870 in main ()

This doesn't seem to happen in the minimal case if either:

- All the code is in `f1`
- The result of the `icmp` in `f2` is true (can be done e.g. by passing
`@B_Inst` to `f2`)
- Both aggregates in the `phi` node in `f2` have the same value
- The `phi` node operands are numbers instead of aggregates
- The `icmp` operands are numbers instead of aggregates

For reference, this bug was originally found in the Pony compiler (additional
details can be found here: <a href="https://github.com/ponylang/ponyc/issues/1919">https://github.com/ponylang/ponyc/issues/1919</a>). The
attached minimal case wasn't generated by the Pony compiler.</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>