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: unassignedb...@nondot.org
          Reporter: douglas_y...@playstation.sony.com
                CC: llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to