http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59898
Bug ID: 59898 Summary: alignment problems in std::map with avx/avx2 Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ignat at gmx dot net Created attachment 31904 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31904&action=edit avx_bug.cc The following code segfaults when compiled with -mavx or -mavx2 on g++ (Debian 4.7.2-5) 4.7.2 on Linux x86_64 (Xeon(R) CPU E3-1240 v3). This also applies to unordered_map and can also happen when assigning to iterators when it->second is a 32-byte vector type. #include <map> typedef int vec256_t __attribute__ ((__vector_size__ (32))); std::map<int,vec256_t> m; int main() { vec256_t v; m[0]=v; return 0; } reproduce with: $ g++ avx_bug.cc -o avx_bug -mavx2 && ./avx_bug Segmentation fault thx ignatius