<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 --- - isa<> used on a null pointer in CodeGenPrepare::dupRetToEnableTailCallOpts"
   href="https://llvm.org/bugs/show_bug.cgi?id=25764">25764</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>isa<> used on a null pointer in CodeGenPrepare::dupRetToEnableTailCallOpts
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>yaron.keren@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>benny.kra@gmail.com, 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=15407" name="attach_15407" title="creduced example">attachment 15407</a> <a href="attachment.cgi?id=15407&action=edit" title="creduced example">[details]</a></span>
creduced example

compiling

#include <list>
#include <vector>
using namespace std;
int main() {
  list<int> c1;
  vector<list<int>> cc;
  cc.insert(cc.begin(), {c1});
}


with

<span class="quote">>clang  -O -g -target x86_64-pc-windows -fexceptions lexicomp1.cpp</span >

results in Assertion failed: Val && "isa<> used on a null pointer" originating
from the dyn_cast

bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB) {
  if (!TLI)
    return false;

  ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator());

where BB->getTerminator() is nullptr.

This could be fixed with dyn_cast_or_null but I don't know if this is correct
or if a nullptr BB->getTerminator() indicates a real problem which should be
fixed elsewhere.

Also attached is reduced example, as far as creduce could go (77 lines, no
external includes) if it is any help.</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>