<html>
    <head>
      <base href="http://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 --- - [InstCombine] assert "Value::replaceAllUsesWith(<null>) is invalid!""
   href="http://llvm.org/bugs/show_bug.cgi?id=18600">18600</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[InstCombine] assert "Value::replaceAllUsesWith(<null>) is invalid!"
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.3
          </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>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>jfonseca@vmware.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11930" name="attach_11930" title="bugpoint-reduced-simplified.ll">attachment 11930</a> <a href="attachment.cgi?id=11930&action=edit" title="bugpoint-reduced-simplified.ll">[details]</a></span>
bugpoint-reduced-simplified.ll

$ gdb --args ~/work/vmware/llvm/llvm/build/linux-x86_64/Debug+Asserts/bin/opt
bugpoint-reduced-simplified.ll -instcombine -disable-output
(gdb) r
Starting program:
/home/jfonseca/work/vmware/llvm/llvm/build/linux-x86_64/Debug+Asserts/bin/opt
bugpoint-reduced-simplified.ll -instcombine -disable-output
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
opt: /home/jfonseca/work/vmware/llvm/llvm/lib/IR/Value.cpp:304: void
llvm::Value::replaceAllUsesWith(llvm::Value*): Assertion `New &&
"Value::replaceAllUsesWith(<null>) is invalid!"' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6e09f77 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
56    ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6e09f77 in __GI_raise (sig=sig@entry=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff6e0d5e8 in __GI_abort () at abort.c:90
#2  0x00007ffff6e02d43 in __assert_fail_base (fmt=0x7ffff6f59f58 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x1388e80 "New &&
\"Value::replaceAllUsesWith(<null>) is invalid!\"", 
    file=file@entry=0x13886c0
"/home/jfonseca/work/vmware/llvm/llvm/lib/IR/Value.cpp", line=line@entry=304, 
    function=function@entry=0x138ae00
<llvm::Value::replaceAllUsesWith(llvm::Value*)::__PRETTY_FUNCTION__> "void
llvm::Value::replaceAllUsesWith(llvm::Value*)") at assert.c:92
#3  0x00007ffff6e02df2 in __GI___assert_fail (assertion=0x1388e80 "New &&
\"Value::replaceAllUsesWith(<null>) is invalid!\"", 
    file=0x13886c0 "/home/jfonseca/work/vmware/llvm/llvm/lib/IR/Value.cpp",
line=304, 
    function=0x138ae00
<llvm::Value::replaceAllUsesWith(llvm::Value*)::__PRETTY_FUNCTION__> "void
llvm::Value::replaceAllUsesWith(llvm::Value*)")
    at assert.c:101
#4  0x0000000000ed99ab in llvm::Value::replaceAllUsesWith
(this=this@entry=0x1772590, New=New@entry=0x0)
    at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/Value.cpp:304
#5  0x0000000000aef2dc in llvm::InstCombiner::ReplaceInstUsesWith
(this=<optimised out>, I=..., V=0x0)
    at
/home/jfonseca/work/vmware/llvm/llvm/lib/Transforms/InstCombine/InstCombine.h:278
#6  0x0000000000b4ddf0 in llvm::InstCombiner::visitExtractElementInst
(this=0x1782370, EI=...)
    at
/home/jfonseca/work/vmware/llvm/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:180
#7  0x0000000000aecd64 in llvm::InstCombiner::DoOneIteration
(this=this@entry=0x1782370, F=..., Iteration=Iteration@entry=0)
    at
/home/jfonseca/work/vmware/llvm/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2427
#8  0x0000000000aed958 in llvm::InstCombiner::runOnFunction (this=0x1782370,
F=...)
    at
/home/jfonseca/work/vmware/llvm/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2525
#9  0x0000000000ebdf0c in llvm::FPPassManager::runOnFunction
(this=this@entry=0x1789090, F=...)
    at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1538
#10 0x0000000000ebe35b in llvm::FPPassManager::runOnModule (this=0x1789090,
M=...) at
/home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1558
#11 0x0000000000ebe6a3 in runOnModule (M=..., this=<optimised out>) at
/home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1616
#12 llvm::legacy::PassManagerImpl::run (this=0x176c400, M=...) at
/home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1711
#13 0x0000000000ebe8ce in llvm::legacy::PassManager::run
(this=this@entry=0x7fffffffd950, M=...)
    at /home/jfonseca/work/vmware/llvm/llvm/lib/IR/LegacyPassManager.cpp:1746
#14 0x000000000052bb63 in main (argc=<optimised out>, argv=0x7fffffffdbc8) at
/home/jfonseca/work/vmware/llvm/llvm/tools/opt/opt.cpp:853
(gdb) 

This happens with all versions between LLVM 3.1 and LLVM 3.4

More the the actual crash, what I find surprising is that the complex constants
expression is not being folded automatically as it its being built.  This IR
was generated by the C bindings, inside llvmpipe Mesa driver.</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>