diff options
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99388.patch')
-rw-r--r-- | recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99388.patch | 191 |
1 files changed, 191 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99388.patch b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99388.patch new file mode 100644 index 0000000000..f603fcadba --- /dev/null +++ b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99388.patch | |||
@@ -0,0 +1,191 @@ | |||
1 | 2010-09-13 Andrew Stubbs <ams@codesourcery.com> | ||
2 | |||
3 | Backport from FSF: | ||
4 | |||
5 | 2010-09-13 Marcus Shawcroft <marcus.shawcroft@arm.com> | ||
6 | |||
7 | * config/arm/arm.md: (define_attr "conds"): Update comment. | ||
8 | * config/arm/sync.md (arm_sync_compare_and_swapsi): Change | ||
9 | conds attribute to clob. | ||
10 | (arm_sync_compare_and_swapsi): Likewise. | ||
11 | (arm_sync_compare_and_swap<mode>): Likewise. | ||
12 | (arm_sync_lock_test_and_setsi): Likewise. | ||
13 | (arm_sync_lock_test_and_set<mode>): Likewise. | ||
14 | (arm_sync_new_<sync_optab>si): Likewise. | ||
15 | (arm_sync_new_nandsi): Likewise. | ||
16 | (arm_sync_new_<sync_optab><mode>): Likewise. | ||
17 | (arm_sync_new_nand<mode>): Likewise. | ||
18 | (arm_sync_old_<sync_optab>si): Likewise. | ||
19 | (arm_sync_old_nandsi): Likewise. | ||
20 | (arm_sync_old_<sync_optab><mode>): Likewise. | ||
21 | (arm_sync_old_nand<mode>): Likewise. | ||
22 | |||
23 | 2010-09-13 Marcus Shawcroft <marcus.shawcroft@arm.com> | ||
24 | |||
25 | * gcc.target/arm/sync-1.c: New. | ||
26 | |||
27 | 2010-09-10 Andrew Stubbs <ams@codesourcery.com> | ||
28 | |||
29 | gcc/ | ||
30 | |||
31 | === modified file 'gcc/config/arm/arm.md' | ||
32 | --- old/gcc/config/arm/arm.md 2010-09-09 15:03:00 +0000 | ||
33 | +++ new/gcc/config/arm/arm.md 2010-09-13 15:39:11 +0000 | ||
34 | @@ -352,10 +352,11 @@ | ||
35 | ; CLOB means that the condition codes are altered in an undefined manner, if | ||
36 | ; they are altered at all | ||
37 | ; | ||
38 | -; UNCONDITIONAL means the instions can not be conditionally executed. | ||
39 | +; UNCONDITIONAL means the instruction can not be conditionally executed and | ||
40 | +; that the instruction does not use or alter the condition codes. | ||
41 | ; | ||
42 | -; NOCOND means that the condition codes are neither altered nor affect the | ||
43 | -; output of this insn | ||
44 | +; NOCOND means that the instruction does not use or alter the condition | ||
45 | +; codes but can be converted into a conditionally exectuted instruction. | ||
46 | |||
47 | (define_attr "conds" "use,set,clob,unconditional,nocond" | ||
48 | (if_then_else (eq_attr "type" "call") | ||
49 | |||
50 | === modified file 'gcc/config/arm/sync.md' | ||
51 | --- old/gcc/config/arm/sync.md 2010-09-09 15:18:16 +0000 | ||
52 | +++ new/gcc/config/arm/sync.md 2010-09-13 15:39:11 +0000 | ||
53 | @@ -300,7 +300,7 @@ | ||
54 | (set_attr "sync_new_value" "3") | ||
55 | (set_attr "sync_t1" "0") | ||
56 | (set_attr "sync_t2" "4") | ||
57 | - (set_attr "conds" "nocond") | ||
58 | + (set_attr "conds" "clob") | ||
59 | (set_attr "predicable" "no")]) | ||
60 | |||
61 | (define_insn "arm_sync_compare_and_swap<mode>" | ||
62 | @@ -327,7 +327,7 @@ | ||
63 | (set_attr "sync_new_value" "3") | ||
64 | (set_attr "sync_t1" "0") | ||
65 | (set_attr "sync_t2" "4") | ||
66 | - (set_attr "conds" "nocond") | ||
67 | + (set_attr "conds" "clob") | ||
68 | (set_attr "predicable" "no")]) | ||
69 | |||
70 | (define_insn "arm_sync_lock_test_and_setsi" | ||
71 | @@ -348,7 +348,7 @@ | ||
72 | (set_attr "sync_new_value" "2") | ||
73 | (set_attr "sync_t1" "0") | ||
74 | (set_attr "sync_t2" "3") | ||
75 | - (set_attr "conds" "nocond") | ||
76 | + (set_attr "conds" "clob") | ||
77 | (set_attr "predicable" "no")]) | ||
78 | |||
79 | (define_insn "arm_sync_lock_test_and_set<mode>" | ||
80 | @@ -369,7 +369,7 @@ | ||
81 | (set_attr "sync_new_value" "2") | ||
82 | (set_attr "sync_t1" "0") | ||
83 | (set_attr "sync_t2" "3") | ||
84 | - (set_attr "conds" "nocond") | ||
85 | + (set_attr "conds" "clob") | ||
86 | (set_attr "predicable" "no")]) | ||
87 | |||
88 | (define_insn "arm_sync_new_<sync_optab>si" | ||
89 | @@ -394,7 +394,7 @@ | ||
90 | (set_attr "sync_t1" "0") | ||
91 | (set_attr "sync_t2" "3") | ||
92 | (set_attr "sync_op" "<sync_optab>") | ||
93 | - (set_attr "conds" "nocond") | ||
94 | + (set_attr "conds" "clob") | ||
95 | (set_attr "predicable" "no")]) | ||
96 | |||
97 | (define_insn "arm_sync_new_nandsi" | ||
98 | @@ -419,7 +419,7 @@ | ||
99 | (set_attr "sync_t1" "0") | ||
100 | (set_attr "sync_t2" "3") | ||
101 | (set_attr "sync_op" "nand") | ||
102 | - (set_attr "conds" "nocond") | ||
103 | + (set_attr "conds" "clob") | ||
104 | (set_attr "predicable" "no")]) | ||
105 | |||
106 | (define_insn "arm_sync_new_<sync_optab><mode>" | ||
107 | @@ -445,7 +445,7 @@ | ||
108 | (set_attr "sync_t1" "0") | ||
109 | (set_attr "sync_t2" "3") | ||
110 | (set_attr "sync_op" "<sync_optab>") | ||
111 | - (set_attr "conds" "nocond") | ||
112 | + (set_attr "conds" "clob") | ||
113 | (set_attr "predicable" "no")]) | ||
114 | |||
115 | (define_insn "arm_sync_new_nand<mode>" | ||
116 | @@ -472,7 +472,7 @@ | ||
117 | (set_attr "sync_t1" "0") | ||
118 | (set_attr "sync_t2" "3") | ||
119 | (set_attr "sync_op" "nand") | ||
120 | - (set_attr "conds" "nocond") | ||
121 | + (set_attr "conds" "clob") | ||
122 | (set_attr "predicable" "no")]) | ||
123 | |||
124 | (define_insn "arm_sync_old_<sync_optab>si" | ||
125 | @@ -498,7 +498,7 @@ | ||
126 | (set_attr "sync_t1" "3") | ||
127 | (set_attr "sync_t2" "4") | ||
128 | (set_attr "sync_op" "<sync_optab>") | ||
129 | - (set_attr "conds" "nocond") | ||
130 | + (set_attr "conds" "clob") | ||
131 | (set_attr "predicable" "no")]) | ||
132 | |||
133 | (define_insn "arm_sync_old_nandsi" | ||
134 | @@ -524,7 +524,7 @@ | ||
135 | (set_attr "sync_t1" "3") | ||
136 | (set_attr "sync_t2" "4") | ||
137 | (set_attr "sync_op" "nand") | ||
138 | - (set_attr "conds" "nocond") | ||
139 | + (set_attr "conds" "clob") | ||
140 | (set_attr "predicable" "no")]) | ||
141 | |||
142 | (define_insn "arm_sync_old_<sync_optab><mode>" | ||
143 | @@ -551,7 +551,7 @@ | ||
144 | (set_attr "sync_t1" "3") | ||
145 | (set_attr "sync_t2" "4") | ||
146 | (set_attr "sync_op" "<sync_optab>") | ||
147 | - (set_attr "conds" "nocond") | ||
148 | + (set_attr "conds" "clob") | ||
149 | (set_attr "predicable" "no")]) | ||
150 | |||
151 | (define_insn "arm_sync_old_nand<mode>" | ||
152 | @@ -578,7 +578,7 @@ | ||
153 | (set_attr "sync_t1" "3") | ||
154 | (set_attr "sync_t2" "4") | ||
155 | (set_attr "sync_op" "nand") | ||
156 | - (set_attr "conds" "nocond") | ||
157 | + (set_attr "conds" "clob") | ||
158 | (set_attr "predicable" "no")]) | ||
159 | |||
160 | (define_insn "*memory_barrier" | ||
161 | |||
162 | === added file 'gcc/testsuite/gcc.target/arm/sync-1.c' | ||
163 | --- old/gcc/testsuite/gcc.target/arm/sync-1.c 1970-01-01 00:00:00 +0000 | ||
164 | +++ new/gcc/testsuite/gcc.target/arm/sync-1.c 2010-09-13 15:39:11 +0000 | ||
165 | @@ -0,0 +1,25 @@ | ||
166 | +/* { dg-do run } */ | ||
167 | +/* { dg-options "-O2 -march=armv7-a" } */ | ||
168 | + | ||
169 | +volatile int mem; | ||
170 | + | ||
171 | +int | ||
172 | +bar (int x, int y) | ||
173 | +{ | ||
174 | + if (x) | ||
175 | + __sync_fetch_and_add(&mem, y); | ||
176 | + return 0; | ||
177 | +} | ||
178 | + | ||
179 | +extern void abort (void); | ||
180 | + | ||
181 | +int | ||
182 | +main (int argc, char *argv[]) | ||
183 | +{ | ||
184 | + mem = 0; | ||
185 | + bar (0, 1); | ||
186 | + bar (1, 1); | ||
187 | + if (mem != 1) | ||
188 | + abort (); | ||
189 | + return 0; | ||
190 | +} | ||
191 | |||