aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-scop-detection.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-02-01 08:02:50 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-02-01 08:02:50 +0000
commit405a740640530a3c93ef68089cb185083e4df890 (patch)
treee5cc46cf37a94684492138f56035edd905c55361 /gcc/graphite-scop-detection.c
parent315405b66954a298c39503347f1997ca2e0647f4 (diff)
downloadgcc-405a740640530a3c93ef68089cb185083e4df890.zip
gcc-405a740640530a3c93ef68089cb185083e4df890.tar.gz
gcc-405a740640530a3c93ef68089cb185083e4df890.tar.bz2
re PR tree-optimization/71824 (ICE when compiling libiberty with Graphite loop optimizations)
2017-02-01 Richard Biener <rguenther@suse.de> PR tree-optimization/71824 * graphite-scop-detection.c (scop_detection::build_scop_breadth): Verify the loops are valid in the merged SESE region. (scop_detection::can_represent_loop_1): Check analyzing the evolution of the number of iterations in the region succeeds. * gcc.dg/graphite/pr71824.c: New testcase. From-SVN: r245081
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r--gcc/graphite-scop-detection.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 3860693..2f96412 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -905,7 +905,9 @@ scop_detection::build_scop_breadth (sese_l s1, loop_p loop)
sese_l combined = merge_sese (s1, s2);
- if (combined)
+ if (combined
+ && loop_is_valid_in_scop (loop, combined)
+ && loop_is_valid_in_scop (loop->next, combined))
s1 = combined;
else
add_scop (s2);
@@ -931,6 +933,8 @@ scop_detection::can_represent_loop_1 (loop_p loop, sese_l scop)
&& niter_desc.control.no_overflow
&& (niter = number_of_latch_executions (loop))
&& !chrec_contains_undetermined (niter)
+ && !chrec_contains_undetermined (scalar_evolution_in_region (scop,
+ loop, niter))
&& graphite_can_represent_expr (scop, loop, niter);
}