summaryrefslogtreecommitdiff
path: root/gcc/graphite-scop-detection.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-26 18:48:08 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-26 18:48:08 +0000
commitafad206176893edea1e9ef14bc63df95645d488e (patch)
tree717f3710390fd5f55896b7b7ad3148282cc98438 /gcc/graphite-scop-detection.c
parent0d0cdcaa23b24dd0b667bee1051c9f0215e4fb8e (diff)
downloadgcc-afad206176893edea1e9ef14bc63df95645d488e.tar.gz
Fix PR47653: do not handle loops using wrapping semantics in graphite
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. * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176802 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r--gcc/graphite-scop-detection.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 45c6c75ccea..346056899d3 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -378,17 +378,17 @@ harmful_stmt_in_bb (basic_block scop_entry, loop_p outer_loop, basic_block bb)
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. */