<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 -consthoist -consthoist-gep=1 crashing with Assertion `UsesNum == (ReBasesNum + NotRebasedNum) && "Not all uses are rebased"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=43903">43903</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt -consthoist -consthoist-gep=1 crashing with Assertion `UsesNum == (ReBasesNum + NotRebasedNum) && "Not all uses are rebased"' 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>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=22770" name="attach_22770" title="bbi-35111-x86.ll reproducer">attachment 22770</a> <a href="attachment.cgi?id=22770&action=edit" title="bbi-35111-x86.ll reproducer">[details]</a></span>
bbi-35111-x86.ll reproducer

Reproduce with
 opt -consthoist -consthoist-gep=1 -S -o - bbi-35111-x86.ll

which results in

opt: ../lib/Transforms/Scalar/ConstantHoisting.cpp:903: bool
llvm::ConstantHoistingPass::emitBaseConstants(llvm::GlobalVariable *):
Assertion `UsesNum == (ReBasesNum + NotRebasedNum) && "Not all uses are
rebased"' failed.
Stack dump:
0.  Program arguments: /data/repo/master/llvm/build-all-builtins/bin/opt
-consthoist -consthoist-gep=1 -S -o - bbi-35111-x86.ll 
1.  Running pass 'Function Pass Manager' on module 'bbi-35111-x86.ll'.
2.  Running pass 'Constant Hoisting' on function '@c'
 #0 0x0000000003dea8c4 PrintStackTraceSignalHandler(void*)
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x3dea8c4)
 #1 0x0000000003de85ee llvm::sys::RunSignalHandlers()
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x3de85ee)
 #2 0x0000000003deacc8 SignalHandler(int)
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x3deacc8)
 #3 0x00007fce19b9d890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007fce18646e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007fce18648801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007fce1863839a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007fce18638412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x0000000003afb227
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x3afb227)
 #9 0x0000000003afb3e0 llvm::ConstantHoistingPass::runImpl(llvm::Function&,
llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo*,
llvm::BasicBlock&, llvm::ProfileSummaryInfo*)
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x3afb3e0)
#10 0x0000000003afc65e (anonymous
namespace)::ConstantHoistingLegacyPass::runOnFunction(llvm::Function&)
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x3afc65e)
#11 0x00000000036b5a33 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x36b5a33)
#12 0x00000000036b5d18 llvm::FPPassManager::runOnModule(llvm::Module&)
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x36b5d18)
#13 0x00000000036b637d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x36b637d)
#14 0x00000000020582ed main
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x20582ed)
#15 0x00007fce18629b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#16 0x000000000203c02a _start
(/data/repo/master/llvm/build-all-builtins/bin/opt+0x203c02a)
Abort (core dumped)</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>