aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphite-sese-to-poly.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-09-19 08:25:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-09-19 08:25:17 +0000
commit197d2f5b2c2bece593f29ffe1e98c23f62ffbbbb (patch)
tree46573d7befe8b4b83a43af3b5ac0742ae0bfee13 /gcc/graphite-sese-to-poly.c
parent6da7ce80f3845e511bf0c3c5a8c11af5f3def516 (diff)
downloadgcc-197d2f5b2c2bece593f29ffe1e98c23f62ffbbbb.zip
gcc-197d2f5b2c2bece593f29ffe1e98c23f62ffbbbb.tar.gz
gcc-197d2f5b2c2bece593f29ffe1e98c23f62ffbbbb.tar.bz2
re PR tree-optimization/69728 (internal compiler error: in outer_projection_mupa, at graphite-sese-to-poly.c:1175)
2017-09-19 Richard Biener <rguenther@suse.de> PR tree-optimization/69728 * graphite-sese-to-poly.c (schedule_error): New global. (add_loop_schedule): Handle empty domain by failing the schedule. (build_original_schedule): Handle schedule_error. * gfortran.dg/graphite/pr69728.f90: New testcase. * gcc.dg/graphite/pr69728.c: Likewise. From-SVN: r252968
Diffstat (limited to 'gcc/graphite-sese-to-poly.c')
-rw-r--r--gcc/graphite-sese-to-poly.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 8ff9a22..6e64f13 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1030,6 +1030,8 @@ outer_projection_mupa (__isl_take isl_union_set *set, int n)
return isl_multi_union_pw_aff_from_union_pw_multi_aff (data.res);
}
+static bool schedule_error;
+
/* Embed SCHEDULE in the constraints of the LOOP domain. */
static isl_schedule *
@@ -1043,6 +1045,16 @@ add_loop_schedule (__isl_take isl_schedule *schedule, loop_p loop,
if (empty < 0 || empty)
return empty < 0 ? isl_schedule_free (schedule) : schedule;
+ isl_union_set *domain = isl_schedule_get_domain (schedule);
+ /* We cannot apply an empty domain to pbbs in this loop so fail.
+ ??? Somehow drop pbbs in the loop instead. */
+ if (isl_union_set_is_empty (domain))
+ {
+ schedule_error = true;
+ isl_union_set_free (domain);
+ return schedule;
+ }
+
isl_space *space = isl_set_get_space (iterators);
int loop_index = isl_space_dim (space, isl_dim_set) - 1;
@@ -1063,7 +1075,6 @@ add_loop_schedule (__isl_take isl_schedule *schedule, loop_p loop,
prefix = isl_multi_aff_set_tuple_id (prefix, isl_dim_out, label);
int n = isl_multi_aff_dim (prefix, isl_dim_in);
- isl_union_set *domain = isl_schedule_get_domain (schedule);
isl_multi_union_pw_aff *mupa = outer_projection_mupa (domain, n);
mupa = isl_multi_union_pw_aff_apply_multi_aff (mupa, prefix);
return isl_schedule_insert_partial_schedule (schedule, mupa);
@@ -1169,6 +1180,8 @@ build_schedule_loop_nest (scop_p scop, int *index, loop_p context_loop)
static bool
build_original_schedule (scop_p scop)
{
+ schedule_error = false;
+
int i = 0;
int n = scop->pbbs.length ();
while (i < n)
@@ -1183,6 +1196,14 @@ build_original_schedule (scop_p scop)
scop->original_schedule = add_in_sequence (scop->original_schedule, s);
}
+ if (schedule_error)
+ {
+ if (dump_file)
+ fprintf (dump_file, "[sese-to-poly] failed to build "
+ "original schedule\n");
+ return false;
+ }
+
if (dump_file)
{
fprintf (dump_file, "[sese-to-poly] original schedule:\n");