<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - EarlyCSE Assertion `Val && "isa<> used on a null pointer"'"
   href="https://llvm.org/bugs/show_bug.cgi?id=24488">24488</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>EarlyCSE Assertion `Val && "isa<> used on a null pointer"'
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </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>paul_robinson@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14740" name="attach_14740" title="repro IR">attachment 14740</a> <a href="attachment.cgi?id=14740&action=edit" title="repro IR">[details]</a></span>
repro IR

Found by fuzz testing.  Fails on 3.7 and trunk.
Bugpoint-reduced IR attached.  'opt' crash log from 3.7 follows.

$ opt bugpoint-reduced-simplified.ll -early-cse
opt:
/home/probinson/projects/llvm-org/llvm3.7/llvm/include/llvm/Support/Casting.h:95:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
llvm::ConstantInt; From = llvm::Constant]: Assertion `Val && "isa<> used on a
null pointer"' failed.
0  opt             0x00000000015af018
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 56
1  opt             0x00000000015ae159
2  libpthread.so.0 0x00007f79cf845340
3  libc.so.6       0x00007f79cea6dcc9 gsignal + 57
4  libc.so.6       0x00007f79cea710d8 abort + 328
5  libc.so.6       0x00007f79cea66b86
6  libc.so.6       0x00007f79cea66c32
7  opt             0x0000000001173d63
8  opt             0x0000000000f0be3e llvm::findScalarElement(llvm::Value*,
unsigned int) + 142
9  opt             0x0000000000e64c3f
llvm::SimplifyInstruction(llvm::Instruction*, llvm::DataLayout const&,
llvm::TargetLibraryInfo const*, llvm::DominatorTree const*,
llvm::AssumptionCache*) + 383
10 opt             0x00000000014358c9
11 opt             0x000000000143707f
12 opt             0x000000000125aa90
llvm::FPPassManager::runOnFunction(llvm::Function&) + 480
13 opt             0x000000000125ae2b
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
14 opt             0x000000000125b124
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 724
15 opt             0x00000000006437e1 main + 7105
16 libc.so.6       0x00007f79cea58ec5 __libc_start_main + 245
17 opt             0x000000000067df83
Stack dump:
0.    Program arguments: /home/probinson/projects/llvm-org/llvm3.7/cobj/bin/opt
-early-cse bz117445.ll -o bz117445-out.ll 
1.    Running pass 'Function Pass Manager' on module 'bz117445.ll'.
2.    Running pass 'Early CSE' on function '@autogen_SD769023506'
Aborted (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>