aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Belevantsev <abel@ispras.ru>2018-04-23 18:19:06 +0300
committerAndrey Belevantsev <abel@gcc.gnu.org>2018-04-23 18:19:06 +0300
commit99219dba378cab4ad63a338eb9a48f8685940dda (patch)
tree035b6d33491758fed68fc5f9b173f71a5a905eb4
parent0ef9f21d3c4de3a6af258338523d35ea6c4d492f (diff)
downloadgcc-99219dba378cab4ad63a338eb9a48f8685940dda.zip
gcc-99219dba378cab4ad63a338eb9a48f8685940dda.tar.gz
gcc-99219dba378cab4ad63a338eb9a48f8685940dda.tar.bz2
re PR rtl-optimization/85423 (ICE in code_motion_process_successors, at sel-sched.c:6403)
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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/sel-sched-ir.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr85423.c27
4 files changed, 40 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4dcf45e..135ac88 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index ee97052..85ff5bd 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 947b974..0b34bec 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..2650d86
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr85423.c
@@ -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;
+ }
+}