aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2018-04-09 12:16:34 +0300
committerAndrey Belevantsev <abel@gcc.gnu.org>2018-04-09 12:16:34 +0300
commitab6dceab101d62684d93655217f0ff5840c6ef5b (patch)
tree57055f51ccbac697622aa77e4269b30726d76a57 /gcc
parent33bacbcba534374b3e2c7693ae9147b96540f43f (diff)
downloadgcc-ab6dceab101d62684d93655217f0ff5840c6ef5b.zip
gcc-ab6dceab101d62684d93655217f0ff5840c6ef5b.tar.gz
gcc-ab6dceab101d62684d93655217f0ff5840c6ef5b.tar.bz2
re PR rtl-optimization/83962 (ICE: verify_flow_info failed (too many outgoing branch edges from bb 8))
PR rtl-optimization/83962 * sel-sched-ir.c (tidy_control_flow): Correct the order in which we call tidy_fallthru_edge and tidy_control_flow. * gcc.dg/pr83962.c: New test. From-SVN: r259229
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/sel-sched-ir.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr83962.c10
4 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a09b7ba..99d9cca 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2018-04-09 Andrey Belevantsev <abel@ispras.ru>
+ PR rtl-optimization/83962
+
+ * sel-sched-ir.c (tidy_control_flow): Correct the order in which we call
+ tidy_fallthru_edge and tidy_control_flow.
+
+2018-04-09 Andrey Belevantsev <abel@ispras.ru>
+
PR rtl-optimization/83530
* sel-sched.c (force_next_insn): New global variable.
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index a965d2e..987bd9f 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -3839,9 +3839,13 @@ tidy_control_flow (basic_block xbb, bool full_tidying)
&& INSN_SCHED_TIMES (BB_END (xbb)) == 0
&& !IN_CURRENT_FENCE_P (BB_END (xbb)))
{
- if (sel_remove_insn (BB_END (xbb), false, false))
- return true;
+ /* We used to call sel_remove_insn here that can trigger tidy_control_flow
+ before we fix up the fallthru edge. Correct that ordering by
+ explicitly doing the latter before the former. */
+ clear_expr (INSN_EXPR (BB_END (xbb)));
tidy_fallthru_edge (EDGE_SUCC (xbb, 0));
+ if (tidy_control_flow (xbb, false))
+ return true;
}
first = sel_bb_head (xbb);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c1653f7..91a1a2f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2018-04-09 Andrey Belevantsev <abel@ispras.ru>
+ PR rtl-optimization/83962
+ * gcc.dg/pr83962.c: New test.
+
+2018-04-09 Andrey Belevantsev <abel@ispras.ru>
+
PR rtl-optimization/83530
* gcc.dg/pr83530.c: New test.
diff --git a/gcc/testsuite/gcc.dg/pr83962.c b/gcc/testsuite/gcc.dg/pr83962.c
new file mode 100644
index 0000000..0547e21
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr83962.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-std=gnu99 -O1 -fselective-scheduling2 -fschedule-insns2 -fcse-follow-jumps -fno-ssa-phiopt -fno-guess-branch-probability" } */
+unsigned int ca;
+
+void
+v6 (long long unsigned int as, int p9)
+{
+ while (p9 < 1)
+ as = (as != ca) || (as > 1);
+}