aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2019-03-01 19:18:04 +0300
committerAlexander Monakov <amonakov@gcc.gnu.org>2019-03-01 19:18:04 +0300
commit5055060066723e409519376c8e571e51cff1eb30 (patch)
tree26c4529ec9d41d81016662facfead448a1370c16
parent6fe7ce18d0173b16d80f28c29ef7540725e069ea (diff)
downloadgcc-5055060066723e409519376c8e571e51cff1eb30.zip
gcc-5055060066723e409519376c8e571e51cff1eb30.tar.gz
gcc-5055060066723e409519376c8e571e51cff1eb30.tar.bz2
haifa-sched: handle fallthru edge to EXIT block (PR 85899)
PR rtl-optimization/85899 * haifa-sched.c (find_fallthru_edge_from): Relax assert to account for fallthru edges leading to the exit block. * gcc.dg/pr85899.c: New test. From-SVN: r269319
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/haifa-sched.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr85899.c17
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eff658d..7c73196 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-03-01 Alexander Monakov <amonakov@ispras.ru>
+
+ PR rtl-optimization/85899
+ * haifa-sched.c (find_fallthru_edge_from): Relax assert to account for
+ fallthru edges leading to the exit block.
+
2019-03-01 Tamar Christina <tamar.christina@arm.com>
PR target/89517
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 72178b6..5025aae 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -8082,7 +8082,7 @@ find_fallthru_edge_from (basic_block pred)
if (e)
{
- gcc_assert (e->dest == succ);
+ gcc_assert (e->dest == succ || e->dest->index == EXIT_BLOCK);
return e;
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 398b45e..d7a54ab 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-03-01 Alexander Monakov <amonakov@ispras.ru>
+
+ PR rtl-optimization/85899
+ * gcc.dg/pr85899.c: New test.
+
2019-03-01 Marek Polacek <polacek@redhat.com>
PR c++/89537 - missing location for error with non-static member fn.
diff --git a/gcc/testsuite/gcc.dg/pr85899.c b/gcc/testsuite/gcc.dg/pr85899.c
new file mode 100644
index 0000000..eb2b175
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr85899.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fschedule-insns -fselective-scheduling -funroll-loops -fno-gcse -fno-if-conversion -fno-ivopts" } */
+
+#define N 4096
+int cb[N];
+int cc[N];
+int cd[N];
+
+void init ()
+{
+ int i;
+ for (i = 0; i < N; ++i) {
+ cb[i] = 3 * i - 2048;
+ cc[i] = -5 * i + 93;
+ cd[i] = i % 2 ? 1 : -1;
+ }
+}