1 |
lu_zero 10/08/19 15:44:08 |
2 |
|
3 |
Modified: README.history |
4 |
Added: 95_all_arm-pr43440.patch |
5 |
Log: |
6 |
Forward port arm clobber list fixes from 4.4.4 |
7 |
|
8 |
Revision Changes Path |
9 |
1.3 src/patchsets/gcc/4.5.1/gentoo/README.history |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.1/gentoo/README.history?rev=1.3&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.1/gentoo/README.history?rev=1.3&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.1/gentoo/README.history?r1=1.2&r2=1.3 |
14 |
|
15 |
Index: README.history |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.5.1/gentoo/README.history,v |
18 |
retrieving revision 1.2 |
19 |
retrieving revision 1.3 |
20 |
diff -u -r1.2 -r1.3 |
21 |
--- README.history 7 Aug 2010 22:10:15 -0000 1.2 |
22 |
+++ README.history 19 Aug 2010 15:44:08 -0000 1.3 |
23 |
@@ -1,3 +1,4 @@ |
24 |
+ + 95_all_arm-pr43440.patch |
25 |
1.0 07.08.2010 |
26 |
+ 00_all_gcc-4.1-alpha-mieee-default.patch |
27 |
+ 01_all_gcc-4.1-alpha-asm-mcpu.patch |
28 |
|
29 |
|
30 |
|
31 |
1.1 src/patchsets/gcc/4.5.1/gentoo/95_all_arm-pr43440.patch |
32 |
|
33 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.1/gentoo/95_all_arm-pr43440.patch?rev=1.1&view=markup |
34 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.5.1/gentoo/95_all_arm-pr43440.patch?rev=1.1&content-type=text/plain |
35 |
|
36 |
Index: 95_all_arm-pr43440.patch |
37 |
=================================================================== |
38 |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43440 |
39 |
|
40 |
diff -urN gcc-4.4.4.orig/gcc/config/arm/aout.h gcc-4.4.4/gcc/config/arm/aout.h |
41 |
--- gcc-4.4.4.orig/gcc/config/arm/aout.h 2009-02-20 16:20:38.000000000 +0100 |
42 |
+++ gcc-4.4.4/gcc/config/arm/aout.h 2010-08-18 14:37:50.000000000 +0200 |
43 |
@@ -163,34 +163,49 @@ |
44 |
{"mvdx12", 39}, \ |
45 |
{"mvdx13", 40}, \ |
46 |
{"mvdx14", 41}, \ |
47 |
- {"mvdx15", 42}, \ |
48 |
- {"d0", 63}, {"q0", 63}, \ |
49 |
- {"d1", 65}, \ |
50 |
- {"d2", 67}, {"q1", 67}, \ |
51 |
- {"d3", 69}, \ |
52 |
- {"d4", 71}, {"q2", 71}, \ |
53 |
- {"d5", 73}, \ |
54 |
- {"d6", 75}, {"q3", 75}, \ |
55 |
- {"d7", 77}, \ |
56 |
- {"d8", 79}, {"q4", 79}, \ |
57 |
- {"d9", 81}, \ |
58 |
- {"d10", 83}, {"q5", 83}, \ |
59 |
- {"d11", 85}, \ |
60 |
- {"d12", 87}, {"q6", 87}, \ |
61 |
- {"d13", 89}, \ |
62 |
- {"d14", 91}, {"q7", 91}, \ |
63 |
- {"d15", 93}, \ |
64 |
- {"q8", 95}, \ |
65 |
- {"q9", 99}, \ |
66 |
- {"q10", 103}, \ |
67 |
- {"q11", 107}, \ |
68 |
- {"q12", 111}, \ |
69 |
- {"q13", 115}, \ |
70 |
- {"q14", 119}, \ |
71 |
- {"q15", 123} \ |
72 |
+ {"mvdx15", 42} \ |
73 |
} |
74 |
#endif |
75 |
|
76 |
+#ifndef OVERLAPPING_REGISTER_NAMES |
77 |
+#define OVERLAPPING_REGISTER_NAMES \ |
78 |
+{ \ |
79 |
+ {"d0", 63, 2}, \ |
80 |
+ {"d1", 65, 2}, \ |
81 |
+ {"d2", 67, 2}, \ |
82 |
+ {"d3", 69, 2}, \ |
83 |
+ {"d4", 71, 2}, \ |
84 |
+ {"d5", 73, 2}, \ |
85 |
+ {"d6", 75, 2}, \ |
86 |
+ {"d7", 77, 2}, \ |
87 |
+ {"d8", 79, 2}, \ |
88 |
+ {"d9", 81, 2}, \ |
89 |
+ {"d10", 83, 2}, \ |
90 |
+ {"d11", 85, 2}, \ |
91 |
+ {"d12", 87, 2}, \ |
92 |
+ {"d13", 89, 2}, \ |
93 |
+ {"d14", 91, 2}, \ |
94 |
+ {"d15", 93, 2}, \ |
95 |
+ {"q0", 63, 4}, \ |
96 |
+ {"q1", 67, 4}, \ |
97 |
+ {"q2", 71, 4}, \ |
98 |
+ {"q3", 75, 4}, \ |
99 |
+ {"q4", 79, 4}, \ |
100 |
+ {"q5", 83, 4}, \ |
101 |
+ {"q6", 87, 4}, \ |
102 |
+ {"q7", 91, 4}, \ |
103 |
+ {"q8", 95, 4}, \ |
104 |
+ {"q9", 99, 4}, \ |
105 |
+ {"q10", 103, 4}, \ |
106 |
+ {"q11", 107, 4}, \ |
107 |
+ {"q12", 111, 4}, \ |
108 |
+ {"q13", 115, 4}, \ |
109 |
+ {"q14", 119, 4}, \ |
110 |
+ {"q15", 123, 4} \ |
111 |
+} |
112 |
+#endif |
113 |
+ |
114 |
+ |
115 |
#ifndef NO_DOLLAR_IN_LABEL |
116 |
#define NO_DOLLAR_IN_LABEL 1 |
117 |
#endif |
118 |
diff -urN gcc-4.4.4.orig/gcc/output.h gcc-4.4.4/gcc/output.h |
119 |
--- gcc-4.4.4.orig/gcc/output.h 2008-11-22 09:22:52.000000000 +0100 |
120 |
+++ gcc-4.4.4/gcc/output.h 2010-08-18 14:39:23.000000000 +0200 |
121 |
@@ -169,6 +169,11 @@ |
122 |
Prefixes such as % are optional. */ |
123 |
extern int decode_reg_name (const char *); |
124 |
|
125 |
+/* Similar to decode_reg_name, but takes an extra parameter that is a |
126 |
+ pointer to the number of (internal) registers described by the |
127 |
+ external name. */ |
128 |
+extern int decode_reg_name_and_count (const char *, int *); |
129 |
+ |
130 |
extern void assemble_alias (tree, tree); |
131 |
|
132 |
extern void default_assemble_visibility (tree, int); |
133 |
diff -urN gcc-4.4.4.orig/gcc/reginfo.c gcc-4.4.4/gcc/reginfo.c |
134 |
--- gcc-4.4.4.orig/gcc/reginfo.c 2010-04-19 12:06:13.000000000 +0200 |
135 |
+++ gcc-4.4.4/gcc/reginfo.c 2010-08-18 14:44:32.000000000 +0200 |
136 |
@@ -800,39 +800,44 @@ |
137 |
fix_register (const char *name, int fixed, int call_used) |
138 |
{ |
139 |
int i; |
140 |
+ int reg, nregs; |
141 |
|
142 |
/* Decode the name and update the primary form of |
143 |
the register info. */ |
144 |
- |
145 |
- if ((i = decode_reg_name (name)) >= 0) |
146 |
+ if ((reg = decode_reg_name_and_count (name, &nregs)) >= 0) |
147 |
{ |
148 |
- if ((i == STACK_POINTER_REGNUM |
149 |
+ gcc_assert (nregs >= 1); |
150 |
+ for (i = reg; i < reg + nregs; i++) |
151 |
+ { |
152 |
+ if ((i == STACK_POINTER_REGNUM |
153 |
#ifdef HARD_FRAME_POINTER_REGNUM |
154 |
- || i == HARD_FRAME_POINTER_REGNUM |
155 |
+ || i == HARD_FRAME_POINTER_REGNUM |
156 |
#else |
157 |
- || i == FRAME_POINTER_REGNUM |
158 |
+ || i == FRAME_POINTER_REGNUM |
159 |
#endif |
160 |
- ) |
161 |
- && (fixed == 0 || call_used == 0)) |
162 |
- { |
163 |
- static const char * const what_option[2][2] = { |
164 |
- { "call-saved", "call-used" }, |
165 |
- { "no-such-option", "fixed" }}; |
166 |
+ ) |
167 |
+ && (fixed == 0 || call_used == 0)) |
168 |
+ { |
169 |
+ static const char * const what_option[2][2] = { |
170 |
+ { "call-saved", "call-used" }, |
171 |
+ { "no-such-option", "fixed" }}; |
172 |
|
173 |
- error ("can't use '%s' as a %s register", name, |
174 |
- what_option[fixed][call_used]); |
175 |
- } |
176 |
- else |
177 |
- { |
178 |
- fixed_regs[i] = fixed; |
179 |
- call_used_regs[i] = call_used; |
180 |
+ error ("can't use '%s' as a %s register", name, |
181 |
+ what_option[fixed][call_used]); |
182 |
+ } |
183 |
+ else |
184 |
+ { |
185 |
+ fixed_regs[i] = fixed; |
186 |
+ call_used_regs[i] = call_used; |
187 |
#ifdef CALL_REALLY_USED_REGISTERS |
188 |
- if (fixed == 0) |
189 |
- call_really_used_regs[i] = call_used; |
190 |
+ if (fixed == 0) |
191 |
+ call_really_used_regs[i] = call_used; |
192 |
#endif |
193 |
- } |
194 |
- } |
195 |
- else |
196 |
+ } |
197 |
+ } |
198 |
+ } |
199 |
+ else |
200 |
+ |
201 |
{ |
202 |
warning (0, "unknown register name: %s", name); |
203 |
} |
204 |
diff -urN gcc-4.4.4.orig/gcc/stmt.c gcc-4.4.4/gcc/stmt.c |
205 |
--- gcc-4.4.4.orig/gcc/stmt.c 2010-08-18 13:10:29.000000000 +0200 |
206 |
+++ gcc-4.4.4/gcc/stmt.c 2010-08-18 14:59:56.000000000 +0200 |
207 |
@@ -681,13 +681,14 @@ |
208 |
for (tail = clobbers; tail; tail = TREE_CHAIN (tail)) |
209 |
{ |
210 |
const char *regname; |
211 |
+ int nregs; |
212 |
|
213 |
if (TREE_VALUE (tail) == error_mark_node) |
214 |
return; |
215 |
regname = TREE_STRING_POINTER (TREE_VALUE (tail)); |
216 |
|
217 |
- i = decode_reg_name (regname); |
218 |
- if (i >= 0 || i == -4) |
219 |
+ i = decode_reg_name_and_count (regname, &nregs); |
220 |
+ if (i == -4) |
221 |
++nclobbers; |
222 |
else if (i == -2) |
223 |
error ("unknown register name %qs in %<asm%>", regname); |
224 |
@@ -695,14 +696,21 @@ |
225 |
/* Mark clobbered registers. */ |
226 |
if (i >= 0) |
227 |
{ |
228 |
- /* Clobbering the PIC register is an error. */ |
229 |
- if (i == (int) PIC_OFFSET_TABLE_REGNUM) |
230 |
- { |
231 |
- error ("PIC register %qs clobbered in %<asm%>", regname); |
232 |
- return; |
233 |
- } |
234 |
+ int reg; |
235 |
|
236 |
- SET_HARD_REG_BIT (clobbered_regs, i); |
237 |
+ for (reg = i; reg < i + nregs; reg++) |
238 |
+ { |
239 |
+ ++nclobbers; |
240 |
+ |
241 |
+ /* Clobbering the PIC register is an error. */ |
242 |
+ if (reg == (int) PIC_OFFSET_TABLE_REGNUM) |
243 |
+ { |
244 |
+ error ("PIC register clobbered by %qs in %<asm%>", regname); |
245 |
+ return; |
246 |
+ } |
247 |
+ |
248 |
+ SET_HARD_REG_BIT (clobbered_regs, reg); |
249 |
+ } |
250 |
} |
251 |
} |
252 |
|
253 |
@@ -1012,8 +1020,9 @@ |
254 |
for (tail = clobbers; tail; tail = TREE_CHAIN (tail)) |
255 |
{ |
256 |
const char *regname = TREE_STRING_POINTER (TREE_VALUE (tail)); |
257 |
- int j = decode_reg_name (regname); |
258 |
- rtx clobbered_reg; |
259 |
+ int reg, nregs; |
260 |
+ int j = decode_reg_name_and_count (regname, &nregs); |
261 |
+ rtx clobbered_reg; |
262 |
|
263 |
if (j < 0) |
264 |
{ |
265 |
@@ -1033,31 +1042,40 @@ |
266 |
/* Ignore unknown register, error already signaled. */ |
267 |
continue; |
268 |
} |
269 |
- |
270 |
- /* Use QImode since that's guaranteed to clobber just one reg. */ |
271 |
- clobbered_reg = gen_rtx_REG (QImode, j); |
272 |
- |
273 |
- /* Do sanity check for overlap between clobbers and respectively |
274 |
- input and outputs that hasn't been handled. Such overlap |
275 |
- should have been detected and reported above. */ |
276 |
- if (!clobber_conflict_found) |
277 |
- { |
278 |
- int opno; |
279 |
- |
280 |
- /* We test the old body (obody) contents to avoid tripping |
281 |
- over the under-construction body. */ |
282 |
- for (opno = 0; opno < noutputs; opno++) |
283 |
- if (reg_overlap_mentioned_p (clobbered_reg, output_rtx[opno])) |
284 |
- internal_error ("asm clobber conflict with output operand"); |
285 |
- |
286 |
- for (opno = 0; opno < ninputs - ninout; opno++) |
287 |
- if (reg_overlap_mentioned_p (clobbered_reg, |
288 |
- ASM_OPERANDS_INPUT (obody, opno))) |
289 |
- internal_error ("asm clobber conflict with input operand"); |
290 |
+ |
291 |
+ for (reg = j; reg < j + nregs; reg++) |
292 |
+ { |
293 |
+ /* Use QImode since that's guaranteed to clobber just |
294 |
+ * one reg. */ |
295 |
+ clobbered_reg = gen_rtx_REG (QImode, reg); |
296 |
+ |
297 |
+ /* Do sanity check for overlap between clobbers and |
298 |
+ respectively input and outputs that hasn't been |
299 |
+ handled. Such overlap should have been detected and |
300 |
+ reported above. */ |
301 |
+ if (!clobber_conflict_found) |
302 |
+ { |
303 |
+ int opno; |
304 |
+ |
305 |
+ /* We test the old body (obody) contents to avoid |
306 |
+ tripping over the under-construction body. */ |
307 |
+ for (opno = 0; opno < noutputs; opno++) |
308 |
+ if (reg_overlap_mentioned_p (clobbered_reg, |
309 |
+ output_rtx[opno])) |
310 |
+ internal_error |
311 |
+ ("asm clobber conflict with output operand"); |
312 |
+ |
313 |
+ for (opno = 0; opno < ninputs - ninout; opno++) |
314 |
+ if (reg_overlap_mentioned_p (clobbered_reg, |
315 |
+ ASM_OPERANDS_INPUT (obody, |
316 |
+ opno))) |
317 |
+ internal_error |
318 |
+ ("asm clobber conflict with input operand"); |
319 |
+ } |
320 |
+ |
321 |
+ XVECEXP (body, 0, i++) |
322 |
+ = gen_rtx_CLOBBER (VOIDmode, clobbered_reg); |
323 |
} |
324 |
- |
325 |
- XVECEXP (body, 0, i++) |
326 |
- = gen_rtx_CLOBBER (VOIDmode, clobbered_reg); |
327 |
} |
328 |
|
329 |
emit_insn (body); |
330 |
diff -urN gcc-4.4.4.orig/gcc/varasm.c gcc-4.4.4/gcc/varasm.c |
331 |
--- gcc-4.4.4.orig/gcc/varasm.c 2010-01-20 12:27:49.000000000 +0100 |
332 |
+++ gcc-4.4.4/gcc/varasm.c 2010-08-18 15:04:12.000000000 +0200 |
333 |
@@ -1031,8 +1031,11 @@ |
334 |
Prefixes such as % are optional. */ |
335 |
|
336 |
int |
337 |
-decode_reg_name (const char *asmspec) |
338 |
+decode_reg_name_and_count (const char *asmspec, int *pnregs) |
339 |
{ |
340 |
+ /* Presume just one register is clobbered. */ |
341 |
+ *pnregs = 1; |
342 |
+ |
343 |
if (asmspec != 0) |
344 |
{ |
345 |
int i; |
346 |
@@ -1058,6 +1061,25 @@ |
347 |
&& ! strcmp (asmspec, strip_reg_name (reg_names[i]))) |
348 |
return i; |
349 |
|
350 |
+#ifdef OVERLAPPING_REGISTER_NAMES |
351 |
+ { |
352 |
+ static const struct |
353 |
+ { |
354 |
+ const char *const name; |
355 |
+ const int number; |
356 |
+ const int nregs; |
357 |
+ } table[] = OVERLAPPING_REGISTER_NAMES; |
358 |
+ |
359 |
+ for (i = 0; i < (int) ARRAY_SIZE (table); i++) |
360 |
+ if (table[i].name[0] |
361 |
+ && ! strcmp (asmspec, table[i].name)) |
362 |
+ { |
363 |
+ *pnregs = table[i].nregs; |
364 |
+ return table[i].number; |
365 |
+ } |
366 |
+ } |
367 |
+#endif /* OVERLAPPING_REGISTER_NAMES */ |
368 |
+ |
369 |
#ifdef ADDITIONAL_REGISTER_NAMES |
370 |
{ |
371 |
static const struct { const char *const name; const int number; } table[] |
372 |
@@ -1081,6 +1103,15 @@ |
373 |
|
374 |
return -1; |
375 |
} |
376 |
+ |
377 |
+int |
378 |
+decode_reg_name (const char *name) |
379 |
+{ |
380 |
+ int count; |
381 |
+ return decode_reg_name_and_count (name, &count); |
382 |
+} |
383 |
+ |
384 |
+ |
385 |
|
386 |
/* Return true if DECL's initializer is suitable for a BSS section. */ |