2017-04-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/80304
* tree-ssa-loop-im.c (ref_indep_loop_p_1): Also recurse
for safelen.
* gcc.dg/torture/pr80304.c: New testcase.
From-SVN: r246803
+2017-04-10 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/80304
+ * tree-ssa-loop-im.c (ref_indep_loop_p_1): Also recurse
+ for safelen.
+
2017-04-10 Nathan Sidwell <nathan@acm.org>
PR target/79905
+2017-04-10 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/80304
+ * gcc.dg/torture/pr80304.c: New testcase.
+
2017-04-10 Nathan Sidwell <nathan@acm.org>
PR target/79905
--- /dev/null
+/* { dg-do run } */
+
+int __attribute__((pure,noinline,noclone)) foo (int *p)
+{
+ return *p * 2;
+}
+
+int main()
+{
+ int k = 0;
+ int i;
+#pragma GCC ivdep
+ for (k = 0; k < 9;)
+ {
+ i = 0;
+ while (1)
+ {
+ k += foo (&i);
+ if (k > 7)
+ break;
+ i++;
+ }
+ }
+ if (k != 12)
+ __builtin_abort ();
+ return 0;
+}
fprintf (dump_file, "\n");
}
+ /* We need to recurse to properly handle UNANALYZABLE_MEM_ID. */
+ struct loop *inner = loop->inner;
+ while (inner)
+ {
+ if (!ref_indep_loop_p_1 (safelen, inner, ref, stored_p, ref_loop))
+ {
+ indep_p = false;
+ break;
+ }
+ inner = inner->next;
+ }
+
/* Avoid caching here as safelen depends on context and refs
are shared between different contexts. */
- return true;
+ return indep_p;
}
else
{