aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr69186.c12
-rw-r--r--gcc/tree-vect-data-refs.c11
4 files changed, 33 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f8f818b..cb2ec45 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-13 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69186
+ * tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
+ Properly guard vect_update_misalignment_for_peel call.
+
2016-01-12 Jeff Law <law@redhat.com>
PR tree-optimization/pr67755
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 240fae7..0ce47d4 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-13 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69186
+ * gcc.dg/torture/pr69186.c: New testcase.
+
2016-01-13 Jeff Law <law@redhat.com>
PR tree-optimization/67755
diff --git a/gcc/testsuite/gcc.dg/torture/pr69186.c b/gcc/testsuite/gcc.dg/torture/pr69186.c
new file mode 100644
index 0000000..d897ff6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr69186.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+
+static int a[10][2];
+int b;
+
+void
+fn1 ()
+{
+ b = 0;
+ for (; b < 6; b++)
+ a[b][2] ^= 1;
+}
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index d0e20da..3605fa4 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1826,7 +1826,16 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
misalignment of DR_i must be set to unknown. */
FOR_EACH_VEC_ELT (datarefs, i, dr)
if (dr != dr0)
- vect_update_misalignment_for_peel (dr, dr0, npeel);
+ {
+ /* Strided accesses perform only component accesses, alignment
+ is irrelevant for them. */
+ stmt_info = vinfo_for_stmt (DR_STMT (dr));
+ if (STMT_VINFO_STRIDED_P (stmt_info)
+ && !STMT_VINFO_GROUPED_ACCESS (stmt_info))
+ continue;
+
+ vect_update_misalignment_for_peel (dr, dr0, npeel);
+ }
LOOP_VINFO_UNALIGNED_DR (loop_vinfo) = dr0;
if (npeel)