summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-devtools')
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5.inc11
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99396.patch315
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99436.patch43
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99519.patch25
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99521.patch166
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99522.patch210
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99523.patch119
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99524.patch209
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99525.patch67
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99528.patch138
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99529.patch741
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/linaro-lp815435.patch25
12 files changed, 1870 insertions, 199 deletions
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5.inc b/meta-oe/recipes-devtools/gcc/gcc-4.5.inc
index abd30882d..e214a4dc6 100644
--- a/meta-oe/recipes-devtools/gcc/gcc-4.5.inc
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5.inc
@@ -24,7 +24,7 @@ INC_PR = "r39"
24 24
25BINV = "${PV}.4" 25BINV = "${PV}.4"
26 26
27SRCREV = 175127 27SRCREV = 176640
28BRANCH = "gcc-4_5-branch" 28BRANCH = "gcc-4_5-branch"
29PR_append = "+svnr${SRCPV}" 29PR_append = "+svnr${SRCPV}"
30 30
@@ -192,6 +192,15 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH};proto=http \
192 file://linaro/gcc-4.5-linaro-r99511.patch \ 192 file://linaro/gcc-4.5-linaro-r99511.patch \
193 file://linaro/gcc-4.5-linaro-r99514.patch \ 193 file://linaro/gcc-4.5-linaro-r99514.patch \
194 file://linaro/gcc-4.5-linaro-r99516.patch \ 194 file://linaro/gcc-4.5-linaro-r99516.patch \
195 file://linaro/gcc-4.5-linaro-r99519.patch \
196 file://linaro/gcc-4.5-linaro-r99521.patch \
197 file://linaro/gcc-4.5-linaro-r99522.patch \
198 file://linaro/gcc-4.5-linaro-r99523.patch \
199 file://linaro/gcc-4.5-linaro-r99524.patch \
200 file://linaro/gcc-4.5-linaro-r99525.patch \
201 file://linaro/gcc-4.5-linaro-r99528.patch \
202 file://linaro/gcc-4.5-linaro-r99529.patch \
203 file://linaro/linaro-lp815435.patch \
195 \ 204 \
196 file://more-epilogues.patch \ 205 file://more-epilogues.patch \
197 file://gcc-scalar-widening-pr45847.patch \ 206 file://gcc-scalar-widening-pr45847.patch \
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99396.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99396.patch
index 655399ab1..b7eaa685a 100644
--- a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99396.patch
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99396.patch
@@ -110,8 +110,10 @@
110 Backport from mainline: 110 Backport from mainline:
111 111
112=== modified file 'gcc/cfgexpand.c' 112=== modified file 'gcc/cfgexpand.c'
113--- old/gcc/cfgexpand.c 2010-09-01 13:29:58 +0000 113Index: gcc-4_5-branch/gcc/cfgexpand.c
114+++ new/gcc/cfgexpand.c 2010-09-16 09:15:46 +0000 114===================================================================
115--- gcc-4_5-branch.orig/gcc/cfgexpand.c 2011-07-22 16:59:23.000000000 -0700
116+++ gcc-4_5-branch/gcc/cfgexpand.c 2011-07-22 16:59:28.581747691 -0700
115@@ -64,7 +64,13 @@ 117@@ -64,7 +64,13 @@
116 118
117 grhs_class = get_gimple_rhs_class (gimple_expr_code (stmt)); 119 grhs_class = get_gimple_rhs_class (gimple_expr_code (stmt));
@@ -127,7 +129,7 @@
127 t = build2 (gimple_assign_rhs_code (stmt), 129 t = build2 (gimple_assign_rhs_code (stmt),
128 TREE_TYPE (gimple_assign_lhs (stmt)), 130 TREE_TYPE (gimple_assign_lhs (stmt)),
129 gimple_assign_rhs1 (stmt), 131 gimple_assign_rhs1 (stmt),
130@@ -1887,6 +1893,9 @@ 132@@ -1893,6 +1899,9 @@
131 ops.type = TREE_TYPE (lhs); 133 ops.type = TREE_TYPE (lhs);
132 switch (get_gimple_rhs_class (gimple_expr_code (stmt))) 134 switch (get_gimple_rhs_class (gimple_expr_code (stmt)))
133 { 135 {
@@ -137,7 +139,7 @@
137 case GIMPLE_BINARY_RHS: 139 case GIMPLE_BINARY_RHS:
138 ops.op1 = gimple_assign_rhs2 (stmt); 140 ops.op1 = gimple_assign_rhs2 (stmt);
139 /* Fallthru */ 141 /* Fallthru */
140@@ -2237,6 +2246,8 @@ 142@@ -2243,6 +2252,8 @@
141 { 143 {
142 case COND_EXPR: 144 case COND_EXPR:
143 case DOT_PROD_EXPR: 145 case DOT_PROD_EXPR:
@@ -146,7 +148,7 @@
146 goto ternary; 148 goto ternary;
147 149
148 case TRUTH_ANDIF_EXPR: 150 case TRUTH_ANDIF_EXPR:
149@@ -3023,6 +3034,8 @@ 151@@ -3030,6 +3041,8 @@
150 return NULL; 152 return NULL;
151 153
152 case WIDEN_MULT_EXPR: 154 case WIDEN_MULT_EXPR:
@@ -155,7 +157,7 @@
155 if (SCALAR_INT_MODE_P (GET_MODE (op0)) 157 if (SCALAR_INT_MODE_P (GET_MODE (op0))
156 && SCALAR_INT_MODE_P (mode)) 158 && SCALAR_INT_MODE_P (mode))
157 { 159 {
158@@ -3035,7 +3048,13 @@ 160@@ -3042,7 +3055,13 @@
159 op1 = simplify_gen_unary (ZERO_EXTEND, mode, op1, inner_mode); 161 op1 = simplify_gen_unary (ZERO_EXTEND, mode, op1, inner_mode);
160 else 162 else
161 op1 = simplify_gen_unary (SIGN_EXTEND, mode, op1, inner_mode); 163 op1 = simplify_gen_unary (SIGN_EXTEND, mode, op1, inner_mode);
@@ -170,10 +172,10 @@
170 } 172 }
171 return NULL; 173 return NULL;
172 174
173 175Index: gcc-4_5-branch/gcc/config/arm/arm.md
174=== modified file 'gcc/config/arm/arm.md' 176===================================================================
175--- old/gcc/config/arm/arm.md 2010-09-15 16:55:55 +0000 177--- gcc-4_5-branch.orig/gcc/config/arm/arm.md 2011-07-22 16:59:25.000000000 -0700
176+++ new/gcc/config/arm/arm.md 2010-09-16 09:15:46 +0000 178+++ gcc-4_5-branch/gcc/config/arm/arm.md 2011-07-22 16:59:28.581747691 -0700
177@@ -1507,7 +1507,15 @@ 179@@ -1507,7 +1507,15 @@
178 (set_attr "predicable" "yes")] 180 (set_attr "predicable" "yes")]
179 ) 181 )
@@ -248,10 +250,10 @@
248 [(set_attr "insn" "smlalxy") 250 [(set_attr "insn" "smlalxy")
249 (set_attr "predicable" "yes")]) 251 (set_attr "predicable" "yes")])
250 252
251 253Index: gcc-4_5-branch/gcc/doc/gimple.texi
252=== modified file 'gcc/doc/gimple.texi' 254===================================================================
253--- old/gcc/doc/gimple.texi 2010-07-06 19:23:53 +0000 255--- gcc-4_5-branch.orig/gcc/doc/gimple.texi 2011-07-22 16:58:48.000000000 -0700
254+++ new/gcc/doc/gimple.texi 2010-09-16 09:15:46 +0000 256+++ gcc-4_5-branch/gcc/doc/gimple.texi 2011-07-22 16:59:28.581747691 -0700
255@@ -554,6 +554,9 @@ 257@@ -554,6 +554,9 @@
256 @item @code{GIMPLE_INVALID_RHS} 258 @item @code{GIMPLE_INVALID_RHS}
257 The tree cannot be used as a GIMPLE operand. 259 The tree cannot be used as a GIMPLE operand.
@@ -295,7 +297,7 @@
295 @deftypefn {GIMPLE function} void gimple_assign_set_lhs (gimple g, tree lhs) 297 @deftypefn {GIMPLE function} void gimple_assign_set_lhs (gimple g, tree lhs)
296 Set @code{LHS} to be the @code{LHS} operand of assignment statement @code{G}. 298 Set @code{LHS} to be the @code{LHS} operand of assignment statement @code{G}.
297 @end deftypefn 299 @end deftypefn
298@@ -1092,20 +1105,16 @@ 300@@ -1092,17 +1105,13 @@
299 statement @code{G}. 301 statement @code{G}.
300 @end deftypefn 302 @end deftypefn
301 303
@@ -305,27 +307,23 @@
305- 307-
306-@deftypefn {GIMPLE function} tree *gimple_assign_rhs2_ptr (gimple g) 308-@deftypefn {GIMPLE function} tree *gimple_assign_rhs2_ptr (gimple g)
307-Return a pointer to the second operand on the @code{RHS} of assignment 309-Return a pointer to the second operand on the @code{RHS} of assignment
308-statement @code{G}. 310+@deftypefn {GIMPLE function} void gimple_assign_set_rhs2 (gimple g, tree rhs)
309-@end deftypefn 311+Set @code{RHS} to be the second operand on the @code{RHS} of assignment
310-
311 @deftypefn {GIMPLE function} void gimple_assign_set_rhs2 (gimple g, tree rhs)
312 Set @code{RHS} to be the second operand on the @code{RHS} of assignment
313 statement @code{G}. 312 statement @code{G}.
314 @end deftypefn 313 @end deftypefn
315 314
315-@deftypefn {GIMPLE function} void gimple_assign_set_rhs2 (gimple g, tree rhs)
316-Set @code{RHS} to be the second operand on the @code{RHS} of assignment
316+@deftypefn {GIMPLE function} void gimple_assign_set_rhs3 (gimple g, tree rhs) 317+@deftypefn {GIMPLE function} void gimple_assign_set_rhs3 (gimple g, tree rhs)
317+Set @code{RHS} to be the third operand on the @code{RHS} of assignment 318+Set @code{RHS} to be the third operand on the @code{RHS} of assignment
318+statement @code{G}. 319 statement @code{G}.
319+@end deftypefn
320+
321 @deftypefn {GIMPLE function} bool gimple_assign_cast_p (gimple s)
322 Return true if @code{S} is a type-cast assignment.
323 @end deftypefn 320 @end deftypefn
324 321
325=== modified file 'gcc/expr.c' 322Index: gcc-4_5-branch/gcc/expr.c
326--- old/gcc/expr.c 2010-09-01 13:29:58 +0000 323===================================================================
327+++ new/gcc/expr.c 2010-09-16 09:15:46 +0000 324--- gcc-4_5-branch.orig/gcc/expr.c 2011-07-22 16:59:23.000000000 -0700
328@@ -7225,8 +7225,6 @@ 325+++ gcc-4_5-branch/gcc/expr.c 2011-07-22 16:59:28.591747691 -0700
326@@ -7228,8 +7228,6 @@
329 rtx subtarget, original_target; 327 rtx subtarget, original_target;
330 int ignore; 328 int ignore;
331 bool reduce_bit_field; 329 bool reduce_bit_field;
@@ -334,7 +332,7 @@
334 location_t loc = ops->location; 332 location_t loc = ops->location;
335 tree treeop0, treeop1; 333 tree treeop0, treeop1;
336 #define REDUCE_BIT_FIELD(expr) (reduce_bit_field \ 334 #define REDUCE_BIT_FIELD(expr) (reduce_bit_field \
337@@ -7246,7 +7244,8 @@ 335@@ -7249,7 +7247,8 @@
338 exactly those that are valid in gimple expressions that aren't 336 exactly those that are valid in gimple expressions that aren't
339 GIMPLE_SINGLE_RHS (or invalid). */ 337 GIMPLE_SINGLE_RHS (or invalid). */
340 gcc_assert (get_gimple_rhs_class (code) == GIMPLE_UNARY_RHS 338 gcc_assert (get_gimple_rhs_class (code) == GIMPLE_UNARY_RHS
@@ -344,7 +342,7 @@
344 342
345 ignore = (target == const0_rtx 343 ignore = (target == const0_rtx
346 || ((CONVERT_EXPR_CODE_P (code) 344 || ((CONVERT_EXPR_CODE_P (code)
347@@ -7421,58 +7420,6 @@ 345@@ -7424,58 +7423,6 @@
348 fold_convert_loc (loc, ssizetype, 346 fold_convert_loc (loc, ssizetype,
349 treeop1)); 347 treeop1));
350 case PLUS_EXPR: 348 case PLUS_EXPR:
@@ -403,7 +401,7 @@
403 /* If we are adding a constant, a VAR_DECL that is sp, fp, or ap, and 401 /* If we are adding a constant, a VAR_DECL that is sp, fp, or ap, and
404 something else, make sure we add the register to the constant and 402 something else, make sure we add the register to the constant and
405 then to the other thing. This case can occur during strength 403 then to the other thing. This case can occur during strength
406@@ -7587,57 +7534,6 @@ 404@@ -7590,57 +7537,6 @@
407 return REDUCE_BIT_FIELD (simplify_gen_binary (PLUS, mode, op0, op1)); 405 return REDUCE_BIT_FIELD (simplify_gen_binary (PLUS, mode, op0, op1));
408 406
409 case MINUS_EXPR: 407 case MINUS_EXPR:
@@ -461,7 +459,7 @@
461 /* For initializers, we are allowed to return a MINUS of two 459 /* For initializers, we are allowed to return a MINUS of two
462 symbolic constants. Here we handle all cases when both operands 460 symbolic constants. Here we handle all cases when both operands
463 are constant. */ 461 are constant. */
464@@ -7678,6 +7574,14 @@ 462@@ -7681,6 +7577,14 @@
465 463
466 goto binop2; 464 goto binop2;
467 465
@@ -476,10 +474,10 @@
476 case WIDEN_MULT_EXPR: 474 case WIDEN_MULT_EXPR:
477 /* If first operand is constant, swap them. 475 /* If first operand is constant, swap them.
478 Thus the following special case checks need only 476 Thus the following special case checks need only
479 477Index: gcc-4_5-branch/gcc/gimple-pretty-print.c
480=== modified file 'gcc/gimple-pretty-print.c' 478===================================================================
481--- old/gcc/gimple-pretty-print.c 2009-11-25 10:55:54 +0000 479--- gcc-4_5-branch.orig/gcc/gimple-pretty-print.c 2011-07-22 16:58:48.000000000 -0700
482+++ new/gcc/gimple-pretty-print.c 2010-09-16 09:15:46 +0000 480+++ gcc-4_5-branch/gcc/gimple-pretty-print.c 2011-07-22 16:59:28.591747691 -0700
483@@ -376,6 +376,34 @@ 481@@ -376,6 +376,34 @@
484 } 482 }
485 } 483 }
@@ -524,10 +522,10 @@
524 else 522 else
525 gcc_unreachable (); 523 gcc_unreachable ();
526 if (!(flags & TDF_RHS_ONLY)) 524 if (!(flags & TDF_RHS_ONLY))
527 525Index: gcc-4_5-branch/gcc/gimple.c
528=== modified file 'gcc/gimple.c' 526===================================================================
529--- old/gcc/gimple.c 2010-09-15 16:47:52 +0000 527--- gcc-4_5-branch.orig/gcc/gimple.c 2011-07-22 16:59:25.000000000 -0700
530+++ new/gcc/gimple.c 2010-09-16 09:15:46 +0000 528+++ gcc-4_5-branch/gcc/gimple.c 2011-07-22 16:59:28.591747691 -0700
531@@ -289,31 +289,40 @@ 529@@ -289,31 +289,40 @@
532 530
533 531
@@ -547,13 +545,10 @@
547 grhs_class = get_gimple_rhs_class (*subcode_p); 545 grhs_class = get_gimple_rhs_class (*subcode_p);
548 546
549- if (grhs_class == GIMPLE_BINARY_RHS) 547- if (grhs_class == GIMPLE_BINARY_RHS)
550- {
551- *op1_p = TREE_OPERAND (expr, 0);
552- *op2_p = TREE_OPERAND (expr, 1);
553+ if (grhs_class == GIMPLE_TERNARY_RHS) 548+ if (grhs_class == GIMPLE_TERNARY_RHS)
554+ { 549 {
555+ *op1_p = TREE_OPERAND (expr, 0); 550 *op1_p = TREE_OPERAND (expr, 0);
556+ *op2_p = TREE_OPERAND (expr, 1); 551 *op2_p = TREE_OPERAND (expr, 1);
557+ *op3_p = TREE_OPERAND (expr, 2); 552+ *op3_p = TREE_OPERAND (expr, 2);
558+ } 553+ }
559+ else if (grhs_class == GIMPLE_BINARY_RHS) 554+ else if (grhs_class == GIMPLE_BINARY_RHS)
@@ -668,10 +663,10 @@
668 : ((SYM) == COND_EXPR \ 663 : ((SYM) == COND_EXPR \
669 || (SYM) == CONSTRUCTOR \ 664 || (SYM) == CONSTRUCTOR \
670 || (SYM) == OBJ_TYPE_REF \ 665 || (SYM) == OBJ_TYPE_REF \
671 666Index: gcc-4_5-branch/gcc/gimple.h
672=== modified file 'gcc/gimple.h' 667===================================================================
673--- old/gcc/gimple.h 2010-08-10 13:31:21 +0000 668--- gcc-4_5-branch.orig/gcc/gimple.h 2011-07-22 16:59:12.000000000 -0700
674+++ new/gcc/gimple.h 2010-09-16 09:15:46 +0000 669+++ gcc-4_5-branch/gcc/gimple.h 2011-07-22 16:59:28.591747691 -0700
675@@ -80,6 +80,7 @@ 670@@ -80,6 +80,7 @@
676 enum gimple_rhs_class 671 enum gimple_rhs_class
677 { 672 {
@@ -774,10 +769,10 @@
774 /* Returns true if GS is a nontemporal move. */ 769 /* Returns true if GS is a nontemporal move. */
775 770
776 static inline bool 771 static inline bool
777 772Index: gcc-4_5-branch/gcc/optabs.c
778=== modified file 'gcc/optabs.c' 773===================================================================
779--- old/gcc/optabs.c 2010-03-19 19:45:01 +0000 774--- gcc-4_5-branch.orig/gcc/optabs.c 2011-07-22 16:58:48.000000000 -0700
780+++ new/gcc/optabs.c 2010-09-16 09:15:46 +0000 775+++ gcc-4_5-branch/gcc/optabs.c 2011-07-22 16:59:28.601747691 -0700
781@@ -408,6 +408,20 @@ 776@@ -408,6 +408,20 @@
782 case DOT_PROD_EXPR: 777 case DOT_PROD_EXPR:
783 return TYPE_UNSIGNED (type) ? udot_prod_optab : sdot_prod_optab; 778 return TYPE_UNSIGNED (type) ? udot_prod_optab : sdot_prod_optab;
@@ -813,21 +808,21 @@
813 gcc_assert (icode != CODE_FOR_nothing); 808 gcc_assert (icode != CODE_FOR_nothing);
814 xmode0 = insn_data[icode].operand[1].mode; 809 xmode0 = insn_data[icode].operand[1].mode;
815 810
816 811Index: gcc-4_5-branch/gcc/testsuite/gcc.target/arm/wmul-1.c
817=== modified file 'gcc/testsuite/gcc.target/arm/wmul-1.c' 812===================================================================
818--- old/gcc/testsuite/gcc.target/arm/wmul-1.c 2010-09-01 13:29:58 +0000 813--- gcc-4_5-branch.orig/gcc/testsuite/gcc.target/arm/wmul-1.c 2011-07-22 16:59:24.000000000 -0700
819+++ new/gcc/testsuite/gcc.target/arm/wmul-1.c 2010-09-16 09:15:46 +0000 814+++ gcc-4_5-branch/gcc/testsuite/gcc.target/arm/wmul-1.c 2011-07-22 16:59:28.601747691 -0700
820@@ -15,4 +15,4 @@ 815@@ -15,4 +15,4 @@
821 return sqr; 816 return sqr;
822 } 817 }
823 818
824-/* { dg-final { scan-assembler-times "smulbb" 2 } } */ 819-/* { dg-final { scan-assembler-times "smulbb" 2 } } */
825+/* { dg-final { scan-assembler-times "smlabb" 2 } } */ 820+/* { dg-final { scan-assembler-times "smlabb" 2 } } */
826 821Index: gcc-4_5-branch/gcc/tree-cfg.c
827=== modified file 'gcc/tree-cfg.c' 822===================================================================
828--- old/gcc/tree-cfg.c 2010-09-01 13:29:58 +0000 823--- gcc-4_5-branch.orig/gcc/tree-cfg.c 2011-07-22 16:59:24.000000000 -0700
829+++ new/gcc/tree-cfg.c 2010-09-16 09:15:46 +0000 824+++ gcc-4_5-branch/gcc/tree-cfg.c 2011-07-22 16:59:28.601747691 -0700
830@@ -3483,6 +3483,65 @@ 825@@ -3484,6 +3484,65 @@
831 return false; 826 return false;
832 } 827 }
833 828
@@ -893,7 +888,7 @@
893 /* Verify a gimple assignment statement STMT with a single rhs. 888 /* Verify a gimple assignment statement STMT with a single rhs.
894 Returns true if anything is wrong. */ 889 Returns true if anything is wrong. */
895 890
896@@ -3615,6 +3674,9 @@ 891@@ -3616,6 +3675,9 @@
897 case GIMPLE_BINARY_RHS: 892 case GIMPLE_BINARY_RHS:
898 return verify_gimple_assign_binary (stmt); 893 return verify_gimple_assign_binary (stmt);
899 894
@@ -903,11 +898,11 @@
903 default: 898 default:
904 gcc_unreachable (); 899 gcc_unreachable ();
905 } 900 }
906 901Index: gcc-4_5-branch/gcc/tree-inline.c
907=== modified file 'gcc/tree-inline.c' 902===================================================================
908--- old/gcc/tree-inline.c 2010-09-01 13:29:58 +0000 903--- gcc-4_5-branch.orig/gcc/tree-inline.c 2011-07-22 16:59:24.000000000 -0700
909+++ new/gcc/tree-inline.c 2010-09-16 09:15:46 +0000 904+++ gcc-4_5-branch/gcc/tree-inline.c 2011-07-22 16:59:28.601747691 -0700
910@@ -3199,6 +3199,8 @@ 905@@ -3207,6 +3207,8 @@
911 case WIDEN_SUM_EXPR: 906 case WIDEN_SUM_EXPR:
912 case WIDEN_MULT_EXPR: 907 case WIDEN_MULT_EXPR:
913 case DOT_PROD_EXPR: 908 case DOT_PROD_EXPR:
@@ -916,10 +911,10 @@
916 911
917 case VEC_WIDEN_MULT_HI_EXPR: 912 case VEC_WIDEN_MULT_HI_EXPR:
918 case VEC_WIDEN_MULT_LO_EXPR: 913 case VEC_WIDEN_MULT_LO_EXPR:
919 914Index: gcc-4_5-branch/gcc/tree-pretty-print.c
920=== modified file 'gcc/tree-pretty-print.c' 915===================================================================
921--- old/gcc/tree-pretty-print.c 2009-11-30 10:36:54 +0000 916--- gcc-4_5-branch.orig/gcc/tree-pretty-print.c 2011-07-22 16:58:48.000000000 -0700
922+++ new/gcc/tree-pretty-print.c 2010-09-16 09:15:46 +0000 917+++ gcc-4_5-branch/gcc/tree-pretty-print.c 2011-07-22 16:59:28.611747691 -0700
923@@ -1939,6 +1939,26 @@ 918@@ -1939,6 +1939,26 @@
924 pp_string (buffer, " > "); 919 pp_string (buffer, " > ");
925 break; 920 break;
@@ -956,10 +951,10 @@
956 case MULT_EXPR: 951 case MULT_EXPR:
957 case TRUNC_DIV_EXPR: 952 case TRUNC_DIV_EXPR:
958 case CEIL_DIV_EXPR: 953 case CEIL_DIV_EXPR:
959 954Index: gcc-4_5-branch/gcc/tree-ssa-ccp.c
960=== modified file 'gcc/tree-ssa-ccp.c' 955===================================================================
961--- old/gcc/tree-ssa-ccp.c 2010-08-10 13:31:21 +0000 956--- gcc-4_5-branch.orig/gcc/tree-ssa-ccp.c 2011-07-22 16:59:12.000000000 -0700
962+++ new/gcc/tree-ssa-ccp.c 2010-09-16 09:15:46 +0000 957+++ gcc-4_5-branch/gcc/tree-ssa-ccp.c 2011-07-22 16:59:28.611747691 -0700
963@@ -915,6 +915,23 @@ 958@@ -915,6 +915,23 @@
964 TREE_TYPE (TREE_OPERAND (addr, 0)))); 959 TREE_TYPE (TREE_OPERAND (addr, 0))));
965 } 960 }
@@ -1079,10 +1074,10 @@
1079 case GIMPLE_INVALID_RHS: 1074 case GIMPLE_INVALID_RHS:
1080 gcc_unreachable (); 1075 gcc_unreachable ();
1081 } 1076 }
1082 1077Index: gcc-4_5-branch/gcc/tree-ssa-dom.c
1083=== modified file 'gcc/tree-ssa-dom.c' 1078===================================================================
1084--- old/gcc/tree-ssa-dom.c 2010-07-20 11:44:16 +0000 1079--- gcc-4_5-branch.orig/gcc/tree-ssa-dom.c 2011-07-22 16:58:48.000000000 -0700
1085+++ new/gcc/tree-ssa-dom.c 2010-09-16 09:15:46 +0000 1080+++ gcc-4_5-branch/gcc/tree-ssa-dom.c 2011-07-22 17:23:51.501747355 -0700
1086@@ -54,6 +54,7 @@ 1081@@ -54,6 +54,7 @@
1087 EXPR_SINGLE, 1082 EXPR_SINGLE,
1088 EXPR_UNARY, 1083 EXPR_UNARY,
@@ -1101,58 +1096,31 @@
1101 struct { tree fn; bool pure; size_t nargs; tree *args; } call; 1096 struct { tree fn; bool pure; size_t nargs; tree *args; } call;
1102 } ops; 1097 } ops;
1103 }; 1098 };
1104@@ -214,22 +216,30 @@ 1099@@ -229,6 +231,14 @@
1105 switch (get_gimple_rhs_class (subcode)) 1100 expr->ops.binary.opnd0 = gimple_assign_rhs1 (stmt);
1106 { 1101 expr->ops.binary.opnd1 = gimple_assign_rhs2 (stmt);
1107 case GIMPLE_SINGLE_RHS: 1102 break;
1108- expr->kind = EXPR_SINGLE;
1109- expr->ops.single.rhs = gimple_assign_rhs1 (stmt);
1110- break;
1111+ expr->kind = EXPR_SINGLE;
1112+ expr->ops.single.rhs = gimple_assign_rhs1 (stmt);
1113+ break;
1114 case GIMPLE_UNARY_RHS:
1115- expr->kind = EXPR_UNARY;
1116+ expr->kind = EXPR_UNARY;
1117 expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
1118- expr->ops.unary.op = subcode;
1119- expr->ops.unary.opnd = gimple_assign_rhs1 (stmt);
1120- break;
1121+ expr->ops.unary.op = subcode;
1122+ expr->ops.unary.opnd = gimple_assign_rhs1 (stmt);
1123+ break;
1124 case GIMPLE_BINARY_RHS:
1125- expr->kind = EXPR_BINARY;
1126- expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
1127- expr->ops.binary.op = subcode;
1128- expr->ops.binary.opnd0 = gimple_assign_rhs1 (stmt);
1129- expr->ops.binary.opnd1 = gimple_assign_rhs2 (stmt);
1130- break;
1131+ expr->kind = EXPR_BINARY;
1132+ expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
1133+ expr->ops.binary.op = subcode;
1134+ expr->ops.binary.opnd0 = gimple_assign_rhs1 (stmt);
1135+ expr->ops.binary.opnd1 = gimple_assign_rhs2 (stmt);
1136+ break;
1137+ case GIMPLE_TERNARY_RHS: 1103+ case GIMPLE_TERNARY_RHS:
1138+ expr->kind = EXPR_TERNARY; 1104+ expr->kind = EXPR_TERNARY;
1139+ expr->type = TREE_TYPE (gimple_assign_lhs (stmt)); 1105+ expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
1140+ expr->ops.ternary.op = subcode; 1106+ expr->ops.ternary.op = subcode;
1141+ expr->ops.ternary.opnd0 = gimple_assign_rhs1 (stmt); 1107+ expr->ops.ternary.opnd0 = gimple_assign_rhs1 (stmt);
1142+ expr->ops.ternary.opnd1 = gimple_assign_rhs2 (stmt); 1108+ expr->ops.ternary.opnd1 = gimple_assign_rhs2 (stmt);
1143+ expr->ops.ternary.opnd2 = gimple_assign_rhs3 (stmt); 1109+ expr->ops.ternary.opnd2 = gimple_assign_rhs3 (stmt);
1144+ break; 1110+ break;
1145 default: 1111 default:
1146 gcc_unreachable (); 1112 gcc_unreachable ();
1147 } 1113 }
1148@@ -374,23 +384,40 @@ 1114@@ -373,23 +383,40 @@
1149 expr1->ops.unary.opnd, 0); 1115 expr1->ops.unary.opnd, 0);
1150 1116
1151 case EXPR_BINARY: 1117 case EXPR_BINARY:
1152- { 1118- {
1153- if (expr0->ops.binary.op != expr1->ops.binary.op) 1119- if (expr0->ops.binary.op != expr1->ops.binary.op)
1154- return false; 1120- return false;
1155- 1121+ if (expr0->ops.binary.op != expr1->ops.binary.op)
1122+ return false;
1123
1156- if (operand_equal_p (expr0->ops.binary.opnd0, 1124- if (operand_equal_p (expr0->ops.binary.opnd0,
1157- expr1->ops.binary.opnd0, 0) 1125- expr1->ops.binary.opnd0, 0)
1158- && operand_equal_p (expr0->ops.binary.opnd1, 1126- && operand_equal_p (expr0->ops.binary.opnd1,
@@ -1166,9 +1134,6 @@
1166- && operand_equal_p (expr0->ops.binary.opnd1, 1134- && operand_equal_p (expr0->ops.binary.opnd1,
1167- expr1->ops.binary.opnd0, 0)); 1135- expr1->ops.binary.opnd0, 0));
1168- } 1136- }
1169+ if (expr0->ops.binary.op != expr1->ops.binary.op)
1170+ return false;
1171+
1172+ if (operand_equal_p (expr0->ops.binary.opnd0, 1137+ if (operand_equal_p (expr0->ops.binary.opnd0,
1173+ expr1->ops.binary.opnd0, 0) 1138+ expr1->ops.binary.opnd0, 0)
1174+ && operand_equal_p (expr0->ops.binary.opnd1, 1139+ && operand_equal_p (expr0->ops.binary.opnd1,
@@ -1203,7 +1168,7 @@
1203 1168
1204 case EXPR_CALL: 1169 case EXPR_CALL:
1205 { 1170 {
1206@@ -453,8 +480,8 @@ 1171@@ -452,8 +479,8 @@
1207 case EXPR_BINARY: 1172 case EXPR_BINARY:
1208 val = iterative_hash_object (expr->ops.binary.op, val); 1173 val = iterative_hash_object (expr->ops.binary.op, val);
1209 if (commutative_tree_code (expr->ops.binary.op)) 1174 if (commutative_tree_code (expr->ops.binary.op))
@@ -1214,7 +1179,7 @@
1214 else 1179 else
1215 { 1180 {
1216 val = iterative_hash_expr (expr->ops.binary.opnd0, val); 1181 val = iterative_hash_expr (expr->ops.binary.opnd0, val);
1217@@ -462,6 +489,19 @@ 1182@@ -461,6 +488,19 @@
1218 } 1183 }
1219 break; 1184 break;
1220 1185
@@ -1234,7 +1199,7 @@
1234 case EXPR_CALL: 1199 case EXPR_CALL:
1235 { 1200 {
1236 size_t i; 1201 size_t i;
1237@@ -514,6 +554,16 @@ 1202@@ -513,6 +553,16 @@
1238 print_generic_expr (stream, element->expr.ops.binary.opnd1, 0); 1203 print_generic_expr (stream, element->expr.ops.binary.opnd1, 0);
1239 break; 1204 break;
1240 1205
@@ -1251,11 +1216,11 @@
1251 case EXPR_CALL: 1216 case EXPR_CALL:
1252 { 1217 {
1253 size_t i; 1218 size_t i;
1254 1219Index: gcc-4_5-branch/gcc/tree-ssa-math-opts.c
1255=== modified file 'gcc/tree-ssa-math-opts.c' 1220===================================================================
1256--- old/gcc/tree-ssa-math-opts.c 2010-09-01 13:29:58 +0000 1221--- gcc-4_5-branch.orig/gcc/tree-ssa-math-opts.c 2011-07-22 16:59:24.000000000 -0700
1257+++ new/gcc/tree-ssa-math-opts.c 2010-09-16 09:15:46 +0000 1222+++ gcc-4_5-branch/gcc/tree-ssa-math-opts.c 2011-07-22 16:59:28.611747691 -0700
1258@@ -1261,6 +1261,235 @@ 1223@@ -1270,6 +1270,235 @@
1259 } 1224 }
1260 }; 1225 };
1261 1226
@@ -1491,7 +1456,7 @@
1491 /* Find integer multiplications where the operands are extended from 1456 /* Find integer multiplications where the operands are extended from
1492 smaller types, and replace the MULT_EXPR with a WIDEN_MULT_EXPR 1457 smaller types, and replace the MULT_EXPR with a WIDEN_MULT_EXPR
1493 where appropriate. */ 1458 where appropriate. */
1494@@ -1278,94 +1507,19 @@ 1459@@ -1287,94 +1516,19 @@
1495 for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi)) 1460 for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
1496 { 1461 {
1497 gimple stmt = gsi_stmt (gsi); 1462 gimple stmt = gsi_stmt (gsi);
@@ -1499,11 +1464,13 @@
1499- tree type, type1 = NULL, type2 = NULL; 1464- tree type, type1 = NULL, type2 = NULL;
1500- tree rhs1, rhs2, rhs1_convop = NULL, rhs2_convop = NULL; 1465- tree rhs1, rhs2, rhs1_convop = NULL, rhs2_convop = NULL;
1501- enum tree_code rhs1_code, rhs2_code; 1466- enum tree_code rhs1_code, rhs2_code;
1502- 1467+ enum tree_code code;
1468
1503- if (!is_gimple_assign (stmt) 1469- if (!is_gimple_assign (stmt)
1504- || gimple_assign_rhs_code (stmt) != MULT_EXPR) 1470- || gimple_assign_rhs_code (stmt) != MULT_EXPR)
1505- continue; 1471+ if (!is_gimple_assign (stmt))
1506- 1472 continue;
1473
1507- type = TREE_TYPE (gimple_assign_lhs (stmt)); 1474- type = TREE_TYPE (gimple_assign_lhs (stmt));
1508- 1475-
1509- if (TREE_CODE (type) != INTEGER_TYPE) 1476- if (TREE_CODE (type) != INTEGER_TYPE)
@@ -1581,11 +1548,6 @@
1581- gimple_assign_set_rhs_code (stmt, WIDEN_MULT_EXPR); 1548- gimple_assign_set_rhs_code (stmt, WIDEN_MULT_EXPR);
1582- update_stmt (stmt); 1549- update_stmt (stmt);
1583- changed = true; 1550- changed = true;
1584+ enum tree_code code;
1585+
1586+ if (!is_gimple_assign (stmt))
1587+ continue;
1588+
1589+ code = gimple_assign_rhs_code (stmt); 1551+ code = gimple_assign_rhs_code (stmt);
1590+ if (code == MULT_EXPR) 1552+ if (code == MULT_EXPR)
1591+ changed |= convert_mult_to_widen (stmt); 1553+ changed |= convert_mult_to_widen (stmt);
@@ -1597,10 +1559,10 @@
1597 return (changed ? TODO_dump_func | TODO_update_ssa | TODO_verify_ssa 1559 return (changed ? TODO_dump_func | TODO_update_ssa | TODO_verify_ssa
1598 | TODO_verify_stmts : 0); 1560 | TODO_verify_stmts : 0);
1599 } 1561 }
1600 1562Index: gcc-4_5-branch/gcc/tree-ssa-operands.c
1601=== modified file 'gcc/tree-ssa-operands.c' 1563===================================================================
1602--- old/gcc/tree-ssa-operands.c 2010-04-02 18:54:46 +0000 1564--- gcc-4_5-branch.orig/gcc/tree-ssa-operands.c 2011-07-22 16:58:48.000000000 -0700
1603+++ new/gcc/tree-ssa-operands.c 2010-09-16 09:15:46 +0000 1565+++ gcc-4_5-branch/gcc/tree-ssa-operands.c 2011-07-22 16:59:28.611747691 -0700
1604@@ -994,11 +994,13 @@ 1566@@ -994,11 +994,13 @@
1605 1567
1606 case DOT_PROD_EXPR: 1568 case DOT_PROD_EXPR:
@@ -1618,11 +1580,11 @@
1618 } 1580 }
1619 1581
1620 case FUNCTION_DECL: 1582 case FUNCTION_DECL:
1621 1583Index: gcc-4_5-branch/gcc/tree-ssa-sccvn.c
1622=== modified file 'gcc/tree-ssa-sccvn.c' 1584===================================================================
1623--- old/gcc/tree-ssa-sccvn.c 2010-05-14 11:40:18 +0000 1585--- gcc-4_5-branch.orig/gcc/tree-ssa-sccvn.c 2011-07-22 16:58:48.000000000 -0700
1624+++ new/gcc/tree-ssa-sccvn.c 2010-09-16 09:15:46 +0000 1586+++ gcc-4_5-branch/gcc/tree-ssa-sccvn.c 2011-07-22 16:59:28.611747691 -0700
1625@@ -2277,6 +2277,10 @@ 1587@@ -2298,6 +2298,10 @@
1626 case GIMPLE_BINARY_RHS: 1588 case GIMPLE_BINARY_RHS:
1627 return (is_gimple_min_invariant (gimple_assign_rhs1 (stmt)) 1589 return (is_gimple_min_invariant (gimple_assign_rhs1 (stmt))
1628 || is_gimple_min_invariant (gimple_assign_rhs2 (stmt))); 1590 || is_gimple_min_invariant (gimple_assign_rhs2 (stmt)));
@@ -1633,10 +1595,10 @@
1633 case GIMPLE_SINGLE_RHS: 1595 case GIMPLE_SINGLE_RHS:
1634 /* Constants inside reference ops are rarely interesting, but 1596 /* Constants inside reference ops are rarely interesting, but
1635 it can take a lot of looking to find them. */ 1597 it can take a lot of looking to find them. */
1636 1598Index: gcc-4_5-branch/gcc/tree-ssa-threadedge.c
1637=== modified file 'gcc/tree-ssa-threadedge.c' 1599===================================================================
1638--- old/gcc/tree-ssa-threadedge.c 2009-11-25 10:55:54 +0000 1600--- gcc-4_5-branch.orig/gcc/tree-ssa-threadedge.c 2011-07-22 16:58:48.000000000 -0700
1639+++ new/gcc/tree-ssa-threadedge.c 2010-09-16 09:15:46 +0000 1601+++ gcc-4_5-branch/gcc/tree-ssa-threadedge.c 2011-07-22 16:59:28.611747691 -0700
1640@@ -247,14 +247,14 @@ 1602@@ -247,14 +247,14 @@
1641 1603
1642 return fold (rhs); 1604 return fold (rhs);
@@ -1672,10 +1634,10 @@
1672 default: 1634 default:
1673 gcc_unreachable (); 1635 gcc_unreachable ();
1674 } 1636 }
1675 1637Index: gcc-4_5-branch/gcc/tree-vrp.c
1676=== modified file 'gcc/tree-vrp.c' 1638===================================================================
1677--- old/gcc/tree-vrp.c 2010-06-14 14:23:31 +0000 1639--- gcc-4_5-branch.orig/gcc/tree-vrp.c 2011-07-22 16:58:48.000000000 -0700
1678+++ new/gcc/tree-vrp.c 2010-09-16 09:15:46 +0000 1640+++ gcc-4_5-branch/gcc/tree-vrp.c 2011-07-22 16:59:28.621747691 -0700
1679@@ -864,6 +864,8 @@ 1641@@ -864,6 +864,8 @@
1680 gimple_assign_rhs1 (stmt), 1642 gimple_assign_rhs1 (stmt),
1681 gimple_assign_rhs2 (stmt), 1643 gimple_assign_rhs2 (stmt),
@@ -1694,11 +1656,11 @@
1694 case GIMPLE_SINGLE_RHS: 1656 case GIMPLE_SINGLE_RHS:
1695 return tree_single_nonzero_warnv_p (gimple_assign_rhs1 (stmt), 1657 return tree_single_nonzero_warnv_p (gimple_assign_rhs1 (stmt),
1696 strict_overflow_p); 1658 strict_overflow_p);
1697 1659Index: gcc-4_5-branch/gcc/tree.c
1698=== modified file 'gcc/tree.c' 1660===================================================================
1699--- old/gcc/tree.c 2010-08-10 13:31:21 +0000 1661--- gcc-4_5-branch.orig/gcc/tree.c 2011-07-22 16:59:13.000000000 -0700
1700+++ new/gcc/tree.c 2010-09-16 09:15:46 +0000 1662+++ gcc-4_5-branch/gcc/tree.c 2011-07-22 16:59:28.621747691 -0700
1701@@ -6538,6 +6538,23 @@ 1663@@ -6548,6 +6548,23 @@
1702 return false; 1664 return false;
1703 } 1665 }
1704 1666
@@ -1722,10 +1684,10 @@
1722 /* Generate a hash value for an expression. This can be used iteratively 1684 /* Generate a hash value for an expression. This can be used iteratively
1723 by passing a previous result as the VAL argument. 1685 by passing a previous result as the VAL argument.
1724 1686
1725 1687Index: gcc-4_5-branch/gcc/tree.def
1726=== modified file 'gcc/tree.def' 1688===================================================================
1727--- old/gcc/tree.def 2010-04-02 18:54:46 +0000 1689--- gcc-4_5-branch.orig/gcc/tree.def 2011-07-22 16:58:48.000000000 -0700
1728+++ new/gcc/tree.def 2010-09-16 09:15:46 +0000 1690+++ gcc-4_5-branch/gcc/tree.def 2011-07-22 16:59:28.631747691 -0700
1729@@ -1083,6 +1083,18 @@ 1691@@ -1083,6 +1083,18 @@
1730 the arguments from type t1 to type t2, and then multiplying them. */ 1692 the arguments from type t1 to type t2, and then multiplying them. */
1731 DEFTREECODE (WIDEN_MULT_EXPR, "widen_mult_expr", tcc_binary, 2) 1693 DEFTREECODE (WIDEN_MULT_EXPR, "widen_mult_expr", tcc_binary, 2)
@@ -1745,11 +1707,11 @@
1745 /* Whole vector left/right shift in bits. 1707 /* Whole vector left/right shift in bits.
1746 Operand 0 is a vector to be shifted. 1708 Operand 0 is a vector to be shifted.
1747 Operand 1 is an integer shift amount in bits. */ 1709 Operand 1 is an integer shift amount in bits. */
1748 1710Index: gcc-4_5-branch/gcc/tree.h
1749=== modified file 'gcc/tree.h' 1711===================================================================
1750--- old/gcc/tree.h 2010-08-10 13:31:21 +0000 1712--- gcc-4_5-branch.orig/gcc/tree.h 2011-07-22 16:59:13.000000000 -0700
1751+++ new/gcc/tree.h 2010-09-16 09:15:46 +0000 1713+++ gcc-4_5-branch/gcc/tree.h 2011-07-22 16:59:28.631747691 -0700
1752@@ -4705,6 +4705,7 @@ 1714@@ -4687,6 +4687,7 @@
1753 extern int type_num_arguments (const_tree); 1715 extern int type_num_arguments (const_tree);
1754 extern bool associative_tree_code (enum tree_code); 1716 extern bool associative_tree_code (enum tree_code);
1755 extern bool commutative_tree_code (enum tree_code); 1717 extern bool commutative_tree_code (enum tree_code);
@@ -1757,4 +1719,3 @@
1757 extern tree upper_bound_in_type (tree, tree); 1719 extern tree upper_bound_in_type (tree, tree);
1758 extern tree lower_bound_in_type (tree, tree); 1720 extern tree lower_bound_in_type (tree, tree);
1759 extern int operand_equal_for_phi_arg_p (const_tree, const_tree); 1721 extern int operand_equal_for_phi_arg_p (const_tree, const_tree);
1760
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99436.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99436.patch
index deb749efc..1373b83ed 100644
--- a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99436.patch
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99436.patch
@@ -6,8 +6,10 @@
6 (try_combine, simplify_if_then_else): Update. 6 (try_combine, simplify_if_then_else): Update.
7 7
8=== modified file 'gcc/combine.c' 8=== modified file 'gcc/combine.c'
9--- old/gcc/combine.c 2010-11-04 12:39:28 +0000 9Index: gcc-4_5-branch/gcc/combine.c
10+++ new/gcc/combine.c 2010-11-25 11:11:45 +0000 10===================================================================
11--- gcc-4_5-branch.orig/gcc/combine.c 2011-07-22 17:24:46.000000000 -0700
12+++ gcc-4_5-branch/gcc/combine.c 2011-07-22 17:34:41.961747206 -0700
11@@ -392,8 +392,8 @@ 13@@ -392,8 +392,8 @@
12 static void undo_all (void); 14 static void undo_all (void);
13 static void undo_commit (void); 15 static void undo_commit (void);
@@ -19,7 +21,7 @@
19 static rtx simplify_if_then_else (rtx); 21 static rtx simplify_if_then_else (rtx);
20 static rtx simplify_set (rtx); 22 static rtx simplify_set (rtx);
21 static rtx simplify_logical (rtx); 23 static rtx simplify_logical (rtx);
22@@ -2944,12 +2944,12 @@ 24@@ -2962,12 +2962,12 @@
23 if (i1) 25 if (i1)
24 { 26 {
25 subst_low_luid = DF_INSN_LUID (i1); 27 subst_low_luid = DF_INSN_LUID (i1);
@@ -34,7 +36,7 @@
34 } 36 }
35 } 37 }
36 38
37@@ -2960,7 +2960,7 @@ 39@@ -2978,7 +2978,7 @@
38 to avoid self-referential rtl. */ 40 to avoid self-referential rtl. */
39 41
40 subst_low_luid = DF_INSN_LUID (i2); 42 subst_low_luid = DF_INSN_LUID (i2);
@@ -43,7 +45,7 @@
43 ! i1_feeds_i3 && i1dest_in_i1src); 45 ! i1_feeds_i3 && i1dest_in_i1src);
44 substed_i2 = 1; 46 substed_i2 = 1;
45 47
46@@ -2991,7 +2991,7 @@ 48@@ -3009,7 +3009,7 @@
47 49
48 n_occurrences = 0; 50 n_occurrences = 0;
49 subst_low_luid = DF_INSN_LUID (i1); 51 subst_low_luid = DF_INSN_LUID (i1);
@@ -52,7 +54,7 @@
52 substed_i1 = 1; 54 substed_i1 = 1;
53 } 55 }
54 56
55@@ -3053,7 +3053,7 @@ 57@@ -3071,7 +3071,7 @@
56 else 58 else
57 /* See comment where i2pat is assigned. */ 59 /* See comment where i2pat is assigned. */
58 XVECEXP (newpat, 0, --total_sets) 60 XVECEXP (newpat, 0, --total_sets)
@@ -61,7 +63,7 @@
61 } 63 }
62 } 64 }
63 65
64@@ -4605,11 +4605,13 @@ 66@@ -4623,11 +4623,13 @@
65 67
66 IN_DEST is nonzero if we are processing the SET_DEST of a SET. 68 IN_DEST is nonzero if we are processing the SET_DEST of a SET.
67 69
@@ -76,7 +78,7 @@
76 { 78 {
77 enum rtx_code code = GET_CODE (x); 79 enum rtx_code code = GET_CODE (x);
78 enum machine_mode op0_mode = VOIDmode; 80 enum machine_mode op0_mode = VOIDmode;
79@@ -4670,7 +4672,7 @@ 81@@ -4688,7 +4690,7 @@
80 && GET_CODE (XVECEXP (x, 0, 0)) == SET 82 && GET_CODE (XVECEXP (x, 0, 0)) == SET
81 && GET_CODE (SET_SRC (XVECEXP (x, 0, 0))) == ASM_OPERANDS) 83 && GET_CODE (SET_SRC (XVECEXP (x, 0, 0))) == ASM_OPERANDS)
82 { 84 {
@@ -85,7 +87,7 @@
85 87
86 /* If this substitution failed, this whole thing fails. */ 88 /* If this substitution failed, this whole thing fails. */
87 if (GET_CODE (new_rtx) == CLOBBER 89 if (GET_CODE (new_rtx) == CLOBBER
88@@ -4687,7 +4689,7 @@ 90@@ -4705,7 +4707,7 @@
89 && GET_CODE (dest) != CC0 91 && GET_CODE (dest) != CC0
90 && GET_CODE (dest) != PC) 92 && GET_CODE (dest) != PC)
91 { 93 {
@@ -94,7 +96,7 @@
94 96
95 /* If this substitution failed, this whole thing fails. */ 97 /* If this substitution failed, this whole thing fails. */
96 if (GET_CODE (new_rtx) == CLOBBER 98 if (GET_CODE (new_rtx) == CLOBBER
97@@ -4733,8 +4735,8 @@ 99@@ -4751,8 +4753,8 @@
98 } 100 }
99 else 101 else
100 { 102 {
@@ -105,7 +107,7 @@
105 107
106 /* If this substitution failed, this whole thing 108 /* If this substitution failed, this whole thing
107 fails. */ 109 fails. */
108@@ -4811,7 +4813,9 @@ 110@@ -4829,7 +4831,9 @@
109 && (code == SUBREG || code == STRICT_LOW_PART 111 && (code == SUBREG || code == STRICT_LOW_PART
110 || code == ZERO_EXTRACT)) 112 || code == ZERO_EXTRACT))
111 || code == SET) 113 || code == SET)
@@ -116,7 +118,7 @@
116 118
117 /* If we found that we will have to reject this combination, 119 /* If we found that we will have to reject this combination,
118 indicate that by returning the CLOBBER ourselves, rather than 120 indicate that by returning the CLOBBER ourselves, rather than
119@@ -4868,7 +4872,7 @@ 121@@ -4886,7 +4890,7 @@
120 /* If X is sufficiently simple, don't bother trying to do anything 122 /* If X is sufficiently simple, don't bother trying to do anything
121 with it. */ 123 with it. */
122 if (code != CONST_INT && code != REG && code != CLOBBER) 124 if (code != CONST_INT && code != REG && code != CLOBBER)
@@ -125,7 +127,7 @@
125 127
126 if (GET_CODE (x) == code) 128 if (GET_CODE (x) == code)
127 break; 129 break;
128@@ -4888,10 +4892,12 @@ 130@@ -4906,10 +4910,12 @@
129 expression. 131 expression.
130 132
131 OP0_MODE is the original mode of XEXP (x, 0). IN_DEST is nonzero 133 OP0_MODE is the original mode of XEXP (x, 0). IN_DEST is nonzero
@@ -140,7 +142,7 @@
140 { 142 {
141 enum rtx_code code = GET_CODE (x); 143 enum rtx_code code = GET_CODE (x);
142 enum machine_mode mode = GET_MODE (x); 144 enum machine_mode mode = GET_MODE (x);
143@@ -4946,8 +4952,8 @@ 145@@ -4964,8 +4970,8 @@
144 false arms to store-flag values. Be careful to use copy_rtx 146 false arms to store-flag values. Be careful to use copy_rtx
145 here since true_rtx or false_rtx might share RTL with x as a 147 here since true_rtx or false_rtx might share RTL with x as a
146 result of the if_then_else_cond call above. */ 148 result of the if_then_else_cond call above. */
@@ -151,16 +153,16 @@
151 153
152 /* If true_rtx and false_rtx are not general_operands, an if_then_else 154 /* If true_rtx and false_rtx are not general_operands, an if_then_else
153 is unlikely to be simpler. */ 155 is unlikely to be simpler. */
154@@ -5291,7 +5297,7 @@ 156@@ -5309,7 +5315,7 @@
155 { 157 {
156 /* Try to simplify the expression further. */ 158 /* Try to simplify the expression further. */
157 rtx tor = simplify_gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); 159 rtx tor = simplify_gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1));
158- temp = combine_simplify_rtx (tor, mode, in_dest); 160- temp = combine_simplify_rtx (tor, VOIDmode, in_dest);
159+ temp = combine_simplify_rtx (tor, mode, in_dest, 0); 161+ temp = combine_simplify_rtx (tor, VOIDmode, in_dest, 0);
160 162
161 /* If we could, great. If not, do not go ahead with the IOR 163 /* If we could, great. If not, do not go ahead with the IOR
162 replacement, since PLUS appears in many special purpose 164 replacement, since PLUS appears in many special purpose
163@@ -5384,7 +5390,16 @@ 165@@ -5402,7 +5408,16 @@
164 ZERO_EXTRACT is indeed appropriate, it will be placed back by 166 ZERO_EXTRACT is indeed appropriate, it will be placed back by
165 the call to make_compound_operation in the SET case. */ 167 the call to make_compound_operation in the SET case. */
166 168
@@ -178,7 +180,7 @@
178 && new_code == NE && GET_MODE_CLASS (mode) == MODE_INT 180 && new_code == NE && GET_MODE_CLASS (mode) == MODE_INT
179 && op1 == const0_rtx 181 && op1 == const0_rtx
180 && mode == GET_MODE (op0) 182 && mode == GET_MODE (op0)
181@@ -5628,11 +5643,11 @@ 183@@ -5646,11 +5661,11 @@
182 if (reg_mentioned_p (from, true_rtx)) 184 if (reg_mentioned_p (from, true_rtx))
183 true_rtx = subst (known_cond (copy_rtx (true_rtx), true_code, 185 true_rtx = subst (known_cond (copy_rtx (true_rtx), true_code,
184 from, true_val), 186 from, true_val),
@@ -192,7 +194,7 @@
192 194
193 SUBST (XEXP (x, 1), swapped ? false_rtx : true_rtx); 195 SUBST (XEXP (x, 1), swapped ? false_rtx : true_rtx);
194 SUBST (XEXP (x, 2), swapped ? true_rtx : false_rtx); 196 SUBST (XEXP (x, 2), swapped ? true_rtx : false_rtx);
195@@ -5849,11 +5864,11 @@ 197@@ -5867,11 +5882,11 @@
196 { 198 {
197 temp = subst (simplify_gen_relational (true_code, m, VOIDmode, 199 temp = subst (simplify_gen_relational (true_code, m, VOIDmode,
198 cond_op0, cond_op1), 200 cond_op0, cond_op1),
@@ -206,4 +208,3 @@
206 temp = simplify_gen_binary (op, m, gen_lowpart (m, z), temp); 208 temp = simplify_gen_binary (op, m, gen_lowpart (m, z), temp);
207 209
208 if (extend_op != UNKNOWN) 210 if (extend_op != UNKNOWN)
209
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99519.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99519.patch
new file mode 100644
index 000000000..5337070af
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99519.patch
@@ -0,0 +1,25 @@
12011-07-01 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
2
3 Backport from mainline.
4 LP 744754
5 2011-04-17 Chung-Lin Tang <cltang@codesourcery.com>
6
7 * config/arm/arm.c (neon_struct_mem_operand):
8 Support POST_INC/PRE_DEC memory operands.
9
10=== modified file 'gcc/config/arm/arm.c'
11--- old/gcc/config/arm/arm.c 2011-05-11 14:47:14 +0000
12+++ new/gcc/config/arm/arm.c 2011-06-29 10:46:39 +0000
13@@ -9322,6 +9322,11 @@
14 if (GET_CODE (ind) == REG)
15 return arm_address_register_rtx_p (ind, 0);
16
17+ /* vldm/vstm allows POST_INC (ia) and PRE_DEC (db). */
18+ if (GET_CODE (ind) == POST_INC
19+ || GET_CODE (ind) == PRE_DEC)
20+ return arm_address_register_rtx_p (XEXP (ind, 0), 0);
21+
22 return FALSE;
23 }
24
25
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99521.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99521.patch
new file mode 100644
index 000000000..6d2d75bf9
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99521.patch
@@ -0,0 +1,166 @@
12011-07-08 Richard Sandiford <rdsandiford@googlemail.com>
2
3 gcc/
4 * builtins.c (get_object_alignment): Fix comment.
5 * fold-const.c (get_pointer_modulus_and_residue): Remove
6 allow_func_align. Use get_object_alignment.
7 (fold_binary_loc): Update caller.
8
92011-07-08 Richard Sandiford <rdsandiford@googlemail.com>
10
11 gcc/
12 Backport from mainline:
13
14 2011-06-29 Richard Sandiford <richard.sandiford@linaro.org>
15
16 PR tree-optimization/49545
17 * builtins.c (get_object_alignment_1): Update function comment.
18 Do not use DECL_ALIGN for functions, but test
19 TARGET_PTRMEMFUNC_VBIT_LOCATION instead.
20 * fold-const.c (get_pointer_modulus_and_residue): Don't check
21 for functions here.
22
23 gcc/testsuite/
24 Backport from mainline:
25
26 2011-06-29 Richard Sandiford <richard.sandiford@linaro.org>
27
28 * gcc.dg/torture/pr49169.c: Restrict to ARM and MIPS targets.
29
302011-07-08 Richard Sandiford <richard.sandiford@linaro.org>
31
32 gcc/
33 Backport from mainline:
34
35 2011-07-27 Richard Guenther <rguenther@suse.de>
36
37 PR tree-optimization/49169
38 * fold-const.c (get_pointer_modulus_and_residue): Don't rely on
39 the alignment of function decls.
40
41 gcc/testsuite/
42 Backport from mainline:
43
44 2011-07-27 Michael Hope <michael.hope@linaro.org>
45 Richard Sandiford <richard.sandiford@linaro.org>
46
47 PR tree-optimization/49169
48 * gcc.dg/torture/pr49169.c: New test.
49
50=== modified file 'gcc/builtins.c'
51--- old/gcc/builtins.c 2011-01-06 11:02:44 +0000
52+++ new/gcc/builtins.c 2011-06-29 09:59:48 +0000
53@@ -263,7 +263,14 @@
54
55 /* Return the alignment in bits of EXP, an object.
56 Don't return more than MAX_ALIGN no matter what, ALIGN is the inital
57- guessed alignment e.g. from type alignment. */
58+ guessed alignment e.g. from type alignment.
59+
60+ Note that the address (and thus the alignment) computed here is based
61+ on the address to which a symbol resolves, whereas DECL_ALIGN is based
62+ on the address at which an object is actually located. These two
63+ addresses are not always the same. For example, on ARM targets,
64+ the address &foo of a Thumb function foo() has the lowest bit set,
65+ whereas foo() itself starts on an even address. */
66
67 int
68 get_object_alignment (tree exp, unsigned int align, unsigned int max_align)
69@@ -327,7 +334,21 @@
70 exp = DECL_INITIAL (exp);
71 if (DECL_P (exp)
72 && TREE_CODE (exp) != LABEL_DECL)
73- align = MIN (inner, DECL_ALIGN (exp));
74+ {
75+ if (TREE_CODE (exp) == FUNCTION_DECL)
76+ {
77+ /* Function addresses can encode extra information besides their
78+ alignment. However, if TARGET_PTRMEMFUNC_VBIT_LOCATION
79+ allows the low bit to be used as a virtual bit, we know
80+ that the address itself must be 2-byte aligned. */
81+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn)
82+ align = 2 * BITS_PER_UNIT;
83+ else
84+ align = BITS_PER_UNIT;
85+ }
86+ else
87+ align = MIN (inner, DECL_ALIGN (exp));
88+ }
89 #ifdef CONSTANT_ALIGNMENT
90 else if (CONSTANT_CLASS_P (exp))
91 align = MIN (inner, (unsigned)CONSTANT_ALIGNMENT (exp, align));
92
93=== modified file 'gcc/fold-const.c'
94--- old/gcc/fold-const.c 2011-05-05 14:28:53 +0000
95+++ new/gcc/fold-const.c 2011-07-08 12:54:44 +0000
96@@ -10030,15 +10030,10 @@
97 0 <= N < M as is common. In general, the precise value of P is unknown.
98 M is chosen as large as possible such that constant N can be determined.
99
100- Returns M and sets *RESIDUE to N.
101-
102- If ALLOW_FUNC_ALIGN is true, do take functions' DECL_ALIGN_UNIT into
103- account. This is not always possible due to PR 35705.
104- */
105+ Returns M and sets *RESIDUE to N. */
106
107 static unsigned HOST_WIDE_INT
108-get_pointer_modulus_and_residue (tree expr, unsigned HOST_WIDE_INT *residue,
109- bool allow_func_align)
110+get_pointer_modulus_and_residue (tree expr, unsigned HOST_WIDE_INT *residue)
111 {
112 enum tree_code code;
113
114@@ -10068,9 +10063,8 @@
115 }
116 }
117
118- if (DECL_P (expr)
119- && (allow_func_align || TREE_CODE (expr) != FUNCTION_DECL))
120- return DECL_ALIGN_UNIT (expr);
121+ if (DECL_P (expr))
122+ return get_object_alignment (expr, BITS_PER_UNIT, ~0U) / BITS_PER_UNIT;
123 }
124 else if (code == POINTER_PLUS_EXPR)
125 {
126@@ -10080,8 +10074,7 @@
127
128 op0 = TREE_OPERAND (expr, 0);
129 STRIP_NOPS (op0);
130- modulus = get_pointer_modulus_and_residue (op0, residue,
131- allow_func_align);
132+ modulus = get_pointer_modulus_and_residue (op0, residue);
133
134 op1 = TREE_OPERAND (expr, 1);
135 STRIP_NOPS (op1);
136@@ -11801,8 +11794,7 @@
137 unsigned HOST_WIDE_INT modulus, residue;
138 unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (arg1);
139
140- modulus = get_pointer_modulus_and_residue (arg0, &residue,
141- integer_onep (arg1));
142+ modulus = get_pointer_modulus_and_residue (arg0, &residue);
143
144 /* This works because modulus is a power of 2. If this weren't the
145 case, we'd have to replace it by its greatest power-of-2
146
147=== added file 'gcc/testsuite/gcc.dg/torture/pr49169.c'
148--- old/gcc/testsuite/gcc.dg/torture/pr49169.c 1970-01-01 00:00:00 +0000
149+++ new/gcc/testsuite/gcc.dg/torture/pr49169.c 2011-06-29 09:59:48 +0000
150@@ -0,0 +1,15 @@
151+/* { dg-do compile { target { arm*-*-* || mips*-*-* } } } */
152+
153+#include <stdlib.h>
154+#include <stdint.h>
155+
156+int
157+main (void)
158+{
159+ void *p = main;
160+ if ((intptr_t) p & 1)
161+ abort ();
162+ return 0;
163+}
164+
165+/* { dg-final { scan-assembler "abort" } } */
166
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99522.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99522.patch
new file mode 100644
index 000000000..cdf44b118
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99522.patch
@@ -0,0 +1,210 @@
12011-07-11 Revital Eres <revital.eres@linaro.org>
2
3 Backport from mainline -r175091
4 gcc/
5 * modulo-sched.c (struct ps_insn): Remove row_rest_count field.
6 (struct partial_schedule): Add rows_length field.
7 (verify_partial_schedule): Check rows_length.
8 (ps_insert_empty_row): Handle rows_length.
9 (create_partial_schedule): Likewise.
10 (free_partial_schedule): Likewise.
11 (reset_partial_schedule): Likewise.
12 (create_ps_insn): Remove rest_count argument.
13 (remove_node_from_ps): Update rows_length.
14 (add_node_to_ps): Update rows_length and call create_ps_insn
15 without passing row_rest_count.
16 (rotate_partial_schedule): Update rows_length.
17
18=== modified file 'gcc/modulo-sched.c'
19--- old/gcc/modulo-sched.c 2011-05-13 16:16:22 +0000
20+++ new/gcc/modulo-sched.c 2011-07-04 11:39:09 +0000
21@@ -134,8 +134,6 @@
22 ps_insn_ptr next_in_row,
23 prev_in_row;
24
25- /* The number of nodes in the same row that come after this node. */
26- int row_rest_count;
27 };
28
29 /* Holds the partial schedule as an array of II rows. Each entry of the
30@@ -149,6 +147,12 @@
31 /* rows[i] points to linked list of insns scheduled in row i (0<=i<ii). */
32 ps_insn_ptr *rows;
33
34+ /* rows_length[i] holds the number of instructions in the row.
35+ It is used only (as an optimization) to back off quickly from
36+ trying to schedule a node in a full row; that is, to avoid running
37+ through futile DFA state transitions. */
38+ int *rows_length;
39+
40 /* The earliest absolute cycle of an insn in the partial schedule. */
41 int min_cycle;
42
43@@ -1907,6 +1911,7 @@
44 int ii = ps->ii;
45 int new_ii = ii + 1;
46 int row;
47+ int *rows_length_new;
48
49 verify_partial_schedule (ps, sched_nodes);
50
51@@ -1921,9 +1926,11 @@
52 rotate_partial_schedule (ps, PS_MIN_CYCLE (ps));
53
54 rows_new = (ps_insn_ptr *) xcalloc (new_ii, sizeof (ps_insn_ptr));
55+ rows_length_new = (int *) xcalloc (new_ii, sizeof (int));
56 for (row = 0; row < split_row; row++)
57 {
58 rows_new[row] = ps->rows[row];
59+ rows_length_new[row] = ps->rows_length[row];
60 ps->rows[row] = NULL;
61 for (crr_insn = rows_new[row];
62 crr_insn; crr_insn = crr_insn->next_in_row)
63@@ -1944,6 +1951,7 @@
64 for (row = split_row; row < ii; row++)
65 {
66 rows_new[row + 1] = ps->rows[row];
67+ rows_length_new[row + 1] = ps->rows_length[row];
68 ps->rows[row] = NULL;
69 for (crr_insn = rows_new[row + 1];
70 crr_insn; crr_insn = crr_insn->next_in_row)
71@@ -1965,6 +1973,8 @@
72 + (SMODULO (ps->max_cycle, ii) >= split_row ? 1 : 0);
73 free (ps->rows);
74 ps->rows = rows_new;
75+ free (ps->rows_length);
76+ ps->rows_length = rows_length_new;
77 ps->ii = new_ii;
78 gcc_assert (ps->min_cycle >= 0);
79
80@@ -2040,16 +2050,23 @@
81 ps_insn_ptr crr_insn;
82
83 for (row = 0; row < ps->ii; row++)
84- for (crr_insn = ps->rows[row]; crr_insn; crr_insn = crr_insn->next_in_row)
85- {
86- ddg_node_ptr u = crr_insn->node;
87-
88- gcc_assert (TEST_BIT (sched_nodes, u->cuid));
89- /* ??? Test also that all nodes of sched_nodes are in ps, perhaps by
90- popcount (sched_nodes) == number of insns in ps. */
91- gcc_assert (SCHED_TIME (u) >= ps->min_cycle);
92- gcc_assert (SCHED_TIME (u) <= ps->max_cycle);
93- }
94+ {
95+ int length = 0;
96+
97+ for (crr_insn = ps->rows[row]; crr_insn; crr_insn = crr_insn->next_in_row)
98+ {
99+ ddg_node_ptr u = crr_insn->node;
100+
101+ length++;
102+ gcc_assert (TEST_BIT (sched_nodes, u->cuid));
103+ /* ??? Test also that all nodes of sched_nodes are in ps, perhaps by
104+ popcount (sched_nodes) == number of insns in ps. */
105+ gcc_assert (SCHED_TIME (u) >= ps->min_cycle);
106+ gcc_assert (SCHED_TIME (u) <= ps->max_cycle);
107+ }
108+
109+ gcc_assert (ps->rows_length[row] == length);
110+ }
111 }
112
113
114@@ -2455,6 +2472,7 @@
115 {
116 partial_schedule_ptr ps = XNEW (struct partial_schedule);
117 ps->rows = (ps_insn_ptr *) xcalloc (ii, sizeof (ps_insn_ptr));
118+ ps->rows_length = (int *) xcalloc (ii, sizeof (int));
119 ps->ii = ii;
120 ps->history = history;
121 ps->min_cycle = INT_MAX;
122@@ -2493,6 +2511,7 @@
123 return;
124 free_ps_insns (ps);
125 free (ps->rows);
126+ free (ps->rows_length);
127 free (ps);
128 }
129
130@@ -2510,6 +2529,8 @@
131 ps->rows = (ps_insn_ptr *) xrealloc (ps->rows, new_ii
132 * sizeof (ps_insn_ptr));
133 memset (ps->rows, 0, new_ii * sizeof (ps_insn_ptr));
134+ ps->rows_length = (int *) xrealloc (ps->rows_length, new_ii * sizeof (int));
135+ memset (ps->rows_length, 0, new_ii * sizeof (int));
136 ps->ii = new_ii;
137 ps->min_cycle = INT_MAX;
138 ps->max_cycle = INT_MIN;
139@@ -2538,14 +2559,13 @@
140
141 /* Creates an object of PS_INSN and initializes it to the given parameters. */
142 static ps_insn_ptr
143-create_ps_insn (ddg_node_ptr node, int rest_count, int cycle)
144+create_ps_insn (ddg_node_ptr node, int cycle)
145 {
146 ps_insn_ptr ps_i = XNEW (struct ps_insn);
147
148 ps_i->node = node;
149 ps_i->next_in_row = NULL;
150 ps_i->prev_in_row = NULL;
151- ps_i->row_rest_count = rest_count;
152 ps_i->cycle = cycle;
153
154 return ps_i;
155@@ -2578,6 +2598,8 @@
156 if (ps_i->next_in_row)
157 ps_i->next_in_row->prev_in_row = ps_i->prev_in_row;
158 }
159+
160+ ps->rows_length[row] -= 1;
161 free (ps_i);
162 return true;
163 }
164@@ -2734,17 +2756,12 @@
165 sbitmap must_precede, sbitmap must_follow)
166 {
167 ps_insn_ptr ps_i;
168- int rest_count = 1;
169 int row = SMODULO (cycle, ps->ii);
170
171- if (ps->rows[row]
172- && ps->rows[row]->row_rest_count >= issue_rate)
173+ if (ps->rows_length[row] >= issue_rate)
174 return NULL;
175
176- if (ps->rows[row])
177- rest_count += ps->rows[row]->row_rest_count;
178-
179- ps_i = create_ps_insn (node, rest_count, cycle);
180+ ps_i = create_ps_insn (node, cycle);
181
182 /* Finds and inserts PS_I according to MUST_FOLLOW and
183 MUST_PRECEDE. */
184@@ -2754,6 +2771,7 @@
185 return NULL;
186 }
187
188+ ps->rows_length[row] += 1;
189 return ps_i;
190 }
191
192@@ -2909,11 +2927,16 @@
193 for (i = 0; i < backward_rotates; i++)
194 {
195 ps_insn_ptr first_row = ps->rows[0];
196+ int first_row_length = ps->rows_length[0];
197
198 for (row = 0; row < last_row; row++)
199- ps->rows[row] = ps->rows[row+1];
200+ {
201+ ps->rows[row] = ps->rows[row + 1];
202+ ps->rows_length[row] = ps->rows_length[row + 1];
203+ }
204
205 ps->rows[last_row] = first_row;
206+ ps->rows_length[last_row] = first_row_length;
207 }
208
209 ps->max_cycle -= start_cycle;
210
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99523.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99523.patch
new file mode 100644
index 000000000..64eb23777
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99523.patch
@@ -0,0 +1,119 @@
12011-07-14 Richard Sandiford <richard.sandiford@linaro.org>
2
3 Backport from mainline:
4 gcc/
5 2011-07-07 Richard Sandiford <richard.sandiford@linaro.org>
6
7 * reload1.c (choose_reload_regs): Use mode sizes to check whether
8 an old reload register completely defines the required value.
9
10 gcc/testsuite/
11 2011-07-07 Richard Sandiford <richard.sandiford@linaro.org>
12
13 * gcc.target/arm/neon-modes-3.c: New test.
14
15=== modified file 'gcc/reload1.c'
16--- old/gcc/reload1.c 2011-07-01 09:27:50 +0000
17+++ new/gcc/reload1.c 2011-07-11 10:05:08 +0000
18@@ -6449,6 +6449,8 @@
19
20 if (regno >= 0
21 && reg_last_reload_reg[regno] != 0
22+ && (GET_MODE_SIZE (GET_MODE (reg_last_reload_reg[regno]))
23+ >= GET_MODE_SIZE (mode) + byte)
24 #ifdef CANNOT_CHANGE_MODE_CLASS
25 /* Verify that the register it's in can be used in
26 mode MODE. */
27@@ -6460,24 +6462,12 @@
28 {
29 enum reg_class rclass = rld[r].rclass, last_class;
30 rtx last_reg = reg_last_reload_reg[regno];
31- enum machine_mode need_mode;
32
33 i = REGNO (last_reg);
34 i += subreg_regno_offset (i, GET_MODE (last_reg), byte, mode);
35 last_class = REGNO_REG_CLASS (i);
36
37- if (byte == 0)
38- need_mode = mode;
39- else
40- need_mode
41- = smallest_mode_for_size
42- (GET_MODE_BITSIZE (mode) + byte * BITS_PER_UNIT,
43- GET_MODE_CLASS (mode) == MODE_PARTIAL_INT
44- ? MODE_INT : GET_MODE_CLASS (mode));
45-
46- if ((GET_MODE_SIZE (GET_MODE (last_reg))
47- >= GET_MODE_SIZE (need_mode))
48- && reg_reloaded_contents[i] == regno
49+ if (reg_reloaded_contents[i] == regno
50 && TEST_HARD_REG_BIT (reg_reloaded_valid, i)
51 && HARD_REGNO_MODE_OK (i, rld[r].mode)
52 && (TEST_HARD_REG_BIT (reg_class_contents[(int) rclass], i)
53
54=== added file 'gcc/testsuite/gcc.target/arm/neon-modes-3.c'
55--- old/gcc/testsuite/gcc.target/arm/neon-modes-3.c 1970-01-01 00:00:00 +0000
56+++ new/gcc/testsuite/gcc.target/arm/neon-modes-3.c 2011-07-11 10:05:08 +0000
57@@ -0,0 +1,61 @@
58+/* { dg-do compile } */
59+/* { dg-require-effective-target arm_neon_ok } */
60+/* { dg-options "-O" } */
61+/* { dg-add-options arm_neon } */
62+
63+#include <arm_neon.h>
64+
65+void f1 (volatile float32x4_t *dest, volatile float32x4x4_t *src, int n)
66+{
67+ float32x4x4_t a5, a6, a7, a8, a9;
68+ int i;
69+
70+ a5 = *src;
71+ a6 = *src;
72+ a7 = *src;
73+ a8 = *src;
74+ a9 = *src;
75+ while (n--)
76+ {
77+ for (i = 0; i < 8; i++)
78+ {
79+ float32x4x4_t a0, a1, a2, a3, a4;
80+
81+ a0 = *src;
82+ a1 = *src;
83+ a2 = *src;
84+ a3 = *src;
85+ a4 = *src;
86+ *src = a0;
87+ *dest = a0.val[0];
88+ *dest = a0.val[3];
89+ *src = a1;
90+ *dest = a1.val[0];
91+ *dest = a1.val[3];
92+ *src = a2;
93+ *dest = a2.val[0];
94+ *dest = a2.val[3];
95+ *src = a3;
96+ *dest = a3.val[0];
97+ *dest = a3.val[3];
98+ *src = a4;
99+ *dest = a4.val[0];
100+ *dest = a4.val[3];
101+ }
102+ *src = a5;
103+ *dest = a5.val[0];
104+ *dest = a5.val[3];
105+ *src = a6;
106+ *dest = a6.val[0];
107+ *dest = a6.val[3];
108+ *src = a7;
109+ *dest = a7.val[0];
110+ *dest = a7.val[3];
111+ *src = a8;
112+ *dest = a8.val[0];
113+ *dest = a8.val[3];
114+ *src = a9;
115+ *dest = a9.val[0];
116+ *dest = a9.val[3];
117+ }
118+}
119
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99524.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99524.patch
new file mode 100644
index 000000000..2e8e12d2a
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99524.patch
@@ -0,0 +1,209 @@
1 2011-07-14 Richard Sandiford <richard.sandiford@linaro.org>
2
3 gcc/
4 * config/arm/arm.h (ARM_LEGITIMIZE_RELOAD_ADDRESS): Apply the
5 arm_legitimize_reload_address changes marked [*] below.
6
7 Backport from mainline:
8
9 2011-04-20 Chung-Lin Tang <cltang@codesourcery.com>
10
11 [*] config/arm/arm.c (arm_legitimize_reload_address): For NEON
12 quad-word modes, reduce to 9-bit index range when above 1016
13 limit.
14
15 2011-04-11 Chung-Lin Tang <cltang@codesourcery.com>
16 Richard Earnshaw <rearnsha@arm.com>
17
18 PR target/48250
19 [*] config/arm/arm.c (arm_legitimize_reload_address): Update cases
20 to use sign-magnitude offsets. Reject unsupported unaligned
21 cases. Add detailed description in comments.
22 * config/arm/arm.md (reload_outdf): Disable for ARM mode; change
23 condition from TARGET_32BIT to TARGET_ARM.
24
25=== modified file 'gcc/config/arm/arm.h'
26--- old/gcc/config/arm/arm.h 2011-04-20 10:07:36 +0000
27+++ new/gcc/config/arm/arm.h 2011-07-12 16:35:20 +0000
28@@ -1399,6 +1399,11 @@
29 ? GENERAL_REGS : NO_REGS) \
30 : THUMB_SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X)))
31
32+#define SIGN_MAG_LOW_ADDR_BITS(VAL, N) \
33+ (((VAL) & ((1 << (N)) - 1)) \
34+ ? (((VAL) & ((1 << ((N) + 1)) - 1)) ^ (1 << (N))) - (1 << (N)) \
35+ : 0)
36+
37 /* Try a machine-dependent way of reloading an illegitimate address
38 operand. If we find one, push the reload and jump to WIN. This
39 macro is used in only one place: `find_reloads_address' in reload.c.
40@@ -1418,26 +1423,135 @@
41 HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
42 HOST_WIDE_INT low, high; \
43 \
44- if (MODE == DImode || (MODE == DFmode && TARGET_SOFT_FLOAT)) \
45- low = ((val & 0xf) ^ 0x8) - 0x8; \
46- else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \
47- /* Need to be careful, -256 is not a valid offset. */ \
48- low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
49- else if (TARGET_REALLY_IWMMXT && MODE == SImode) \
50- /* Need to be careful, -1024 is not a valid offset. */ \
51- low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
52- else if (MODE == SImode \
53- || (MODE == SFmode && TARGET_SOFT_FLOAT) \
54- || ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \
55- /* Need to be careful, -4096 is not a valid offset. */ \
56- low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff); \
57- else if ((MODE == HImode || MODE == QImode) && arm_arch4) \
58- /* Need to be careful, -256 is not a valid offset. */ \
59- low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
60- else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \
61- && TARGET_HARD_FLOAT && TARGET_FPA) \
62- /* Need to be careful, -1024 is not a valid offset. */ \
63- low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
64+ /* Detect coprocessor load/stores. */ \
65+ bool coproc_p = ((TARGET_HARD_FLOAT \
66+ && (TARGET_VFP || TARGET_FPA || TARGET_MAVERICK) \
67+ && (mode == SFmode || mode == DFmode \
68+ || (mode == DImode && TARGET_MAVERICK))) \
69+ || (TARGET_REALLY_IWMMXT \
70+ && VALID_IWMMXT_REG_MODE (mode)) \
71+ || (TARGET_NEON \
72+ && (VALID_NEON_DREG_MODE (mode) \
73+ || VALID_NEON_QREG_MODE (mode)))); \
74+ \
75+ /* For some conditions, bail out when lower two bits are \
76+ unaligned. */ \
77+ if ((val & 0x3) != 0 \
78+ /* Coprocessor load/store indexes are 8-bits + '00' \
79+ appended. */ \
80+ && (coproc_p \
81+ /* For DI, and DF under soft-float: */ \
82+ || ((mode == DImode || mode == DFmode) \
83+ /* Without ldrd, we use stm/ldm, which does not \
84+ fair well with unaligned bits. */ \
85+ && (! TARGET_LDRD \
86+ /* Thumb-2 ldrd/strd is [-1020,+1020] in \
87+ steps of 4. */ \
88+ || TARGET_THUMB2)))) \
89+ break; \
90+ \
91+ /* When breaking down a [reg+index] reload address into \
92+ [(reg+high)+low], of which the (reg+high) gets turned into \
93+ a reload add insn, we try to decompose the index into \
94+ high/low values that can often also lead to better reload \
95+ CSE. For example: \
96+ ldr r0, [r2, #4100] // Offset too large \
97+ ldr r1, [r2, #4104] // Offset too large \
98+ \
99+ is best reloaded as: \
100+ add t1, r2, #4096 \
101+ ldr r0, [t1, #4] \
102+ add t2, r2, #4096 \
103+ ldr r1, [t2, #8] \
104+ \
105+ which post-reload CSE can simplify in most cases to eliminate \
106+ the second add instruction: \
107+ add t1, r2, #4096 \
108+ ldr r0, [t1, #4] \
109+ ldr r1, [t1, #8] \
110+ \
111+ The idea here is that we want to split out the bits of the \
112+ constant as a mask, rather than as subtracting the maximum \
113+ offset that the respective type of load/store used can \
114+ handle. \
115+ \
116+ When encountering negative offsets, we can still utilize it \
117+ even if the overall offset is positive; sometimes this may \
118+ lead to an immediate that can be constructed with fewer \
119+ instructions. For example: \
120+ ldr r0, [r2, #0x3FFFFC] \
121+ \
122+ This is best reloaded as: \
123+ add t1, r2, #0x400000 \
124+ ldr r0, [t1, #-4] \
125+ \
126+ The trick for spotting this for a load insn with N bits of \
127+ offset (i.e. bits N-1:0) is to look at bit N; if it is set, \
128+ then chose a negative offset that is going to make bit N and \
129+ all the bits below it become zero in the remainder part. \
130+ \
131+ The SIGN_MAG_LOW_ADDR_BITS macro below implements this, \
132+ with respect to sign-magnitude addressing (i.e. separate \
133+ +- bit, or 1's complement), used in most cases of ARM \
134+ load/store instructions. */ \
135+ \
136+ if (coproc_p) \
137+ { \
138+ low = SIGN_MAG_LOW_ADDR_BITS (val, 10); \
139+ \
140+ /* NEON quad-word load/stores are made of two double-word \
141+ accesses, so the valid index range is reduced by 8. \
142+ Treat as 9-bit range if we go over it. */ \
143+ if (TARGET_NEON && VALID_NEON_QREG_MODE (mode) && low >= 1016) \
144+ low = SIGN_MAG_LOW_ADDR_BITS (val, 9); \
145+ } \
146+ else if (GET_MODE_SIZE (mode) == 8) \
147+ { \
148+ if (TARGET_LDRD) \
149+ low = (TARGET_THUMB2 \
150+ ? SIGN_MAG_LOW_ADDR_BITS (val, 10) \
151+ : SIGN_MAG_LOW_ADDR_BITS (val, 8)); \
152+ else \
153+ /* For pre-ARMv5TE (without ldrd), we use ldm/stm(db/da/ib) \
154+ to access doublewords. The supported load/store offsets \
155+ are -8, -4, and 4, which we try to produce here. */ \
156+ low = ((val & 0xf) ^ 0x8) - 0x8; \
157+ } \
158+ else if (GET_MODE_SIZE (mode) < 8) \
159+ { \
160+ /* NEON element load/stores do not have an offset. */ \
161+ if (TARGET_NEON_FP16 && mode == HFmode) \
162+ break; \
163+ \
164+ if (TARGET_THUMB2) \
165+ { \
166+ /* Thumb-2 has an asymmetrical index range of (-256,4096). \
167+ Try the wider 12-bit range first, and re-try if the \
168+ result is out of range. */ \
169+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12); \
170+ if (low < -255) \
171+ low = SIGN_MAG_LOW_ADDR_BITS (val, 8); \
172+ } \
173+ else \
174+ { \
175+ if (mode == HImode || mode == HFmode) \
176+ { \
177+ if (arm_arch4) \
178+ low = SIGN_MAG_LOW_ADDR_BITS (val, 8); \
179+ else \
180+ { \
181+ /* The storehi/movhi_bytes fallbacks can use \
182+ only [-4094,+4094] of the full ldrb/strb \
183+ index range. */ \
184+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12); \
185+ if (low == 4095 || low == -4095) \
186+ break; \
187+ } \
188+ } \
189+ else \
190+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12); \
191+ } \
192+ } \
193 else \
194 break; \
195 \
196
197=== modified file 'gcc/config/arm/arm.md'
198--- old/gcc/config/arm/arm.md 2011-04-28 16:13:24 +0000
199+++ new/gcc/config/arm/arm.md 2011-07-12 16:35:20 +0000
200@@ -6167,7 +6167,7 @@
201 [(match_operand:DF 0 "arm_reload_memory_operand" "=o")
202 (match_operand:DF 1 "s_register_operand" "r")
203 (match_operand:SI 2 "s_register_operand" "=&r")]
204- "TARGET_32BIT"
205+ "TARGET_THUMB2"
206 "
207 {
208 enum rtx_code code = GET_CODE (XEXP (operands[0], 0));
209
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99525.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99525.patch
new file mode 100644
index 000000000..560a830bf
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99525.patch
@@ -0,0 +1,67 @@
12011-07-15 Michael Hope <michael.hope@linaro.org>
2
3 gcc/
4 Backport from mainline:
5
6 2011-04-05 Eric Botcazou <ebotcazou@adacore.com>
7
8 * ifcvt.c (cond_exec_process_insns): Disallow converting a block
9 that contains the prologue.
10
11 gcc/testsuite/
12 Backport from mainline:
13
14 2011-04-01 Bernd Schmidt <bernds@codesourcery.com>
15
16 * gcc.c-torture/compile/20110401-1.c: New test.
17
18=== modified file 'gcc/ifcvt.c'
19--- old/gcc/ifcvt.c 2011-05-05 14:28:53 +0000
20+++ new/gcc/ifcvt.c 2011-07-11 04:08:33 +0000
21@@ -1,5 +1,6 @@
22 /* If-conversion support.
23- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
24+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010,
25+ 2011
26 Free Software Foundation, Inc.
27
28 This file is part of GCC.
29@@ -311,6 +312,10 @@
30
31 for (insn = start; ; insn = NEXT_INSN (insn))
32 {
33+ /* dwarf2out can't cope with conditional prologues. */
34+ if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_PROLOGUE_END)
35+ return FALSE;
36+
37 if (NOTE_P (insn) || DEBUG_INSN_P (insn))
38 goto insn_done;
39
40
41=== added file 'gcc/testsuite/gcc.c-torture/compile/20110401-1.c'
42--- old/gcc/testsuite/gcc.c-torture/compile/20110401-1.c 1970-01-01 00:00:00 +0000
43+++ new/gcc/testsuite/gcc.c-torture/compile/20110401-1.c 2011-07-11 04:08:33 +0000
44@@ -0,0 +1,22 @@
45+void asn1_length_der (unsigned long int len, unsigned char *ans, int *ans_len)
46+{
47+ int k;
48+ unsigned char temp[4];
49+ if (len < 128) {
50+ if (ans != ((void *) 0))
51+ ans[0] = (unsigned char) len;
52+ *ans_len = 1;
53+ } else {
54+ k = 0;
55+ while (len) {
56+ temp[k++] = len & 0xFF;
57+ len = len >> 8;
58+ }
59+ *ans_len = k + 1;
60+ if (ans != ((void *) 0)) {
61+ ans[0] = ((unsigned char) k & 0x7F) + 128;
62+ while (k--)
63+ ans[*ans_len - 1 - k] = temp[k];
64+ }
65+ }
66+}
67
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99528.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99528.patch
new file mode 100644
index 000000000..874358306
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99528.patch
@@ -0,0 +1,138 @@
12011-07-19 Revital Eres <revital.eres@linaro.org>
2
3 Backport from mainline -r175090
4 gcc/
5 * ddg.c (add_intra_loop_mem_dep): New function.
6 (build_intra_loop_deps): Call it.
7
8 gcc/testsuite
9 * gcc.dg/sms-9.c: New file.
10
11=== modified file 'gcc/ddg.c'
12--- old/gcc/ddg.c 2011-05-13 16:16:22 +0000
13+++ new/gcc/ddg.c 2011-07-05 09:02:18 +0000
14@@ -352,6 +352,33 @@
15 }
16
17
18+/* Given two nodes, analyze their RTL insns and add intra-loop mem deps
19+ to ddg G. */
20+static void
21+add_intra_loop_mem_dep (ddg_ptr g, ddg_node_ptr from, ddg_node_ptr to)
22+{
23+
24+ if ((from->cuid == to->cuid)
25+ || !insn_alias_sets_conflict_p (from->insn, to->insn))
26+ /* Do not create edge if memory references have disjoint alias sets
27+ or 'to' and 'from' are the same instruction. */
28+ return;
29+
30+ if (mem_write_insn_p (from->insn))
31+ {
32+ if (mem_read_insn_p (to->insn))
33+ create_ddg_dep_no_link (g, from, to,
34+ DEBUG_INSN_P (to->insn)
35+ ? ANTI_DEP : TRUE_DEP, MEM_DEP, 0);
36+ else
37+ create_ddg_dep_no_link (g, from, to,
38+ DEBUG_INSN_P (to->insn)
39+ ? ANTI_DEP : OUTPUT_DEP, MEM_DEP, 0);
40+ }
41+ else if (!mem_read_insn_p (to->insn))
42+ create_ddg_dep_no_link (g, from, to, ANTI_DEP, MEM_DEP, 0);
43+}
44+
45 /* Given two nodes, analyze their RTL insns and add inter-loop mem deps
46 to ddg G. */
47 static void
48@@ -439,10 +466,22 @@
49 if (DEBUG_INSN_P (j_node->insn))
50 continue;
51 if (mem_access_insn_p (j_node->insn))
52- /* Don't bother calculating inter-loop dep if an intra-loop dep
53- already exists. */
54+ {
55+ /* Don't bother calculating inter-loop dep if an intra-loop dep
56+ already exists. */
57 if (! TEST_BIT (dest_node->successors, j))
58 add_inter_loop_mem_dep (g, dest_node, j_node);
59+ /* If -fmodulo-sched-allow-regmoves
60+ is set certain anti-dep edges are not created.
61+ It might be that these anti-dep edges are on the
62+ path from one memory instruction to another such that
63+ removing these edges could cause a violation of the
64+ memory dependencies. Thus we add intra edges between
65+ every two memory instructions in this case. */
66+ if (flag_modulo_sched_allow_regmoves
67+ && !TEST_BIT (dest_node->predecessors, j))
68+ add_intra_loop_mem_dep (g, j_node, dest_node);
69+ }
70 }
71 }
72 }
73
74=== added file 'gcc/testsuite/gcc.dg/sms-9.c'
75--- old/gcc/testsuite/gcc.dg/sms-9.c 1970-01-01 00:00:00 +0000
76+++ new/gcc/testsuite/gcc.dg/sms-9.c 2011-07-04 11:13:26 +0000
77@@ -0,0 +1,60 @@
78+/* { dg-do run } */
79+/* { dg-options "-O2 -fmodulo-sched -fno-auto-inc-dec -O2 -fmodulo-sched-allow-regmoves" } */
80+
81+#include <stdlib.h>
82+#include <stdarg.h>
83+
84+struct df_ref_info
85+{
86+ unsigned int *begin;
87+ unsigned int *count;
88+};
89+
90+extern void *memset (void *s, int c, __SIZE_TYPE__ n);
91+
92+
93+__attribute__ ((noinline))
94+ int
95+ df_reorganize_refs_by_reg_by_insn (struct df_ref_info *ref_info,
96+ int num, unsigned int start)
97+{
98+ unsigned int m = num;
99+ unsigned int offset = 77;
100+ unsigned int r;
101+
102+ for (r = start; r < m; r++)
103+ {
104+ ref_info->begin[r] = offset;
105+ offset += ref_info->count[r];
106+ ref_info->count[r] = 0;
107+ }
108+
109+ return offset;
110+}
111+
112+int
113+main ()
114+{
115+ struct df_ref_info temp;
116+ int num = 100;
117+ unsigned int start = 5;
118+ int i, offset;
119+
120+ temp.begin = malloc (100 * sizeof (unsigned int));
121+ temp.count = malloc (100 * sizeof (unsigned int));
122+
123+ memset (temp.begin, 0, sizeof (unsigned int) * num);
124+ memset (temp.count, 0, sizeof (unsigned int) * num);
125+
126+ for (i = 0; i < num; i++)
127+ temp.count[i] = i + 1;
128+
129+ offset = df_reorganize_refs_by_reg_by_insn (&temp, num, start);
130+
131+ if (offset != 5112)
132+ abort ();
133+
134+ free (temp.begin);
135+ free (temp.count);
136+ return 0;
137+}
138
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99529.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99529.patch
new file mode 100644
index 000000000..f0f6a9432
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99529.patch
@@ -0,0 +1,741 @@
12011-07-21 Richard Sandiford <richard.sandiford@linaro.org>
2
3 gcc/
4 PR middle-end/49736
5 * expr.c (all_zeros_p): Undo bogus part of last change.
6
72011-07-21 Richard Sandiford <rdsandiford@googlemail.com>
8
9 Backport from mainline:
10 gcc/cp/
11 2011-07-13 Richard Sandiford <richard.sandiford@linaro.org>
12
13 * typeck2.c (split_nonconstant_init_1): Pass the initializer directly,
14 rather than a pointer to it. Return true if the whole of the value
15 was initialized by the generated statements. Use
16 complete_ctor_at_level_p instead of count_type_elements.
17
18 gcc/
19 2011-07-13 Richard Sandiford <richard.sandiford@linaro.org>
20
21 * tree.h (categorize_ctor_elements): Remove comment. Fix long line.
22 (count_type_elements): Delete.
23 (complete_ctor_at_level_p): Declare.
24 * expr.c (flexible_array_member_p): New function, split out from...
25 (count_type_elements): ...here. Make static. Replace allow_flexarr
26 parameter with for_ctor_p. When for_ctor_p is true, return the
27 number of elements that should appear in the top-level constructor,
28 otherwise return an estimate of the number of scalars.
29 (categorize_ctor_elements): Replace p_must_clear with p_complete.
30 (categorize_ctor_elements_1): Likewise. Use complete_ctor_at_level_p.
31 (complete_ctor_at_level_p): New function, borrowing union logic
32 from old categorize_ctor_elements_1.
33 (mostly_zeros_p): Return true if the constructor is not complete.
34 (all_zeros_p): Update call to categorize_ctor_elements.
35 * gimplify.c (gimplify_init_constructor): Update call to
36 categorize_ctor_elements. Don't call count_type_elements.
37 Unconditionally prevent clearing for variable-sized types,
38 otherwise rely on categorize_ctor_elements to detect
39 incomplete initializers.
40
41 gcc/testsuite/
42 2011-07-13 Chung-Lin Tang <cltang@codesourcery.com>
43
44 * gcc.target/arm/pr48183.c: New test.
45
46=== modified file 'gcc/cp/typeck2.c'
47--- old/gcc/cp/typeck2.c 2010-07-30 14:05:57 +0000
48+++ new/gcc/cp/typeck2.c 2011-07-13 13:36:36 +0000
49@@ -546,18 +546,20 @@
50
51
52 /* The recursive part of split_nonconstant_init. DEST is an lvalue
53- expression to which INIT should be assigned. INIT is a CONSTRUCTOR. */
54+ expression to which INIT should be assigned. INIT is a CONSTRUCTOR.
55+ Return true if the whole of the value was initialized by the
56+ generated statements. */
57
58-static void
59-split_nonconstant_init_1 (tree dest, tree *initp)
60+static bool
61+split_nonconstant_init_1 (tree dest, tree init)
62 {
63 unsigned HOST_WIDE_INT idx;
64- tree init = *initp;
65 tree field_index, value;
66 tree type = TREE_TYPE (dest);
67 tree inner_type = NULL;
68 bool array_type_p = false;
69- HOST_WIDE_INT num_type_elements, num_initialized_elements;
70+ bool complete_p = true;
71+ HOST_WIDE_INT num_split_elts = 0;
72
73 switch (TREE_CODE (type))
74 {
75@@ -569,7 +571,6 @@
76 case RECORD_TYPE:
77 case UNION_TYPE:
78 case QUAL_UNION_TYPE:
79- num_initialized_elements = 0;
80 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (init), idx,
81 field_index, value)
82 {
83@@ -592,13 +593,14 @@
84 sub = build3 (COMPONENT_REF, inner_type, dest, field_index,
85 NULL_TREE);
86
87- split_nonconstant_init_1 (sub, &value);
88+ if (!split_nonconstant_init_1 (sub, value))
89+ complete_p = false;
90+ num_split_elts++;
91 }
92 else if (!initializer_constant_valid_p (value, inner_type))
93 {
94 tree code;
95 tree sub;
96- HOST_WIDE_INT inner_elements;
97
98 /* FIXME: Ordered removal is O(1) so the whole function is
99 worst-case quadratic. This could be fixed using an aside
100@@ -622,21 +624,9 @@
101 code = build_stmt (input_location, EXPR_STMT, code);
102 add_stmt (code);
103
104- inner_elements = count_type_elements (inner_type, true);
105- if (inner_elements < 0)
106- num_initialized_elements = -1;
107- else if (num_initialized_elements >= 0)
108- num_initialized_elements += inner_elements;
109- continue;
110+ num_split_elts++;
111 }
112 }
113-
114- num_type_elements = count_type_elements (type, true);
115- /* If all elements of the initializer are non-constant and
116- have been split out, we don't need the empty CONSTRUCTOR. */
117- if (num_type_elements > 0
118- && num_type_elements == num_initialized_elements)
119- *initp = NULL;
120 break;
121
122 case VECTOR_TYPE:
123@@ -648,6 +638,7 @@
124 code = build2 (MODIFY_EXPR, type, dest, cons);
125 code = build_stmt (input_location, EXPR_STMT, code);
126 add_stmt (code);
127+ num_split_elts += CONSTRUCTOR_NELTS (init);
128 }
129 break;
130
131@@ -657,6 +648,8 @@
132
133 /* The rest of the initializer is now a constant. */
134 TREE_CONSTANT (init) = 1;
135+ return complete_p && complete_ctor_at_level_p (TREE_TYPE (init),
136+ num_split_elts, inner_type);
137 }
138
139 /* A subroutine of store_init_value. Splits non-constant static
140@@ -672,7 +665,8 @@
141 if (TREE_CODE (init) == CONSTRUCTOR)
142 {
143 code = push_stmt_list ();
144- split_nonconstant_init_1 (dest, &init);
145+ if (split_nonconstant_init_1 (dest, init))
146+ init = NULL_TREE;
147 code = pop_stmt_list (code);
148 DECL_INITIAL (dest) = init;
149 TREE_READONLY (dest) = 0;
150
151=== modified file 'gcc/expr.c'
152--- old/gcc/expr.c 2011-04-20 10:07:36 +0000
153+++ new/gcc/expr.c 2011-07-14 11:52:06 +0000
154@@ -4860,16 +4860,136 @@
155 return NULL_RTX;
156 }
157
158+/* Return true if field F of structure TYPE is a flexible array. */
159+
160+static bool
161+flexible_array_member_p (const_tree f, const_tree type)
162+{
163+ const_tree tf;
164+
165+ tf = TREE_TYPE (f);
166+ return (TREE_CHAIN (f) == NULL
167+ && TREE_CODE (tf) == ARRAY_TYPE
168+ && TYPE_DOMAIN (tf)
169+ && TYPE_MIN_VALUE (TYPE_DOMAIN (tf))
170+ && integer_zerop (TYPE_MIN_VALUE (TYPE_DOMAIN (tf)))
171+ && !TYPE_MAX_VALUE (TYPE_DOMAIN (tf))
172+ && int_size_in_bytes (type) >= 0);
173+}
174+
175+/* If FOR_CTOR_P, return the number of top-level elements that a constructor
176+ must have in order for it to completely initialize a value of type TYPE.
177+ Return -1 if the number isn't known.
178+
179+ If !FOR_CTOR_P, return an estimate of the number of scalars in TYPE. */
180+
181+static HOST_WIDE_INT
182+count_type_elements (const_tree type, bool for_ctor_p)
183+{
184+ switch (TREE_CODE (type))
185+ {
186+ case ARRAY_TYPE:
187+ {
188+ tree nelts;
189+
190+ nelts = array_type_nelts (type);
191+ if (nelts && host_integerp (nelts, 1))
192+ {
193+ unsigned HOST_WIDE_INT n;
194+
195+ n = tree_low_cst (nelts, 1) + 1;
196+ if (n == 0 || for_ctor_p)
197+ return n;
198+ else
199+ return n * count_type_elements (TREE_TYPE (type), false);
200+ }
201+ return for_ctor_p ? -1 : 1;
202+ }
203+
204+ case RECORD_TYPE:
205+ {
206+ unsigned HOST_WIDE_INT n;
207+ tree f;
208+
209+ n = 0;
210+ for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
211+ if (TREE_CODE (f) == FIELD_DECL)
212+ {
213+ if (!for_ctor_p)
214+ n += count_type_elements (TREE_TYPE (f), false);
215+ else if (!flexible_array_member_p (f, type))
216+ /* Don't count flexible arrays, which are not supposed
217+ to be initialized. */
218+ n += 1;
219+ }
220+
221+ return n;
222+ }
223+
224+ case UNION_TYPE:
225+ case QUAL_UNION_TYPE:
226+ {
227+ tree f;
228+ HOST_WIDE_INT n, m;
229+
230+ gcc_assert (!for_ctor_p);
231+ /* Estimate the number of scalars in each field and pick the
232+ maximum. Other estimates would do instead; the idea is simply
233+ to make sure that the estimate is not sensitive to the ordering
234+ of the fields. */
235+ n = 1;
236+ for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
237+ if (TREE_CODE (f) == FIELD_DECL)
238+ {
239+ m = count_type_elements (TREE_TYPE (f), false);
240+ /* If the field doesn't span the whole union, add an extra
241+ scalar for the rest. */
242+ if (simple_cst_equal (TYPE_SIZE (TREE_TYPE (f)),
243+ TYPE_SIZE (type)) != 1)
244+ m++;
245+ if (n < m)
246+ n = m;
247+ }
248+ return n;
249+ }
250+
251+ case COMPLEX_TYPE:
252+ return 2;
253+
254+ case VECTOR_TYPE:
255+ return TYPE_VECTOR_SUBPARTS (type);
256+
257+ case INTEGER_TYPE:
258+ case REAL_TYPE:
259+ case FIXED_POINT_TYPE:
260+ case ENUMERAL_TYPE:
261+ case BOOLEAN_TYPE:
262+ case POINTER_TYPE:
263+ case OFFSET_TYPE:
264+ case REFERENCE_TYPE:
265+ return 1;
266+
267+ case ERROR_MARK:
268+ return 0;
269+
270+ case VOID_TYPE:
271+ case METHOD_TYPE:
272+ case FUNCTION_TYPE:
273+ case LANG_TYPE:
274+ default:
275+ gcc_unreachable ();
276+ }
277+}
278+
279 /* Helper for categorize_ctor_elements. Identical interface. */
280
281 static bool
282 categorize_ctor_elements_1 (const_tree ctor, HOST_WIDE_INT *p_nz_elts,
283- HOST_WIDE_INT *p_elt_count,
284- bool *p_must_clear)
285+ HOST_WIDE_INT *p_init_elts, bool *p_complete)
286 {
287 unsigned HOST_WIDE_INT idx;
288- HOST_WIDE_INT nz_elts, elt_count;
289- tree value, purpose;
290+ HOST_WIDE_INT nz_elts, init_elts, num_fields;
291+ tree value, purpose, elt_type;
292
293 /* Whether CTOR is a valid constant initializer, in accordance with what
294 initializer_constant_valid_p does. If inferred from the constructor
295@@ -4878,7 +4998,9 @@
296 bool const_p = const_from_elts_p ? true : TREE_STATIC (ctor);
297
298 nz_elts = 0;
299- elt_count = 0;
300+ init_elts = 0;
301+ num_fields = 0;
302+ elt_type = NULL_TREE;
303
304 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, purpose, value)
305 {
306@@ -4894,6 +5016,8 @@
307 mult = (tree_low_cst (hi_index, 1)
308 - tree_low_cst (lo_index, 1) + 1);
309 }
310+ num_fields += mult;
311+ elt_type = TREE_TYPE (value);
312
313 switch (TREE_CODE (value))
314 {
315@@ -4901,11 +5025,11 @@
316 {
317 HOST_WIDE_INT nz = 0, ic = 0;
318
319- bool const_elt_p
320- = categorize_ctor_elements_1 (value, &nz, &ic, p_must_clear);
321+ bool const_elt_p = categorize_ctor_elements_1 (value, &nz, &ic,
322+ p_complete);
323
324 nz_elts += mult * nz;
325- elt_count += mult * ic;
326+ init_elts += mult * ic;
327
328 if (const_from_elts_p && const_p)
329 const_p = const_elt_p;
330@@ -4917,12 +5041,12 @@
331 case FIXED_CST:
332 if (!initializer_zerop (value))
333 nz_elts += mult;
334- elt_count += mult;
335+ init_elts += mult;
336 break;
337
338 case STRING_CST:
339 nz_elts += mult * TREE_STRING_LENGTH (value);
340- elt_count += mult * TREE_STRING_LENGTH (value);
341+ init_elts += mult * TREE_STRING_LENGTH (value);
342 break;
343
344 case COMPLEX_CST:
345@@ -4930,7 +5054,7 @@
346 nz_elts += mult;
347 if (!initializer_zerop (TREE_IMAGPART (value)))
348 nz_elts += mult;
349- elt_count += mult;
350+ init_elts += mult;
351 break;
352
353 case VECTOR_CST:
354@@ -4940,60 +5064,31 @@
355 {
356 if (!initializer_zerop (TREE_VALUE (v)))
357 nz_elts += mult;
358- elt_count += mult;
359+ init_elts += mult;
360 }
361 }
362 break;
363
364 default:
365- nz_elts += mult;
366- elt_count += mult;
367+ {
368+ HOST_WIDE_INT tc = count_type_elements (elt_type, false);
369+ nz_elts += mult * tc;
370+ init_elts += mult * tc;
371
372- if (const_from_elts_p && const_p)
373- const_p = initializer_constant_valid_p (value, TREE_TYPE (value))
374- != NULL_TREE;
375+ if (const_from_elts_p && const_p)
376+ const_p = initializer_constant_valid_p (value, elt_type)
377+ != NULL_TREE;
378+ }
379 break;
380 }
381 }
382
383- if (!*p_must_clear
384- && (TREE_CODE (TREE_TYPE (ctor)) == UNION_TYPE
385- || TREE_CODE (TREE_TYPE (ctor)) == QUAL_UNION_TYPE))
386- {
387- tree init_sub_type;
388- bool clear_this = true;
389-
390- if (!VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (ctor)))
391- {
392- /* We don't expect more than one element of the union to be
393- initialized. Not sure what we should do otherwise... */
394- gcc_assert (VEC_length (constructor_elt, CONSTRUCTOR_ELTS (ctor))
395- == 1);
396-
397- init_sub_type = TREE_TYPE (VEC_index (constructor_elt,
398- CONSTRUCTOR_ELTS (ctor),
399- 0)->value);
400-
401- /* ??? We could look at each element of the union, and find the
402- largest element. Which would avoid comparing the size of the
403- initialized element against any tail padding in the union.
404- Doesn't seem worth the effort... */
405- if (simple_cst_equal (TYPE_SIZE (TREE_TYPE (ctor)),
406- TYPE_SIZE (init_sub_type)) == 1)
407- {
408- /* And now we have to find out if the element itself is fully
409- constructed. E.g. for union { struct { int a, b; } s; } u
410- = { .s = { .a = 1 } }. */
411- if (elt_count == count_type_elements (init_sub_type, false))
412- clear_this = false;
413- }
414- }
415-
416- *p_must_clear = clear_this;
417- }
418+ if (*p_complete && !complete_ctor_at_level_p (TREE_TYPE (ctor),
419+ num_fields, elt_type))
420+ *p_complete = false;
421
422 *p_nz_elts += nz_elts;
423- *p_elt_count += elt_count;
424+ *p_init_elts += init_elts;
425
426 return const_p;
427 }
428@@ -5003,111 +5098,50 @@
429 and place it in *P_NZ_ELTS;
430 * how many scalar fields in total are in CTOR,
431 and place it in *P_ELT_COUNT.
432- * if a type is a union, and the initializer from the constructor
433- is not the largest element in the union, then set *p_must_clear.
434+ * whether the constructor is complete -- in the sense that every
435+ meaningful byte is explicitly given a value --
436+ and place it in *P_COMPLETE.
437
438 Return whether or not CTOR is a valid static constant initializer, the same
439 as "initializer_constant_valid_p (CTOR, TREE_TYPE (CTOR)) != 0". */
440
441 bool
442 categorize_ctor_elements (const_tree ctor, HOST_WIDE_INT *p_nz_elts,
443- HOST_WIDE_INT *p_elt_count,
444- bool *p_must_clear)
445+ HOST_WIDE_INT *p_init_elts, bool *p_complete)
446 {
447 *p_nz_elts = 0;
448- *p_elt_count = 0;
449- *p_must_clear = false;
450+ *p_init_elts = 0;
451+ *p_complete = true;
452
453- return
454- categorize_ctor_elements_1 (ctor, p_nz_elts, p_elt_count, p_must_clear);
455+ return categorize_ctor_elements_1 (ctor, p_nz_elts, p_init_elts, p_complete);
456 }
457
458-/* Count the number of scalars in TYPE. Return -1 on overflow or
459- variable-sized. If ALLOW_FLEXARR is true, don't count flexible
460- array member at the end of the structure. */
461+/* TYPE is initialized by a constructor with NUM_ELTS elements, the last
462+ of which had type LAST_TYPE. Each element was itself a complete
463+ initializer, in the sense that every meaningful byte was explicitly
464+ given a value. Return true if the same is true for the constructor
465+ as a whole. */
466
467-HOST_WIDE_INT
468-count_type_elements (const_tree type, bool allow_flexarr)
469+bool
470+complete_ctor_at_level_p (const_tree type, HOST_WIDE_INT num_elts,
471+ const_tree last_type)
472 {
473- const HOST_WIDE_INT max = ~((HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT-1));
474- switch (TREE_CODE (type))
475+ if (TREE_CODE (type) == UNION_TYPE
476+ || TREE_CODE (type) == QUAL_UNION_TYPE)
477 {
478- case ARRAY_TYPE:
479- {
480- tree telts = array_type_nelts (type);
481- if (telts && host_integerp (telts, 1))
482- {
483- HOST_WIDE_INT n = tree_low_cst (telts, 1) + 1;
484- HOST_WIDE_INT m = count_type_elements (TREE_TYPE (type), false);
485- if (n == 0)
486- return 0;
487- else if (max / n > m)
488- return n * m;
489- }
490- return -1;
491- }
492-
493- case RECORD_TYPE:
494- {
495- HOST_WIDE_INT n = 0, t;
496- tree f;
497-
498- for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
499- if (TREE_CODE (f) == FIELD_DECL)
500- {
501- t = count_type_elements (TREE_TYPE (f), false);
502- if (t < 0)
503- {
504- /* Check for structures with flexible array member. */
505- tree tf = TREE_TYPE (f);
506- if (allow_flexarr
507- && TREE_CHAIN (f) == NULL
508- && TREE_CODE (tf) == ARRAY_TYPE
509- && TYPE_DOMAIN (tf)
510- && TYPE_MIN_VALUE (TYPE_DOMAIN (tf))
511- && integer_zerop (TYPE_MIN_VALUE (TYPE_DOMAIN (tf)))
512- && !TYPE_MAX_VALUE (TYPE_DOMAIN (tf))
513- && int_size_in_bytes (type) >= 0)
514- break;
515-
516- return -1;
517- }
518- n += t;
519- }
520-
521- return n;
522- }
523-
524- case UNION_TYPE:
525- case QUAL_UNION_TYPE:
526- return -1;
527-
528- case COMPLEX_TYPE:
529- return 2;
530-
531- case VECTOR_TYPE:
532- return TYPE_VECTOR_SUBPARTS (type);
533-
534- case INTEGER_TYPE:
535- case REAL_TYPE:
536- case FIXED_POINT_TYPE:
537- case ENUMERAL_TYPE:
538- case BOOLEAN_TYPE:
539- case POINTER_TYPE:
540- case OFFSET_TYPE:
541- case REFERENCE_TYPE:
542- return 1;
543-
544- case ERROR_MARK:
545- return 0;
546-
547- case VOID_TYPE:
548- case METHOD_TYPE:
549- case FUNCTION_TYPE:
550- case LANG_TYPE:
551- default:
552- gcc_unreachable ();
553+ if (num_elts == 0)
554+ return false;
555+
556+ gcc_assert (num_elts == 1 && last_type);
557+
558+ /* ??? We could look at each element of the union, and find the
559+ largest element. Which would avoid comparing the size of the
560+ initialized element against any tail padding in the union.
561+ Doesn't seem worth the effort... */
562+ return simple_cst_equal (TYPE_SIZE (type), TYPE_SIZE (last_type)) == 1;
563 }
564+
565+ return count_type_elements (type, true) == num_elts;
566 }
567
568 /* Return 1 if EXP contains mostly (3/4) zeros. */
569@@ -5116,18 +5150,12 @@
570 mostly_zeros_p (const_tree exp)
571 {
572 if (TREE_CODE (exp) == CONSTRUCTOR)
573-
574 {
575- HOST_WIDE_INT nz_elts, count, elts;
576- bool must_clear;
577-
578- categorize_ctor_elements (exp, &nz_elts, &count, &must_clear);
579- if (must_clear)
580- return 1;
581-
582- elts = count_type_elements (TREE_TYPE (exp), false);
583-
584- return nz_elts < elts / 4;
585+ HOST_WIDE_INT nz_elts, init_elts;
586+ bool complete_p;
587+
588+ categorize_ctor_elements (exp, &nz_elts, &init_elts, &complete_p);
589+ return !complete_p || nz_elts < init_elts / 4;
590 }
591
592 return initializer_zerop (exp);
593@@ -5139,12 +5167,11 @@
594 all_zeros_p (const_tree exp)
595 {
596 if (TREE_CODE (exp) == CONSTRUCTOR)
597-
598 {
599- HOST_WIDE_INT nz_elts, count;
600- bool must_clear;
601+ HOST_WIDE_INT nz_elts, init_elts;
602+ bool complete_p;
603
604- categorize_ctor_elements (exp, &nz_elts, &count, &must_clear);
605+ categorize_ctor_elements (exp, &nz_elts, &init_elts, &complete_p);
606 return nz_elts == 0;
607 }
608
609
610=== modified file 'gcc/gimplify.c'
611--- old/gcc/gimplify.c 2011-04-07 18:27:20 +0000
612+++ new/gcc/gimplify.c 2011-07-13 13:36:36 +0000
613@@ -3634,9 +3634,8 @@
614 case ARRAY_TYPE:
615 {
616 struct gimplify_init_ctor_preeval_data preeval_data;
617- HOST_WIDE_INT num_type_elements, num_ctor_elements;
618- HOST_WIDE_INT num_nonzero_elements;
619- bool cleared, valid_const_initializer;
620+ HOST_WIDE_INT num_ctor_elements, num_nonzero_elements;
621+ bool cleared, complete_p, valid_const_initializer;
622
623 /* Aggregate types must lower constructors to initialization of
624 individual elements. The exception is that a CONSTRUCTOR node
625@@ -3653,7 +3652,7 @@
626 can only do so if it known to be a valid constant initializer. */
627 valid_const_initializer
628 = categorize_ctor_elements (ctor, &num_nonzero_elements,
629- &num_ctor_elements, &cleared);
630+ &num_ctor_elements, &complete_p);
631
632 /* If a const aggregate variable is being initialized, then it
633 should never be a lose to promote the variable to be static. */
634@@ -3691,26 +3690,29 @@
635 parts in, then generate code for the non-constant parts. */
636 /* TODO. There's code in cp/typeck.c to do this. */
637
638- num_type_elements = count_type_elements (type, true);
639+ if (int_size_in_bytes (TREE_TYPE (ctor)) < 0)
640+ /* store_constructor will ignore the clearing of variable-sized
641+ objects. Initializers for such objects must explicitly set
642+ every field that needs to be set. */
643+ cleared = false;
644+ else if (!complete_p)
645+ /* If the constructor isn't complete, clear the whole object
646+ beforehand.
647
648- /* If count_type_elements could not determine number of type elements
649- for a constant-sized object, assume clearing is needed.
650- Don't do this for variable-sized objects, as store_constructor
651- will ignore the clearing of variable-sized objects. */
652- if (num_type_elements < 0 && int_size_in_bytes (type) >= 0)
653+ ??? This ought not to be needed. For any element not present
654+ in the initializer, we should simply set them to zero. Except
655+ we'd need to *find* the elements that are not present, and that
656+ requires trickery to avoid quadratic compile-time behavior in
657+ large cases or excessive memory use in small cases. */
658 cleared = true;
659- /* If there are "lots" of zeros, then block clear the object first. */
660- else if (num_type_elements - num_nonzero_elements
661+ else if (num_ctor_elements - num_nonzero_elements
662 > CLEAR_RATIO (optimize_function_for_speed_p (cfun))
663- && num_nonzero_elements < num_type_elements/4)
664- cleared = true;
665- /* ??? This bit ought not be needed. For any element not present
666- in the initializer, we should simply set them to zero. Except
667- we'd need to *find* the elements that are not present, and that
668- requires trickery to avoid quadratic compile-time behavior in
669- large cases or excessive memory use in small cases. */
670- else if (num_ctor_elements < num_type_elements)
671- cleared = true;
672+ && num_nonzero_elements < num_ctor_elements / 4)
673+ /* If there are "lots" of zeros, it's more efficient to clear
674+ the memory and then set the nonzero elements. */
675+ cleared = true;
676+ else
677+ cleared = false;
678
679 /* If there are "lots" of initialized elements, and all of them
680 are valid address constants, then the entire initializer can
681
682=== added file 'gcc/testsuite/gcc.target/arm/pr48183.c'
683--- old/gcc/testsuite/gcc.target/arm/pr48183.c 1970-01-01 00:00:00 +0000
684+++ new/gcc/testsuite/gcc.target/arm/pr48183.c 2011-07-13 13:36:36 +0000
685@@ -0,0 +1,25 @@
686+/* testsuite/gcc.target/arm/pr48183.c */
687+
688+/* { dg-do compile } */
689+/* { dg-require-effective-target arm_neon_ok } */
690+/* { dg-options "-O -g" } */
691+/* { dg-add-options arm_neon } */
692+
693+#include <arm_neon.h>
694+
695+void move_16bit_to_32bit (int32_t *dst, const short *src, unsigned n)
696+{
697+ unsigned i;
698+ int16x4x2_t input;
699+ int32x4x2_t mid;
700+ int32x4x2_t output;
701+
702+ for (i = 0; i < n/2; i += 8) {
703+ input = vld2_s16(src + i);
704+ mid.val[0] = vmovl_s16(input.val[0]);
705+ mid.val[1] = vmovl_s16(input.val[1]);
706+ output.val[0] = vshlq_n_s32(mid.val[0], 8);
707+ output.val[1] = vshlq_n_s32(mid.val[1], 8);
708+ vst2q_s32((int32_t *)dst + i, output);
709+ }
710+}
711
712=== modified file 'gcc/tree.h'
713--- old/gcc/tree.h 2011-04-06 12:29:08 +0000
714+++ new/gcc/tree.h 2011-07-13 13:36:36 +0000
715@@ -4361,21 +4361,10 @@
716
717 extern VEC(tree,gc) *ctor_to_vec (tree);
718
719-/* Examine CTOR to discover:
720- * how many scalar fields are set to nonzero values,
721- and place it in *P_NZ_ELTS;
722- * how many scalar fields in total are in CTOR,
723- and place it in *P_ELT_COUNT.
724- * if a type is a union, and the initializer from the constructor
725- is not the largest element in the union, then set *p_must_clear.
726-
727- Return whether or not CTOR is a valid static constant initializer, the same
728- as "initializer_constant_valid_p (CTOR, TREE_TYPE (CTOR)) != 0". */
729-
730-extern bool categorize_ctor_elements (const_tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
731- bool *);
732-
733-extern HOST_WIDE_INT count_type_elements (const_tree, bool);
734+extern bool categorize_ctor_elements (const_tree, HOST_WIDE_INT *,
735+ HOST_WIDE_INT *, bool *);
736+
737+extern bool complete_ctor_at_level_p (const_tree, HOST_WIDE_INT, const_tree);
738
739 /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0. */
740
741
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/linaro-lp815435.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/linaro-lp815435.patch
new file mode 100644
index 000000000..be71a2f64
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/linaro-lp815435.patch
@@ -0,0 +1,25 @@
12011-07-29 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
2
3 gcc/
4 Backport only bits marked as [*] from mainline:
5 2010-12-19 Chung-Lin Tang <cltang@codesourcery.com>
6
7 * config/arm/arm.c ([*]arm_legitimate_index_p): Add VFP load/store
8 index range case. Change to SF/DFmode tests to avoid capturing HFmode.
9 (thumb2_legitimate_index_p): Same.
10
11Index: gcc-4_5-branch/gcc/config/arm/arm.c
12===================================================================
13--- gcc-4_5-branch.orig/gcc/config/arm/arm.c 2011-07-22 17:56:51.000000000 -0700
14+++ gcc-4_5-branch/gcc/config/arm/arm.c 2011-07-29 14:43:42.171610966 -0700
15@@ -5631,8 +5631,8 @@ arm_legitimate_index_p (enum machine_mod
16
17 /* Standard coprocessor addressing modes. */
18 if (TARGET_HARD_FLOAT
19- && (TARGET_FPA || TARGET_MAVERICK)
20- && (GET_MODE_CLASS (mode) == MODE_FLOAT
21+ && (TARGET_FPA || TARGET_MAVERICK || TARGET_VFP)
22+ && ((mode == SFmode || mode == DFmode)
23 || (TARGET_MAVERICK && mode == DImode)))
24 return (code == CONST_INT && INTVAL (index) < 1024
25 && INTVAL (index) > -1024