]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/83986 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348)
authorJakub Jelinek <jakub@redhat.com>
Mon, 25 Jun 2018 17:19:13 +0000 (19:19 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 25 Jun 2018 17:19:13 +0000 (19:19 +0200)
Backported from mainline
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.

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

From-SVN: r262059

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

index 25ecc5b76c3e0d9db9303c658d63f3722bb3ffad..1695c7298d04837f7fdd11bca4ace0bf58029be9 100644 (file)
@@ -1,6 +1,13 @@
 2018-06-25  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       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-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/84040
index 99f4a6fcdddf70f20f87993dee06c8be6bce31bf..1f8524cd11c1f27f2aeb75837b5600d1611a974a 100644 (file)
@@ -2921,6 +2921,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 684e713900f52fda614caa137412f6c0752121c9..4afc07b8991f2a59926f2e7519e8c808c5014832 100644 (file)
@@ -1,6 +1,11 @@
 2018-06-25  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2018-01-30  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/83986
+       * gcc.dg/pr83986.c: New test.
+
        2018-01-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR sanitizer/83987
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;
+}