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