The attached code is OK with gcc 3.3.6 debian and gcc 4.0 without -O2 but does not generate pmaddw instruction with gcc 4.0 and -O2. The compile line is /usr/local/bin/gcc -save-temps -msse2 -Wall -O2 -o bug-report bug-report.c and the values are NOT initialized in the gcc 4.0 -O2 setup.
-- Summary: Miscompile of SSE2 _mm_madd_epi16 with -O2 Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hurbain at cri dot ensmp dot fr CC: gcc-bugs at gcc dot gnu dot org GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22198