Index: haifa-sched.c =================================================================== --- haifa-sched.c (revision 195276) +++ haifa-sched.c (working copy) @@ -3684,6 +3684,9 @@ fix_inter_tick (rtx head, rtx tail) INSN_TICK (head) = tick; } + if (DEBUG_INSN_P (head)) + continue; + FOR_EACH_DEP (head, SD_LIST_RES_FORW, sd_it, dep) { rtx next; Index: testsuite/gcc.dg/pr56023.c =================================================================== --- testsuite/gcc.dg/pr56023.c (revision 0) +++ testsuite/gcc.dg/pr56023.c (working copy) @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcompare-debug" } */ + +void +foo (char *c) +{ + unsigned int x = 0; + unsigned int i; + + for (i = 0; c[i]; i++) + { + if (i >= 5 && x != 1) + break; + else if (c[i] == ' ') + x = i; + else if (c[i] == '/' && c[i + 1] != ' ' && i) + x = i + 1; + } +}