]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/85423 (ICE in code_motion_process_successors, at sel-sched...
authorAndrey Belevantsev <abel@ispras.ru>
Mon, 23 Apr 2018 15:19:06 +0000 (18:19 +0300)
committerAndrey Belevantsev <abel@gcc.gnu.org>
Mon, 23 Apr 2018 15:19:06 +0000 (18:19 +0300)
        PR rtl-optimization/85423

        * sel-sched-ir.c (has_dependence_note_mem_dep): Only discard
        dependencies to debug insns when the previous insn is non-debug.

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

From-SVN: r259563

gcc/ChangeLog
gcc/sel-sched-ir.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr85423.c [new file with mode: 0644]

index 4dcf45ec9f196772e24624b080b0cc9a920e1777..135ac8809338cee4d056e24576f2bcb630508019 100644 (file)
@@ -1,3 +1,10 @@
+2018-04-23  Andrey Belevantsev  <abel@ispras.ru>
+
+        PR rtl-optimization/85423
+
+        * sel-sched-ir.c (has_dependence_note_mem_dep): Only discard
+        dependencies to debug insns when the previous insn is non-debug.
+
 2018-04-23  Claudiu Zissulescu  <claziss@synopsys.com>
 
        * config/arc/arc.md ("vunspec"): Delete it, unify all the unspec
index ee970522890423a7a1bb81a4a03553d9f007252e..85ff5bd3eb46bee6037767d33f17071a6bba7537 100644 (file)
@@ -3308,7 +3308,7 @@ has_dependence_note_dep (insn_t pro, ds_t ds ATTRIBUTE_UNUSED)
      that a bookkeeping copy should be movable as the original insn.
      Detect that here and allow that movement if we allowed it before
      in the first place.  */
-  if (DEBUG_INSN_P (real_con)
+  if (DEBUG_INSN_P (real_con) && !DEBUG_INSN_P (real_pro)
       && INSN_UID (NEXT_INSN (pro)) == INSN_UID (real_con))
     return;
 
index 947b974cab1f8707796f21d2fc3ae1df2e0ae99c..0b34bec128fb72d31736d7a963997586de49498e 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-23  Andrey Belevantsev  <abel@ispras.ru>
+
+        PR rtl-optimization/85423
+        * gcc.dg/pr85423.c: New test.
+
 2018-04-20  Martin Sebor  <msebor@redhat.com>
 
        PR c/85365
diff --git a/gcc/testsuite/gcc.dg/pr85423.c b/gcc/testsuite/gcc.dg/pr85423.c
new file mode 100644 (file)
index 0000000..2650d86
--- /dev/null
@@ -0,0 +1,27 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -fselective-scheduling2 -fvar-tracking-assignments -fno-guess-branch-probability -fno-peephole2 -fno-ssa-phiopt -fno-tree-pre --param max-jump-thread-duplication-stmts=8 -w" } */
+/* { dg-additional-options "-march=nano" { target i?86-*-* x86_64-*-* } } */
+
+int vn, xm;
+
+void
+i1 (int);
+
+void
+mb (int *ap, int ev)
+{
+  while (vn < 1)
+    {
+      i1 (vn);
+
+      ev += *ap && ++vn;
+
+      while (xm < 1)
+        ++xm;
+
+      if (*ap == 0)
+        *ap = ev;
+
+      ++vn;
+    }
+}