https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70882
Bug ID: 70882 Summary: vectorized sincos trashes the stack Product: gcc Version: 5.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: blaffablaffa at gmail dot com Target Milestone: --- Created attachment 38381 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38381&action=edit testcase The double4 version of the vectorized sincos() in libmvec (glibc 2.22) causes the stack to be corrupted, leading to assorted bugs such as crash, backtrace corruption in gdb, etc. I am reporting a bug here because since it's the only vectorized math function that uses pointers, so it might be an ABI problem. On my CPU (ivybridge) I can only test the double4 version, not the wider ones. Attached testcase, compile with g++ -std=c++11 -O1 -fopenmp -ffast-math -march=ivybridge -mtune=ivybridge -o double_sincos double_sincos.cpp (interestingly, the vectorized call is not emitted with a c++ version lower than 2011).