+2019-06-27 Kewen Lin <linkw@gcc.gnu.org>
+
+ PR target/62147
+ * gcc/loop-iv.c (find_simple_exit): Call finite_loop_p to update
+ finiteness.
+
2019-06-26 Jeff Law <law@redhat.com>
PR tree-optimization/90883
#include "intl.h"
#include "dumpfile.h"
#include "rtl-iter.h"
+#include "tree-ssa-loop-niter.h"
/* Possible return values of iv_get_reaching_def. */
fprintf (dump_file, "Loop %d is not simple.\n", loop->num);
}
+ /* Fix up the finiteness if possible. We can only do it for single exit,
+ since the loop is finite, but it's possible that we predicate one loop
+ exit to be finite which can not be determined as finite in middle-end as
+ well. It results in incorrect predicate information on the exit condition
+ expression. For example, if says [(int) _1 + -8, + , -8] != 0 finite,
+ it means _1 can exactly divide -8. */
+ if (single_exit (loop) && finite_loop_p (loop))
+ {
+ desc->infinite = NULL_RTX;
+ if (dump_file)
+ fprintf (dump_file, " infinite updated to finite.\n");
+ }
+
free (body);
}
+2019-06-27 Kewen Lin <linkw@gcc.gnu.org>
+
+ PR target/62147
+ * gcc.target/powerpc/pr62147.c: New test.
+
2019-06-26 Jeff Law <law@redhat.com>
- PR tree-optimization/90883
+ PR tree-optimization/90883
* g++.dg/tree-ssa/pr90883.C: New test.
* gcc.dg/tree-ssa/ssa-dse-36.c: New test.
--- /dev/null
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-options "-O2 -fno-tree-loop-distribute-patterns" } */
+
+/* Note that it's required to disable loop-distribute-patterns, otherwise the
+ loop will be optimized to memset. */
+
+/* Expect loop_iv can know the loop is finite so the doloop_optimize
+ can perform the doloop transformation. */
+
+typedef struct {
+ int l;
+ int b[258];
+} S;
+
+void clear (S* s )
+{
+ int i;
+ int len = s->l + 1;
+
+ for (i = 0; i <= len; i++)
+ s->b[i] = 0;
+}
+
+/* { dg-final { scan-assembler {\mbdnz\M} } } */