re PR rtl-optimization/88347 (ICE in begin_move_insn, at sched-ebb.c:175)
authorJeff Law <law@gcc.gnu.org>
Mon, 25 Mar 2019 23:33:36 +0000 (17:33 -0600)
committerJeff Law <law@gcc.gnu.org>
Mon, 25 Mar 2019 23:33:36 +0000 (17:33 -0600)
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
gcc/sched-deps.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr88347.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr88423.c [new file with mode: 0644]

index 18682f3d13032a75e97a9c63314dba546c45d00d..457b598f1e504c9f3d33379bf8166ce9909fcb39 100644 (file)
@@ -1,3 +1,10 @@
+2019-03-25  Alexander Monakov  <amonakov@ispras.ru>
+
+       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  <msebor@redhat.com>
 
        PR c/89812
index 6cf4cafbff303ef6e2278344aa48102588f2717c..eda0c669771c35355e91efeaadab3cf0ac3fcfeb 100644 (file)
@@ -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
index b4b1159e3bf65a230043a10c16b69b5de68ff145..ddd5f50a8a9934a43805af772c92ff26fec49e19 100644 (file)
@@ -1,3 +1,10 @@
+2019-03-25  David Malcolm  <dmalcolm@redhat.com>
+
+       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  <msebor@redhat.com>
 
        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 (file)
index 0000000..4e9b438
--- /dev/null
@@ -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 (file)
index 0000000..4948817
--- /dev/null
@@ -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"