<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 - SEGV in llvm::APInt::getZExtValue"
   href="https://bugs.llvm.org/show_bug.cgi?id=33636">33636</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SEGV in llvm::APInt::getZExtValue
          </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>Backend: PowerPC
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>anton@samba.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>echristo@gmail.com, hfinkel@anl.gov, kbarton@linux.vnet.ibm.com, llvm-bugs@lists.llvm.org, nemanja.i.ibm@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18730" name="attach_18730" title="Test case">attachment 18730</a> <a href="attachment.cgi?id=18730&action=edit" title="Test case">[details]</a></span>
Test case

I'm seeing quite a few SEGVs in llvm::APInt::getZExtValue when running csmith.
Testcase attached.

# llc bugpoint-reduced-simplified.ll

#0 0x000000002826ea44 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/anton/llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x000000002826eb70 PrintStackTraceSignalHandler(void*)
/home/anton/llvm/lib/Support/Unix/Signals.inc:461:0
#2 0x000000002826c75c llvm::sys::RunSignalHandlers()
/home/anton/llvm/lib/Support/Signals.cpp:50:0
#3 0x000000002826c924 SignalHandler(int)
/home/anton/llvm/lib/Support/Unix/Signals.inc:242:0
#4 0x00003fff834104d8  0x4d8 llvm::APInt::getZExtValue() const
#5 0x00003fff834104d8 /home/anton/llvm/include/llvm/ADT/APInt.h:1539:0
llvm::ConstantInt::getZExtValue() const
#6 0x00003fff834104d8 /home/anton/llvm/include/llvm/IR/Constants.h:150:0
llvm::ConstantSDNode::getZExtValue() const
#7 0x00003fff834104d8
/home/anton/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1431:0 foldBoolExts
#8 0x00003fff834104d8
/home/anton/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:4047:0 (anonymous
namespace)::PPCDAGToDAGISel::PreprocessISelDAG()
#9 0x00003fff834104d8
/home/anton/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:4079:0 
#10 0x00003fff834104d8 operator()
/home/anton/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:4034:0
#11 0x00003fff834104d8 foldBoolExts
/home/anton/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:4040:0
#12 0x00003fff834104d8 (anonymous
namespace)::PPCDAGToDAGISel::PreprocessISelDAG()
/home/anton/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:4079:0
#13 0x00000000276698f4 llvm::SelectionDAGISel::DoInstructionSelection()
/home/anton/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:922:0
#14 0x00000000276698b8 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
/home/anton/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:847:0
#15 0x0000000028126694
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction,
false, false, void>, false, true>,
llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false,
false, void>, false, true>, bool&)
/home/anton/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:660:0
#16 0x000000002812de44
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
/home/anton/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1599:0
#17 0x000000002812e2ec
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
/home/anton/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:466:0
#18 0x0000000028133328 (anonymous
namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
/home/anton/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:125:0
#19 0x000000002813567c
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/home/anton/llvm/lib/CodeGen/MachineFunctionPass.cpp:62:0
#20 0x0000000027671178 llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/anton/llvm/lib/IR/LegacyPassManager.cpp:1519:0
#21 0x00000000279f8d2c llvm::FPPassManager::runOnModule(llvm::Module&)
/home/anton/llvm/lib/IR/LegacyPassManager.cpp:1540:0
#22 0x0000000027d0714c runOnModule
/home/anton/llvm/lib/IR/LegacyPassManager.cpp:1596:0
#23 0x0000000027d0714c llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/anton/llvm/lib/IR/LegacyPassManager.cpp:1699:0
#24 0x0000000027d07268 llvm::legacy::PassManager::run(llvm::Module&)
/home/anton/llvm/lib/IR/LegacyPassManager.cpp:1730:0
#25 0x0000000027d07fb4 compileModule(char**, llvm::LLVMContext&)
/home/anton/llvm/tools/llc/llc.cpp:609:0
#26 0x0000000027d0823c main /home/anton/llvm/tools/llc/llc.cpp:350:0
#27 0x000000002761eaa8 generic_start_main
/build/glibc-I4GUKU/glibc-2.24/csu/../csu/libc-start.c:291:0
#28 0x00000000275dbfd8 __libc_start_main
/build/glibc-I4GUKU/glibc-2.24/csu/../sysdeps/unix/sysv/linux/powerpc/libc-start.c:116:0</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>