SSE and C++ containers
问题 Is there an obvious reason why the following code segfaults ? #include <vector> #include <emmintrin.h> struct point { __m128i v; point() { v = _mm_setr_epi32(0, 0, 0, 0); } }; int main(int argc, char *argv[]) { std::vector<point> a(3); } Thanks Edit: I'm using g++ 4.5.0 on linux/i686, I might not know what I'm doing here, but since even the following segfaults int main(int argc, char *argv[]) { point *p = new point(); } I really think it must be and alignment issue. 回答1: The obvious thing