<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 --- - NULL deref crash with -value-tracking-dom-conditions"
   href="https://llvm.org/bugs/show_bug.cgi?id=24866">24866</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>NULL deref crash with -value-tracking-dom-conditions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>opt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>filtered+llvm-bugzilla@psychosanity.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=14897" name="attach_14897" title="bugpoint-reduced testcase">attachment 14897</a> <a href="attachment.cgi?id=14897&action=edit" title="bugpoint-reduced testcase">[details]</a></span>
bugpoint-reduced testcase

While looking at some code somebody posted as an example where clang produces
significantly worse code than gcc[1] , I came across this crash while trying to
see if various command-line options could remedy the situation.

The attached bugpoint-reduced testcase demonstrates the problem when run with:
opt bugpoint-reduced-simplified.bc -value-tracking-dom-conditions -licm
-load-combine

The problem seems to be that the expression "Q.DT->getNode(Current)" (on line
640 in llvm\lib\Analysis\ValueTracking.cpp) is returning NULL, and is then
immediately dereferenced to call "->getIDom()". Why that is or how it should be
handled, I have no idea.

[1] The performance bug is filed at <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - GCC4.9.2 optimizer produces 20% faster code than clang clang-600.0.56 (Xcode 6.1.1)"
   href="show_bug.cgi?id=21760">https://llvm.org/bugs/show_bug.cgi?id=21760</a></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>