This PR shows that we weren't filtering out irrelevant stmts in
vect_get_peeling_costs_all_drs (unlike related loops in which
we iterate over all datarefs).
2017-09-22 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
PR tree-optimization/82289
* tree-vect-data-refs.c (vect_get_peeling_costs_all_drs): Check
STMT_VINFO_RELEVANT_P.
gcc/testsuite/
PR tree-optimization/82289
* gcc.dg/vect/pr82289.c: New test.
From-SVN: r253103
+2017-09-22 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR tree-optimization/82289
+ * tree-vect-data-refs.c (vect_get_peeling_costs_all_drs): Check
+ STMT_VINFO_RELEVANT_P.
+
2017-09-22 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
+2017-09-22 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR tree-optimization/82289
+ * gcc.dg/vect/pr82289.c: New test.
+
2017-09-22 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
--- /dev/null
+/* { dg-do compile } */
+
+int a, b, c, *d, *f[1];
+
+void fn1 (int *j)
+{
+ int e, g, h = 1;
+ for (; e; e++)
+ {
+ if (g > 0)
+ {
+ d = j;
+ return;
+ }
+ if (!h)
+ while (g)
+ ;
+ while (h < 1)
+ if (a)
+ {
+ fn1 (&h);
+ h = 0;
+ }
+ f[e] = &c;
+ }
+ while (1)
+ ;
+}
{
gimple *stmt = DR_STMT (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ if (!STMT_VINFO_RELEVANT_P (stmt_info))
+ continue;
+
/* For interleaving, only the alignment of the first access
matters. */
if (STMT_VINFO_GROUPED_ACCESS (stmt_info)