https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68786
--- Comment #1 from Ilya Enkovich <ienkovich at gcc dot gnu.org> --- Looks like an old bug. We may see the same problem on avx2 using older compiler. Here is a test for GCC5: double *a; long long c; int *d; void test (void) { int b; for (b = 0; b < 1024; b++) { d[b] = 1; if (c > a[b]) a[b] = 1.0; } } >gcc -O2 -ftree-vectorize -march=haswell small.i -S -fdump-rtl-final In small.i.final dump: (insn:TI 91 85 89 5 (set (mem:V4DF (plus:DI (reg:DI 0 ax [orig:151 ivtmp.36 ] [151]) (const_int 32 [0x20])) [3 MEM[(double *)_18]+0 S32 A256]) (unspec:V4DF [ (reg:V4DI 22 xmm1 [169]) (reg:V4DF 24 xmm3 [179]) (mem:V4DF (plus:DI (reg:DI 0 ax [orig:151 ivtmp.36 ] [151]) (const_int 32 [0x20])) [3 MEM[(double *)_18]+0 S32 A256]) ] UNSPEC_MASKMOV)) small.i:13 4457 {avx_maskstorepd256} (expr_list:REG_DEAD (reg:V4DI 22 xmm1 [169]) (nil))) (insn:TI 89 91 93 5 (set (mem:V4DF (reg:DI 0 ax [orig:151 ivtmp.36 ] [151]) [3 MEM[(double *)vectp_pretmp.18_75]+0 S32 A64]) (unspec:V4DF [ (reg:V4DI 23 xmm2 [173]) (reg:V4DF 24 xmm3 [179]) (mem:V4DF (reg:DI 0 ax [orig:151 ivtmp.36 ] [151]) [3 MEM[(double *)vectp_pretmp.18_75]+0 S32 A64]) ] UNSPEC_MASKMOV)) small.i:13 4457 {avx_maskstorepd256} (expr_list:REG_DEAD (reg:V4DI 23 xmm2 [173]) (nil))) Again we have different alignment. For avx2 it doesn't matter because we don't have aligned and unaligned variants of maskmov. In case of regular stores alignment is correct. The oldest compiler I tried was 20140625.