re PR tree-optimization/68951 (ICE in vect_update_misalignment_for_peel)
authorRichard Biener <rguenther@suse.de>
Thu, 17 Dec 2015 12:34:27 +0000 (12:34 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 17 Dec 2015 12:34:27 +0000 (12:34 +0000)
2015-12-17  Richard Biener  <rguenther@suse.de>

PR tree-optimization/68951
* tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost):
Ignore strided non-group accesses.

* gcc.dg/torture/pr68951.c: New testcase.

From-SVN: r231754

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr68951.c [new file with mode: 0644]
gcc/tree-vect-data-refs.c

index 375ab755e80357062167cc973295133a588c4b70..46cf0b0862c09cdf25a862d24cc6f2aef672762b 100644 (file)
@@ -1,3 +1,9 @@
+2015-12-17  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68951
+       * tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost):
+       Ignore strided non-group accesses.
+
 2015-12-17  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * config/arc/arc.c (arc_loop_hazard): Don't convert the jump label
index 674c868cf1100ab52b48cef6bd2196f0b779ef07..fafa8cc4dec07ca25e65d558bfa505b2a332db96 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-17  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68951
+       * gcc.dg/torture/pr68951.c: New testcase.
+
 2015-12-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR target/67973
diff --git a/gcc/testsuite/gcc.dg/torture/pr68951.c b/gcc/testsuite/gcc.dg/torture/pr68951.c
new file mode 100644 (file)
index 0000000..95c3c32
--- /dev/null
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-w" } */
+
+static int g_534[1][1];
+int fn1()
+{
+  int i;
+  for (i = 0; i < 4; i++)
+    g_534[i + 2][i] ^= 3;
+  for (;;)
+    ;
+}
index 4c566c84766a6d4a3b201d10b52b2cbf2b958e45..b039ff2bc2610b6610c442fd5ac423e5818cbd57 100644 (file)
@@ -1215,6 +1215,12 @@ vect_peeling_hash_get_lowest_cost (_vect_peel_info **slot,
           && GROUP_FIRST_ELEMENT (stmt_info) != stmt)
         continue;
 
+      /* Strided accesses perform only component accesses, alignment is
+         irrelevant for them.  */
+      if (STMT_VINFO_STRIDED_P (stmt_info)
+         && !STMT_VINFO_GROUPED_ACCESS (stmt_info))
+       continue;
+
       save_misalignment = DR_MISALIGNMENT (dr);
       vect_update_misalignment_for_peel (dr, elem->dr, elem->npeel);
       vect_get_data_access_cost (dr, &inside_cost, &outside_cost,