<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 - Crash due to unhandled cast causing an UNREACHABLE to be executed at llvm/include/llvm/CodeGen/BasicTTIImpl.h:590"
   href="https://bugs.llvm.org/show_bug.cgi?id=33193">33193</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash due to unhandled cast causing an UNREACHABLE to be executed at llvm/include/llvm/CodeGen/BasicTTIImpl.h:590
          </td>
        </tr>

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

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

        <tr>
          <th>Reporter</th>
          <td>douglas_yung@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Commit r303763 started causing a crash to occur on one of our internal
codebases. 

Consider the following code:

/***** repro.cpp ******/
struct d;
template < typename > class A;
class B
{
public:
    typedef d *pointer;
    pointer _Myfirst;
    pointer _Mylast;
};
template < class = A < int >>class D:B
{
public:
    long m_fn1 ()
    {
        return _Mylast - _Myfirst;
    }
    d & operator[] (long p1)
    {
        return *(_Myfirst + p1);
    }
};

struct d
{
    int m_hNodeID;
    bool uw;
};
class C
{
    void m_fn2 ();
    D < >m_d;
};
void
C::m_fn2 ()
{
    for (unsigned i = 0; i < m_d.m_fn1 (); ++i)
        m_d[i].uw = false;
}
/***** repro.cpp ******/

If you compile the above with the following command:

clang.exe -cc1 -triple x86_64-scei-ps4 -emit-obj -O2 -vectorize-loops repro.cpp

You will see the following crash in the compiler:

Unhandled cast
UNREACHABLE executed at C:\src\llvm\include\llvm/CodeGen/BasicTTIImpl.h:590!</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>