<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 - opt -jump-threading crashing after 69bdfb075b2"
   href="https://bugs.llvm.org/show_bug.cgi?id=46343">46343</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt -jump-threading crashing after 69bdfb075b2
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mikael.holmen@ericsson.com
          </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=23619" name="attach_23619" title="bbi-44193.ll reproducer">attachment 23619</a> <a href="attachment.cgi?id=23619&action=edit" title="bbi-44193.ll reproducer">[details]</a></span>
bbi-44193.ll reproducer

Reproduce with:
 opt -S -o - bbi-44193.ll -jump-threading

Result:
 PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: build-all-builtins/bin/opt -S -o - bbi-44193.ll
-jump-threading 
1.      Running pass 'Function Pass Manager' on module 'bbi-44193.ll'.
2.      Running pass 'Jump Threading' on function '@func_1'
build-all-builtins/bin/opt[0x44fa1a4]
build-all-builtins/bin/opt(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x44f7cde]
build-all-builtins/bin/opt[0x44fa4bc]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f5300879890]
build-all-builtins/bin/opt(_ZN4llvm11Instruction15eraseFromParentEv+0x36)[0x3d291c6]
build-all-builtins/bin/opt(_ZN4llvm42RecursivelyDeleteTriviallyDeadInstructionsERNS_15SmallVectorImplINS_14WeakTrackingVHEEEPKNS_17TargetLibraryInfoEPNS_16MemorySSAUpdaterE+0x377)[0x4578bc7]
build-all-builtins/bin/opt(_ZN4llvm52RecursivelyDeleteTriviallyDeadInstructionsPermissiveERNS_15SmallVectorImplINS_14WeakTrackingVHEEEPKNS_17TargetLibraryInfoEPNS_16MemorySSAUpdaterE+0x117)[0x4578257]
build-all-builtins/bin/opt(_ZN4llvm22ConstantFoldTerminatorEPNS_10BasicBlockEbPKNS_17TargetLibraryInfoEPNS_14DomTreeUpdaterE+0x1d5)[0x4576955]
build-all-builtins/bin/opt(_ZN4llvm17JumpThreadingPass12ProcessBlockEPNS_10BasicBlockE+0xebd)[0x425866d]
build-all-builtins/bin/opt(_ZN4llvm17JumpThreadingPass7runImplERNS_8FunctionEPNS_17TargetLibraryInfoEPNS_13LazyValueInfoEPNS_9AAResultsEPNS_14DomTreeUpdaterEbSt10unique_ptrINS_18BlockFrequencyInfoESt14default_deleteISC_EESB_INS_21BranchProbabilityInfoESD_ISG_EE+0x56b)[0x4256f3b]
build-all-builtins/bin/opt[0x4267543]
build-all-builtins/bin/opt(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x484)[0x3d5ba34]
build-all-builtins/bin/opt(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x38)[0x3d5bd08]
build-all-builtins/bin/opt(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x51d)[0x3d5c35d]
build-all-builtins/bin/opt(main+0x2acb)[0x24df54b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f52ff305b97]
build-all-builtins/bin/opt(_start+0x2a)[0x24c902a]
Segmentation fault (core dumped)

This starts happening with commit 69bdfb075b2:
    [IR] Clean up dead instructions after simplifying a conditional branch

    Change BasicBlock::removePredecessor to optionally return a vector of
    instructions which might be dead. Use this in ConstantFoldTerminator to
    delete them if they are dead.

    Reapply with a bug fix: don't drop the "!KeepOneInputPHIs" argument when
    removePredecessor calls PHINode::removeIncomingValue.

    Differential Revision: <a href="https://reviews.llvm.org/D80206">https://reviews.llvm.org/D80206</a></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>