aboutsummaryrefslogtreecommitdiff
blob: c3fa75f857c73dc6631be0e5707839f3bc999ad0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[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;
+    }
+}