From 8b76e7fef8246b7bb6f209b8ce0768d437b7b4a0 Mon Sep 17 00:00:00 2001 From: Aditya Kumar Date: Wed, 21 Oct 2015 21:18:17 +0000 Subject: add an upper limit on the number of array references * graphite-scop-detection.c (build_scops): Do not handle scops with more than PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP arrays. * params.def (PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP): New. Co-Authored-By: Sebastian Pop From-SVN: r229150 --- gcc/graphite-scop-detection.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gcc/graphite-scop-detection.c') diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 3ce4ff1..08c7b3ab 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1777,6 +1777,17 @@ build_scops (vec *scops) continue; } + unsigned max_arrays = PARAM_VALUE (PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP); + if (scop->drs.length () >= max_arrays) + { + DEBUG_PRINT (dp << "[scop-detection-fail] too many data references: " + << scop->drs.length () + << " is larger than --param graphite-max-arrays-per-scop=" + << max_arrays << ".\n"); + free_scop (scop); + continue; + } + build_sese_loop_nests (scop->scop_info); find_scop_parameters (scop); -- cgit v1.1