<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 -enable-new-pm=0 -enable-loop-distribute -O1 crashes with Assertion `Ptr != End && "dereferencing end() iterator"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=50296">50296</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt -enable-new-pm=0 -enable-loop-distribute -O1 crashes with Assertion `Ptr != End && "dereferencing end() iterator"' failed.
          </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>Loop Optimizer
          </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=24848" name="attach_24848" title="bbi-55997_2.ll reproducer">attachment 24848</a> <a href="attachment.cgi?id=24848&action=edit" title="bbi-55997_2.ll reproducer">[details]</a></span>
bbi-55997_2.ll reproducer

Reproduce with
 opt -o /dev/null bbi-55997_2.ll -enable-new-pm=0 -enable-loop-distribute -O1

Result:
opt: ../include/llvm/ADT/DenseMap.h:1239: llvm::DenseMapIterator::pointer
llvm::DenseMapIterator<llvm::PointerIntPair<llvm::Value *, 1, bool,
llvm::PointerLikeTypeTraits<llvm::Value *>,
llvm::PointerIntPairInfo<llvm::Value *, 1,
llvm::PointerLikeTypeTraits<llvm::Value *> > >, std::vector<unsigned int,
std::allocator<unsigned int> >,
llvm::DenseMapInfo<llvm::PointerIntPair<llvm::Value *, 1, bool,
llvm::PointerLikeTypeTraits<llvm::Value *>,
llvm::PointerIntPairInfo<llvm::Value *, 1,
llvm::PointerLikeTypeTraits<llvm::Value *> > > >,
llvm::detail::DenseMapPair<llvm::PointerIntPair<llvm::Value *, 1, bool,
llvm::PointerLikeTypeTraits<llvm::Value *>,
llvm::PointerIntPairInfo<llvm::Value *, 1,
llvm::PointerLikeTypeTraits<llvm::Value *> > >, std::vector<unsigned int,
std::allocator<unsigned int> > >, true>::operator->() const [KeyT =
llvm::PointerIntPair<llvm::Value *, 1, bool,
llvm::PointerLikeTypeTraits<llvm::Value *>,
llvm::PointerIntPairInfo<llvm::Value *, 1,
llvm::PointerLikeTypeTraits<llvm::Value *> > >, ValueT = std::vector<unsigned
int, std::allocator<unsigned int> >, KeyInfoT =
llvm::DenseMapInfo<llvm::PointerIntPair<llvm::Value *, 1, bool,
llvm::PointerLikeTypeTraits<llvm::Value *>,
llvm::PointerIntPairInfo<llvm::Value *, 1,
llvm::PointerLikeTypeTraits<llvm::Value *> > > >, Bucket =
llvm::detail::DenseMapPair<llvm::PointerIntPair<llvm::Value *, 1, bool,
llvm::PointerLikeTypeTraits<llvm::Value *>,
llvm::PointerIntPairInfo<llvm::Value *, 1,
llvm::PointerLikeTypeTraits<llvm::Value *> > >, std::vector<unsigned int,
std::allocator<unsigned int> > >, IsConst = true]: Assertion `Ptr != End &&
"dereferencing end() iterator"' failed.
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: ../../master-github/llvm/build-all/bin/opt -o
/dev/null bbi-55997_2.ll -enable-new-pm=0 -enable-loop-distribute -O1
1.      Running pass 'Function Pass Manager' on module 'bbi-55997_2.ll'.
2.      Running pass 'Loop Distribution' on function '@f'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH
or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
../../master-github/llvm/build-all/bin/opt(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x23)[0x29a37d3]
../../master-github/llvm/build-all/bin/opt(_ZN4llvm3sys17RunSignalHandlersEv+0xee)[0x29a148e]
../../master-github/llvm/build-all/bin/opt[0x29a3b56]
/lib64/libpthread.so.0(+0xf630)[0x7fe47e5bc630]
/lib64/libc.so.6(gsignal+0x37)[0x7fe47bcef387]
/lib64/libc.so.6(abort+0x148)[0x7fe47bcf0a78]
/lib64/libc.so.6(+0x2f1a6)[0x7fe47bce81a6]
/lib64/libc.so.6(+0x2f252)[0x7fe47bce8252]
../../master-github/llvm/build-all/bin/opt(_ZNK4llvm16MemoryDepChecker24getInstructionsForAccessEPNS_5ValueEb+0x1a9)[0x19f81e9]
../../master-github/llvm/build-all/bin/opt[0x272c87c]
../../master-github/llvm/build-all/bin/opt[0x272a518]
../../master-github/llvm/build-all/bin/opt[0x27302b0]
../../master-github/llvm/build-all/bin/opt(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x47f)[0x21a0a3f]
../../master-github/llvm/build-all/bin/opt(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x38)[0x21a7398]
../../master-github/llvm/build-all/bin/opt(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x35d)[0x21a100d]
../../master-github/llvm/build-all/bin/opt(main+0x3153)[0x778573]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7fe47bcdb555]
../../master-github/llvm/build-all/bin/opt[0x763440]
Abort

It starts crashing with ed9df5bd2f50b
    [Passes] Run sinking/hoisting in SimplifyCFG earlier.

but I suspect that it's connected to 1ed7f8ede564c
    [LAA] Support pointer phis in loop by analyzing each incoming pointer.

(If I let bugpoint run on this crash I end up with the crash in
 <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - opt -enable-loop-distribute -loop-distribute crashes with Assertion `Partition != -2 && "Pointer not belonging to any partition"' failed."
   href="show_bug.cgi?id=50288">https://bugs.llvm.org/show_bug.cgi?id=50288</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>