http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49002
Summary: 128-bit AVX load incorrectly becomes 256-bit AVX load Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: ath...@fftw.org Created attachment 24249 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24249 test case for this bug The attached foo.c program contains two 128-bit AVX loads from locations of type __m128d. However, gcc-4.6 converts the first load into a 256-load. While this is semantically correct, because the upper 128-bits are ignored, the vmovapd instruction has different alignment requirements in 128 and 256-bit mode, and therefore this conversion causes spurious segfaults when the data is not 32-byte aligned. Compile the attached program as follows: x86_64-linux-gnu-gcc-4.6 -mavx -O -S foo.c The generated assembly contains the incorrect load: vmovapd (%rdi), %ymm0 By contrast, gcc-4.5 generates the correct 128-bit load instruction "vmovapd (%rdi), %xmm0".