[llvm-bugs] [Bug 33193] New: Crash due to unhandled cast causing an UNREACHABLE to be executed at llvm/include/llvm/CodeGen/BasicTTIImpl.h:590

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 26 20:17:11 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33193

            Bug ID: 33193
           Summary: Crash due to unhandled cast causing an UNREACHABLE to
                    be executed at
                    llvm/include/llvm/CodeGen/BasicTTIImpl.h:590
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: douglas_yung at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org

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!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170527/5779d7ff/attachment.html>


More information about the llvm-bugs mailing list