Merge lp:~cltang/gcc-linaro/lp-687406-save-temps-difference-backport into lp:gcc-linaro/4.5

Proposed by Chung-Lin Tang
Status: Merged
Merged at revision: 99448
Proposed branch: lp:~cltang/gcc-linaro/lp-687406-save-temps-difference-backport
Merge into: lp:gcc-linaro/4.5
Diff against target: 155 lines (+106/-3)
5 files modified
ChangeLog.linaro (+18/-0)
gcc/jump.c (+7/-1)
gcc/rtl.c (+18/-2)
gcc/testsuite/gcc.target/i386/pr46865-1.c (+31/-0)
gcc/testsuite/gcc.target/i386/pr46865-2.c (+32/-0)
To merge this branch: bzr merge lp:~cltang/gcc-linaro/lp-687406-save-temps-difference-backport
Reviewer Review Type Date Requested Status
Linaro Toolchain Developers Pending
Review via email: mp+43507@code.launchpad.net

Description of the change

Backports mainline trunk rev.167686, to fix LP:687406
http://gcc.gnu.org/viewcvs?view=revision&revision=167686

To post a comment you must log in.
Revision history for this message
Ulrich Weigand (uweigand) wrote :

Looks good to me.

Preview Diff

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

Subscribers

People subscribed via source and target branches