summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99448.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99448.patch')
-rw-r--r--recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99448.patch147
1 files changed, 147 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99448.patch b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99448.patch
new file mode 100644
index 0000000000..9f3d47f38b
--- /dev/null
+++ b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99448.patch
@@ -0,0 +1,147 @@
12010-12-13 Chung-Lin Tang <cltang@codesourcery.com>
2
3 Backport from mainline:
4
5 2010-12-10 Jakub Jelinek <jakub@redhat.com>
6
7 PR rtl-optimization/46865
8
9 * rtl.c (rtx_equal_p_cb, rtx_equal_p): For last operand of
10 ASM_OPERANDS and ASM_INPUT if integers are different,
11 call locator_eq.
12 * jump.c (rtx_renumbered_equal_p): Likewise.
13
14 gcc/testsuite/
15 * gcc.target/i386/pr46865-1.c: New test.
16 * gcc.target/i386/pr46865-2.c: New test.
17
18=== modified file 'gcc/jump.c'
19--- old/gcc/jump.c 2009-11-25 10:55:54 +0000
20+++ new/gcc/jump.c 2010-12-13 10:05:52 +0000
21@@ -1728,7 +1728,13 @@
22
23 case 'i':
24 if (XINT (x, i) != XINT (y, i))
25- return 0;
26+ {
27+ if (((code == ASM_OPERANDS && i == 6)
28+ || (code == ASM_INPUT && i == 1))
29+ && locator_eq (XINT (x, i), XINT (y, i)))
30+ break;
31+ return 0;
32+ }
33 break;
34
35 case 't':
36
37=== modified file 'gcc/rtl.c'
38--- old/gcc/rtl.c 2009-11-25 10:55:54 +0000
39+++ new/gcc/rtl.c 2010-12-13 10:05:52 +0000
40@@ -429,7 +429,15 @@
41 case 'n':
42 case 'i':
43 if (XINT (x, i) != XINT (y, i))
44- return 0;
45+ {
46+#ifndef GENERATOR_FILE
47+ if (((code == ASM_OPERANDS && i == 6)
48+ || (code == ASM_INPUT && i == 1))
49+ && locator_eq (XINT (x, i), XINT (y, i)))
50+ break;
51+#endif
52+ return 0;
53+ }
54 break;
55
56 case 'V':
57@@ -549,7 +557,15 @@
58 case 'n':
59 case 'i':
60 if (XINT (x, i) != XINT (y, i))
61- return 0;
62+ {
63+#ifndef GENERATOR_FILE
64+ if (((code == ASM_OPERANDS && i == 6)
65+ || (code == ASM_INPUT && i == 1))
66+ && locator_eq (XINT (x, i), XINT (y, i)))
67+ break;
68+#endif
69+ return 0;
70+ }
71 break;
72
73 case 'V':
74
75=== added file 'gcc/testsuite/gcc.target/i386/pr46865-1.c'
76--- old/gcc/testsuite/gcc.target/i386/pr46865-1.c 1970-01-01 00:00:00 +0000
77+++ new/gcc/testsuite/gcc.target/i386/pr46865-1.c 2010-12-13 10:05:52 +0000
78@@ -0,0 +1,31 @@
79+/* PR rtl-optimization/46865 */
80+/* { dg-do compile } */
81+/* { dg-options "-O2" } */
82+
83+extern unsigned long f;
84+
85+#define m1(f) \
86+ if (f & 1) \
87+ asm volatile ("nop /* asmnop */\n"); \
88+ else \
89+ asm volatile ("nop /* asmnop */\n");
90+
91+#define m2(f) \
92+ if (f & 1) \
93+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
94+ else \
95+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
96+
97+void
98+foo (void)
99+{
100+ m1 (f);
101+}
102+
103+void
104+bar (void)
105+{
106+ m2 (f);
107+}
108+
109+/* { dg-final { scan-assembler-times "asmnop" 2 } } */
110
111=== added file 'gcc/testsuite/gcc.target/i386/pr46865-2.c'
112--- old/gcc/testsuite/gcc.target/i386/pr46865-2.c 1970-01-01 00:00:00 +0000
113+++ new/gcc/testsuite/gcc.target/i386/pr46865-2.c 2010-12-13 10:05:52 +0000
114@@ -0,0 +1,32 @@
115+/* PR rtl-optimization/46865 */
116+/* { dg-do compile } */
117+/* { dg-options "-O2 -save-temps" } */
118+
119+extern unsigned long f;
120+
121+#define m1(f) \
122+ if (f & 1) \
123+ asm volatile ("nop /* asmnop */\n"); \
124+ else \
125+ asm volatile ("nop /* asmnop */\n");
126+
127+#define m2(f) \
128+ if (f & 1) \
129+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
130+ else \
131+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
132+
133+void
134+foo (void)
135+{
136+ m1 (f);
137+}
138+
139+void
140+bar (void)
141+{
142+ m2 (f);
143+}
144+
145+/* { dg-final { scan-assembler-times "asmnop" 2 } } */
146+/* { dg-final { cleanup-saved-temps } } */
147