+2011-07-26 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/47653
+ * graphite-scop-detection.c (graphite_can_represent_loop): Discard
+ loops using wrapping semantics.
+
2011-07-26 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/48805
static bool
graphite_can_represent_loop (basic_block scop_entry, loop_p loop)
{
- tree niter = number_of_latch_executions (loop);
+ tree niter;
+ struct tree_niter_desc niter_desc;
- /* Number of iterations unknown. */
- if (chrec_contains_undetermined (niter))
- return false;
-
- /* Number of iterations not affine. */
- if (!graphite_can_represent_expr (scop_entry, loop, niter))
- return false;
+ /* FIXME: For the moment, graphite cannot be used on loops that
+ iterate using induction variables that wrap. */
- return true;
+ return number_of_iterations_exit (loop, single_exit (loop), &niter_desc, false)
+ && niter_desc.control.no_overflow
+ && (niter = number_of_latch_executions (loop))
+ && !chrec_contains_undetermined (niter)
+ && graphite_can_represent_expr (scop_entry, loop, niter);
}
/* Store information needed by scopdet_* functions. */
+2011-07-26 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/47653
+ * gcc.dg/graphite/run-id-pr47653.c: New.
+ * gcc.dg/graphite/interchange-3.c: Do not use unsigned types for
+ induction variables.
+ * gcc.dg/graphite/scop-16.c: Same.
+ * gcc.dg/graphite/scop-17.c: Same.
+ * gcc.dg/graphite/scop-21.c: Same.
+
2011-07-26 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/48805
--- /dev/null
+/* { dg-options "-O -fstack-check=generic -ftree-pre -fgraphite-identity" } */
+
+int main ()
+{
+ int i, j;
+ int x[8][8];
+ for (i = 0; i < 8; i++)
+ for (j = i; j < 8; j++)
+ x[i][j] = 4;
+
+ for (i = 0; i < 8; i++)
+ for (j = i; j < 8; j++)
+ if (x[i][j] != 4)
+ __builtin_abort ();
+
+ return 0;
+}
}
/* Check that parallel code generation part make the right answer. */
-/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 2 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 2 "graphite" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
/* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
/* { dg-final { cleanup-tree-dump "parloops" } } */