[4.6 Regression]: [alpha] -fcompare-debug failure due to sched1 pass http://gcc.gnu.org/PR56023 https://bugs.gentoo.org/451680 Author: uros Date: Mon Jan 21 18:02:57 2013 New Revision: 195345 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195345 Log: PR rtl-optimization/56023 * haifa-sched.c (fix_inter_tick): Do not update ticks of instructions, dependent on debug instruction. testsuite/ChangeLog: PR rtl-optimization/56023 * gcc.dg/pr56023.c: New test. --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -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; --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr56023.c @@ -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; + } +}