public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] haifa-sched: handle fallthru edge to EXIT block (PR 85899)
@ 2021-05-14 14:56 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-05-14 14:56 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0e08d1c314455f5e67a9317137637c64aaf2f560

commit 0e08d1c314455f5e67a9317137637c64aaf2f560
Author: Alexander Monakov <amonakov@ispras.ru>
Date:   Fri Mar 1 19:18:04 2019 +0300

    haifa-sched: handle fallthru edge to EXIT block (PR 85899)
    
    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.
    
            * gcc.dg/pr85899.c: New test.
    
    (cherry picked from commit 5055060066723e409519376c8e571e51cff1eb30)

Diff:
---
 gcc/haifa-sched.c              |  2 +-
 gcc/testsuite/gcc.dg/pr85899.c | 17 +++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 4a899b56173..ba70fc61518 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -8056,7 +8056,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/gcc.dg/pr85899.c b/gcc/testsuite/gcc.dg/pr85899.c
new file mode 100644
index 00000000000..eb2b175339c
--- /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;
+  }
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-14 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 14:56 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] haifa-sched: handle fallthru edge to EXIT block (PR 85899) Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).