@@ -1802,7 +1802,7 @@ vectorizable_mask_load_store (gimple stm
}
else if (tree_int_cst_compare (nested_in_vect_loop
? STMT_VINFO_DR_STEP (stmt_info)
- : DR_STEP (dr), size_zero_node) < 0)
+ : DR_STEP (dr), size_zero_node) <= 0)
return false;
else if (optab_handler (is_store ? maskstore_optab : maskload_optab,
TYPE_MODE (vectype)) == CODE_FOR_nothing)
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -mavx2" { target avx2 } } */
+
+int a[1024];
+
+int
+foo (int *p)
+{
+ int i;
+ for (i = 0; i < 1024; i++)
+ {
+ int t;
+ if (a[i] < 30)
+ t = *p;
+ else
+ t = a[i] + 12;
+ a[i] = t;
+ }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */