re PR target/83986 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348)
authorJakub Jelinek <jakub@redhat.com>
Tue, 30 Jan 2018 20:03:04 +0000 (21:03 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 30 Jan 2018 20:03:04 +0000 (21:03 +0100)
PR rtl-optimization/83986
* sched-deps.c (sched_analyze_insn): For frame related insns, add anti
dependence against last_pending_memory_flush in addition to
pending_jump_insns.

* gcc.dg/pr83986.c: New test.

From-SVN: r257203

gcc/ChangeLog
gcc/sched-deps.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr83986.c [new file with mode: 0644]

index c906836..e4c68ff 100644 (file)
@@ -1,3 +1,10 @@
+2018-01-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/83986
+       * sched-deps.c (sched_analyze_insn): For frame related insns, add anti
+       dependence against last_pending_memory_flush in addition to
+       pending_jump_insns.
+
 2018-01-30  Alexandre Oliva <aoliva@redhat.com>
 
        PR tree-optimization/81611
index 2d0199d..9a5cbeb 100644 (file)
@@ -2922,6 +2922,8 @@ sched_analyze_insn (struct deps_desc *deps, rtx x, rtx_insn *insn)
        = alloc_INSN_LIST (insn, deps->sched_before_next_jump);
 
       /* Make sure epilogue insn is scheduled after preceding jumps.  */
+      add_dependence_list (insn, deps->last_pending_memory_flush, 1,
+                          REG_DEP_ANTI, true);
       add_dependence_list (insn, deps->pending_jump_insns, 1, REG_DEP_ANTI,
                           true);
     }
index 0eac073..8a8b716 100644 (file)
@@ -1,3 +1,8 @@
+2018-01-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/83986
+       * gcc.dg/pr83986.c: New test.
+
 2018-01-30  Bill Seurer  <seurer@linux.vnet.ibm.com>
 
        PR 58684
diff --git a/gcc/testsuite/gcc.dg/pr83986.c b/gcc/testsuite/gcc.dg/pr83986.c
new file mode 100644 (file)
index 0000000..31a53d9
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR rtl-optimization/83986 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -fsched2-use-superblocks -funwind-tables --param max-pending-list-length=1" } */
+
+int v;
+
+int
+foo (int x)
+{
+  v &= !!v && !!x;
+  if (v != 0)
+    foo (0);
+  return 0;
+}