<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 crashes with "opt -jump-threading -consthoist""
   href="https://bugs.llvm.org/show_bug.cgi?id=40931">40931</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt crashes with "opt -jump-threading -consthoist"
          </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>cszide@163.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=21544" name="attach_21544" title=".bc file of the source code">attachment 21544</a> <a href="attachment.cgi?id=21544&action=edit" title=".bc file of the source code">[details]</a></span>
.bc file of the source code

$clang -v
clang version 9.0.0 (trunk 354742)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jack-zhou/Documents/llvm/llvm_truck/llvm/build/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$clang -O3 -c -emit-llvm  -mllvm -disable-llvm-optzns small.c -o small.bc

$opt -jump-threading -consthoist small.bc -o small-opt.bc
Stack dump:
0.      Program arguments:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/build2/bin/opt -jump-threading
-consthoist small.bc -o small-opt.bc 
1.      Running pass 'Function Pass Manager' on module 'small.bc'.
2.      Running pass 'Constant Hoisting' on function '@a'
 #0 0x0000564539681b7b llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Support/Unix/Signals.inc:494:0
 #1 0x0000564539681c0e PrintStackTraceSignalHandler(void*)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Support/Unix/Signals.inc:558:0
 #2 0x000056453967fb92 llvm::sys::RunSignalHandlers()
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Support/Signals.cpp:68:0
 #3 0x000056453968159d SignalHandler(int)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Support/Unix/Signals.inc:357:0
 #4 0x00007f33df8b5890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x0000564538d78da2 llvm::DomTreeNodeBase<llvm::BasicBlock>::getIDom() const
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/include/llvm/Support/GenericDomTree.h:82:0
 #6 0x00005645392f3a5e findBestInsertionSet(llvm::DominatorTree&,
llvm::BlockFrequencyInfo&, llvm::BasicBlock*,
llvm::SmallPtrSet<llvm::BasicBlock*, 8u>&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp:225:0
 #7 0x00005645392f4400
llvm::ConstantHoistingPass::findConstantInsertionPoint(llvm::consthoist::ConstantInfo
const&) const
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp:319:0
 #8 0x00005645392f6f1e
llvm::ConstantHoistingPass::emitBaseConstants(llvm::GlobalVariable*)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp:826:0
 #9 0x00005645392f7a17 llvm::ConstantHoistingPass::runImpl(llvm::Function&,
llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo*,
llvm::BasicBlock&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp:941:0
#10 0x00005645392f35b7 (anonymous
namespace)::ConstantHoistingLegacyPass::runOnFunction(llvm::Function&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp:153:0
#11 0x0000564538e021fc llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1643:0
#12 0x0000564538e02473 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1678:0
#13 0x0000564538e02844 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1743:0
#14 0x0000564538e02fd3 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1856:0
#15 0x0000564538e031c5 llvm::legacy::PassManager::run(llvm::Module&)
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/lib/IR/LegacyPassManager.cpp:1888:0
#16 0x000056453706015f main
/home/jack-zhou/Documents/llvm/llvm_truck/llvm/tools/opt/opt.cpp:862:0
#17 0x00007f33de54ab97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#18 0x0000564537021cba _start
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm/build2/bin/opt+0x1808cba)
Segmentation fault (core dumped)

The following is the source code of small.c, which is generated by csmith 2.4.0
and reduced by creduce 2.9.0 (eca4f38).

#include "csmith.h"
a() {
  for (; a;) {
    int32_t b;
    b ^= 2176111200;
  }
  int32_t *c;
  for (;;)
    c = 3232813488;
}</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>