Why does the following code run fine when compiled with gcc yet segfault when compiled with clang (3.4). If the apparently redundant Thread object is removed the code runs fine. Also if any of the arrays are made smaller the code runs fine.
#include <array>
#include <emmintrin.h>
class Thread {
public:
std::array<__m128i, 16 * 3 * 3 * 1280> m_BlockTypes;
unsigned int m_SeedIdx1[16 * 16 * 3 * 3 * 512];
};
class BroadcastImpl
{
public:
std::array<__m128i, 16 * 3 * 3 * 256> Evaluate()
{
return std::array<__m128i, 16 * 3 * 3 * 256>();
}
};
int main(int argc, char** argv) {
Thread thread;
(void)(thread);
BroadcastImpl().Evaluate();
BroadcastImpl().Evaluate();
}