diff options
author | Aditya Kumar <aditya.k7@samsung.com> | 2015-10-21 21:18:17 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2015-10-21 21:18:17 +0000 |
commit | 8b76e7fef8246b7bb6f209b8ce0768d437b7b4a0 (patch) | |
tree | d69a131c4e1ebc4d17844685161bbfde2a5cd128 /gcc/graphite-scop-detection.c | |
parent | 7ec491c07be298679b27d5939accc30de01d62d0 (diff) | |
download | gcc-8b76e7fef8246b7bb6f209b8ce0768d437b7b4a0.zip gcc-8b76e7fef8246b7bb6f209b8ce0768d437b7b4a0.tar.gz gcc-8b76e7fef8246b7bb6f209b8ce0768d437b7b4a0.tar.bz2 |
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 <s.pop@samsung.com>
From-SVN: r229150
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r-- | gcc/graphite-scop-detection.c | 11 |
1 files changed, 11 insertions, 0 deletions
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<scop_p> *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); |