From b9b0386a3e64702fe19180707613fbb6187a27b8 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 25 Mar 2019 17:33:36 -0600 Subject: [PATCH] re PR rtl-optimization/88347 (ICE in begin_move_insn, at sched-ebb.c:175) PR rtl-optimization/88347 PR rtl-optimization/88423 * sched-deps.c (sched_analyze_insn): Take into account that for tablejumps the barrier appears after a label and a jump_table_data. * gcc.c-torture/compile/pr88347.c: New test. * gcc.c-torture/compile/pr88423.c: New test. From-SVN: r269928 --- gcc/ChangeLog | 7 +++++++ gcc/sched-deps.c | 5 +++++ gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.c-torture/compile/pr88347.c | 4 ++++ gcc/testsuite/gcc.c-torture/compile/pr88423.c | 5 +++++ 5 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr88347.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr88423.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 18682f3d130..457b598f1e5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-03-25 Alexander Monakov + + PR rtl-optimization/88347 + PR rtl-optimization/88423 + * sched-deps.c (sched_analyze_insn): Take into account that for + tablejumps the barrier appears after a label and a jump_table_data. + 2019-03-25 Martin Sebor PR c/89812 diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 6cf4cafbff3..eda0c669771 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -3005,6 +3005,11 @@ sched_analyze_insn (struct deps_desc *deps, rtx x, rtx_insn *insn) if (JUMP_P (insn)) { rtx_insn *next = next_nonnote_nondebug_insn (insn); + /* ??? For tablejumps, the barrier may appear not immediately after + the jump, but after a label and a jump_table_data insn. */ + if (next && LABEL_P (next) && NEXT_INSN (next) + && JUMP_TABLE_DATA_P (NEXT_INSN (next))) + next = NEXT_INSN (NEXT_INSN (next)); if (next && BARRIER_P (next)) reg_pending_barrier = MOVE_BARRIER; else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b4b1159e3bf..ddd5f50a8a9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2019-03-25 David Malcolm + + PR rtl-optimization/88347 + PR rtl-optimization/88423 + * gcc.c-torture/compile/pr88347.c: New test. + * gcc.c-torture/compile/pr88423.c: New test. + 2019-03-25 Martin Sebor PR c/89812 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr88347.c b/gcc/testsuite/gcc.c-torture/compile/pr88347.c new file mode 100644 index 00000000000..4e9b438d8ef --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr88347.c @@ -0,0 +1,4 @@ +/* { dg-do compile { target { powerpc-*-* powerpcle-*-* } } } */ +/* { dg-options "-mcpu=603e -fsched-stalled-insns -fsched2-use-superblocks -fschedule-insns2 -fno-dce -fno-guess-branch-probability --param max-cse-insns=4" } */ + +#include "../../gcc.target/powerpc/ppc-switch-2.c" diff --git a/gcc/testsuite/gcc.c-torture/compile/pr88423.c b/gcc/testsuite/gcc.c-torture/compile/pr88423.c new file mode 100644 index 00000000000..494881718cc --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr88423.c @@ -0,0 +1,5 @@ +/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */ +/* { dg-options "-march=skylake -fPIC -fsched2-use-superblocks -fno-if-conversion" } */ +/* { dg-require-effective-target fpic } */ + +#include "../../gcc.dg/20030309-1.c"