aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-10-12 14:09:21 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-10-12 14:09:21 +0000
commitf0c216e1162d40748b3bc085146f386ca2109f46 (patch)
treeab1faef55dd03278d6edc48d180770c687fdfb0b /gcc
parentb989ffb2937ba4b87423bf43ebe0666dd4b08cea (diff)
downloadgcc-f0c216e1162d40748b3bc085146f386ca2109f46.zip
gcc-f0c216e1162d40748b3bc085146f386ca2109f46.tar.gz
gcc-f0c216e1162d40748b3bc085146f386ca2109f46.tar.bz2
re PR tree-optimization/69728 (internal compiler error: in outer_projection_mupa, at graphite-sese-to-poly.c:1175)
2017-10-12 Richard Biener <rguenther@suse.de> PR tree-optimization/69728 Revert 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. * graphite-sese-to-poly.c (add_loop_schedule): Handle empty domain by returning an unchanged schedule. * gcc.dg/graphite/pr69728.c: Adjust to reflect we can handle the loop now. Remove unrelated undefined behavior. From-SVN: r253677
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog15
-rw-r--r--gcc/graphite-sese-to-poly.c16
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr69728.c10
4 files changed, 30 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a7468ef..cba344b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,18 @@
+2017-10-12 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69728
+ Revert
+ 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.
+
+ * graphite-sese-to-poly.c (add_loop_schedule): Handle empty
+ domain by returning an unchanged schedule.
+
2017-10-12 Jakub Jelinek <jakub@redhat.com>
* genrecog.c (validate_pattern): For VEC_SELECT verify that
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 0e6824b..50b6fe8d 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1066,8 +1066,6 @@ 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 *
@@ -1082,11 +1080,9 @@ add_loop_schedule (__isl_take isl_schedule *schedule, loop_p loop,
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. */
+ /* We cannot apply an empty domain to pbbs in this loop so return early. */
if (isl_union_set_is_empty (domain))
{
- schedule_error = true;
isl_union_set_free (domain);
return schedule;
}
@@ -1216,8 +1212,6 @@ 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)
@@ -1232,14 +1226,6 @@ 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");
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index eaf1ce5..29095e7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-12 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69728
+ * gcc.dg/graphite/pr69728.c: Adjust to reflect we can handle
+ the loop now. Remove unrelated undefined behavior.
+
2017-10-12 Jakub Jelinek <jakub@redhat.com>
PR c++/82159
diff --git a/gcc/testsuite/gcc.dg/graphite/pr69728.c b/gcc/testsuite/gcc.dg/graphite/pr69728.c
index 35ea5bd1..e8cd7be 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr69728.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr69728.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -floop-nest-optimize" } */
+/* { dg-options "-O3 -floop-nest-optimize -fdump-tree-graphite-details" } */
-int a[1];
+int a[9];
int b, c, d, e;
void
fn1 ()
@@ -19,3 +19,9 @@ fn1 ()
}
}
}
+
+/* At the moment only ISL figures that if (d) is always true. We've
+ run into scheduling issues before here, not being able to handle
+ empty domains. */
+
+/* { dg-final { scan-tree-dump "loop nest optimized" "graphite" } } */