diff options
5 files changed, 361 insertions, 2 deletions
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5.inc b/meta-oe/recipes-devtools/gcc/gcc-4.5.inc index 52fca37015..ed3076a85a 100644 --- a/meta-oe/recipes-devtools/gcc/gcc-4.5.inc +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5.inc | |||
@@ -14,7 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ | |||
14 | 14 | ||
15 | SRCREV = "170880" | 15 | SRCREV = "170880" |
16 | PV = "4.5" | 16 | PV = "4.5" |
17 | INC_PR = "r32" | 17 | INC_PR = "r33" |
18 | 18 | ||
19 | # BINV should be incremented after updating to a revision | 19 | # BINV should be incremented after updating to a revision |
20 | # after a minor gcc release (e.g. 4.5.1 or 4.5.2) has been made | 20 | # after a minor gcc release (e.g. 4.5.1 or 4.5.2) has been made |
@@ -169,7 +169,7 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH} \ | |||
169 | file://linaro/gcc-4.5-linaro-r99466.patch \ | 169 | file://linaro/gcc-4.5-linaro-r99466.patch \ |
170 | file://linaro/gcc-4.5-linaro-r99468.patch \ | 170 | file://linaro/gcc-4.5-linaro-r99468.patch \ |
171 | file://linaro/gcc-4.5-linaro-r99473.patch \ | 171 | file://linaro/gcc-4.5-linaro-r99473.patch \ |
172 | file://linaro/gcc-4.5-linaro-r99474.patch \ | 172 | # file://linaro/gcc-4.5-linaro-r99474.patch \ |
173 | file://linaro/gcc-4.5-linaro-r99475.patch \ | 173 | file://linaro/gcc-4.5-linaro-r99475.patch \ |
174 | file://linaro/gcc-4.5-linaro-r99478.patch \ | 174 | file://linaro/gcc-4.5-linaro-r99478.patch \ |
175 | file://linaro/gcc-4.5-linaro-r99479.patch \ | 175 | file://linaro/gcc-4.5-linaro-r99479.patch \ |
@@ -177,6 +177,10 @@ SRC_URI = "svn://gcc.gnu.org/svn/gcc/branches;module=${BRANCH} \ | |||
177 | file://linaro/gcc-4.5-linaro-r99481.patch \ | 177 | file://linaro/gcc-4.5-linaro-r99481.patch \ |
178 | file://linaro/gcc-4.5-linaro-r99482.patch \ | 178 | file://linaro/gcc-4.5-linaro-r99482.patch \ |
179 | file://linaro/gcc-4.5-linaro-r99483.patch \ | 179 | file://linaro/gcc-4.5-linaro-r99483.patch \ |
180 | # file://linaro/gcc-4.5-linaro-r99486.patch \ | ||
181 | # file://linaro/gcc-4.5-linaro-r99487.patch \ | ||
182 | file://linaro/gcc-4.5-linaro-r99488.patch \ | ||
183 | file://linaro/gcc-4.5-linaro-r99489.patch \ | ||
180 | file://more-epilogues.patch \ | 184 | file://more-epilogues.patch \ |
181 | file://gcc-scalar-widening-pr45847.patch \ | 185 | file://gcc-scalar-widening-pr45847.patch \ |
182 | file://gcc-arm-volatile-bitfield-fix.patch \ | 186 | file://gcc-arm-volatile-bitfield-fix.patch \ |
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch new file mode 100644 index 0000000000..e6b58ac872 --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99486.patch | |||
@@ -0,0 +1,230 @@ | |||
1 | 2011-03-09 Bernd Schmidt <bernds@codesourcery.com> | ||
2 | |||
3 | Issue #10649 | ||
4 | gcc/ | ||
5 | * dwarf2out.c (dwarf2out_begin_epilogue): Accept simplejumps | ||
6 | as well as returnjumps. | ||
7 | * cfganal.c (set_edge_can_fallthru_flag): Revert previous change | ||
8 | that tried to keep epilogue blocks adjacent. | ||
9 | |||
10 | 2011-02-03 Bernd Schmidt <bernds@codesourcery.com> | ||
11 | |||
12 | gcc/ | ||
13 | * function.c (prepare_shrink_wrap): New function. | ||
14 | (thread_prologue_and_epilogue_insns): Call it. | ||
15 | |||
16 | === modified file 'gcc/cfganal.c' | ||
17 | --- old/gcc/cfganal.c 2011-02-08 10:51:58 +0000 | ||
18 | +++ new/gcc/cfganal.c 2011-03-10 14:55:10 +0000 | ||
19 | @@ -271,37 +271,6 @@ | ||
20 | EDGE_SUCC (bb, 0)->flags |= EDGE_CAN_FALLTHRU; | ||
21 | EDGE_SUCC (bb, 1)->flags |= EDGE_CAN_FALLTHRU; | ||
22 | } | ||
23 | - /* dwarf2out expects that a NOTE_INSN_EPILOGUE_BEGIN is always paired | ||
24 | - with a return or a sibcall. Ensure that this remains the case if | ||
25 | - they are in different basic blocks. */ | ||
26 | - FOR_EACH_BB (bb) | ||
27 | - { | ||
28 | - edge e; | ||
29 | - edge_iterator ei; | ||
30 | - rtx insn, end; | ||
31 | - | ||
32 | - end = BB_END (bb); | ||
33 | - FOR_BB_INSNS (bb, insn) | ||
34 | - if (GET_CODE (insn) == NOTE | ||
35 | - && NOTE_KIND (insn) == NOTE_INSN_EPILOGUE_BEG | ||
36 | - && !(CALL_P (end) && SIBLING_CALL_P (end)) | ||
37 | - && !returnjump_p (end)) | ||
38 | - { | ||
39 | - basic_block other_bb = NULL; | ||
40 | - FOR_EACH_EDGE (e, ei, bb->succs) | ||
41 | - { | ||
42 | - if (e->flags & EDGE_FALLTHRU) | ||
43 | - other_bb = e->dest; | ||
44 | - else | ||
45 | - e->flags &= ~EDGE_CAN_FALLTHRU; | ||
46 | - } | ||
47 | - FOR_EACH_EDGE (e, ei, other_bb->preds) | ||
48 | - { | ||
49 | - if (!(e->flags & EDGE_FALLTHRU)) | ||
50 | - e->flags &= ~EDGE_CAN_FALLTHRU; | ||
51 | - } | ||
52 | - } | ||
53 | - } | ||
54 | } | ||
55 | |||
56 | /* Find unreachable blocks. An unreachable block will have 0 in | ||
57 | |||
58 | === modified file 'gcc/dwarf2out.c' | ||
59 | --- old/gcc/dwarf2out.c 2011-02-08 10:51:58 +0000 | ||
60 | +++ new/gcc/dwarf2out.c 2011-03-10 14:55:10 +0000 | ||
61 | @@ -2782,10 +2782,10 @@ | ||
62 | dwarf2out_frame_debug_expr (insn, label); | ||
63 | } | ||
64 | |||
65 | -/* Determine if we need to save and restore CFI information around this | ||
66 | - epilogue. If SIBCALL is true, then this is a sibcall epilogue. If | ||
67 | - we do need to save/restore, then emit the save now, and insert a | ||
68 | - NOTE_INSN_CFA_RESTORE_STATE at the appropriate place in the stream. */ | ||
69 | +/* Determine if we need to save and restore CFI information around | ||
70 | + this epilogue. If we do need to save/restore, then emit the save | ||
71 | + now, and insert a NOTE_INSN_CFA_RESTORE_STATE at the appropriate | ||
72 | + place in the stream. */ | ||
73 | |||
74 | void | ||
75 | dwarf2out_begin_epilogue (rtx insn) | ||
76 | @@ -2800,8 +2800,10 @@ | ||
77 | if (!INSN_P (i)) | ||
78 | continue; | ||
79 | |||
80 | - /* Look for both regular and sibcalls to end the block. */ | ||
81 | - if (returnjump_p (i)) | ||
82 | + /* Look for both regular and sibcalls to end the block. Various | ||
83 | + optimization passes may cause us to jump to a common epilogue | ||
84 | + tail, so we also accept simplejumps. */ | ||
85 | + if (returnjump_p (i) || simplejump_p (i)) | ||
86 | break; | ||
87 | if (CALL_P (i) && SIBLING_CALL_P (i)) | ||
88 | break; | ||
89 | |||
90 | === modified file 'gcc/function.c' | ||
91 | --- old/gcc/function.c 2011-02-08 10:51:58 +0000 | ||
92 | +++ new/gcc/function.c 2011-03-10 14:55:10 +0000 | ||
93 | @@ -5038,6 +5038,127 @@ | ||
94 | return true; | ||
95 | return false; | ||
96 | } | ||
97 | + | ||
98 | +/* Look for sets of call-saved registers in the first block of the | ||
99 | + function, and move them down into successor blocks if the register | ||
100 | + is used only on one path. This exposes more opportunities for | ||
101 | + shrink-wrapping. | ||
102 | + These kinds of sets often occur when incoming argument registers are | ||
103 | + moved to call-saved registers because their values are live across | ||
104 | + one or more calls during the function. */ | ||
105 | + | ||
106 | +static void | ||
107 | +prepare_shrink_wrap (basic_block entry_block) | ||
108 | +{ | ||
109 | + rtx insn, curr; | ||
110 | + FOR_BB_INSNS_SAFE (entry_block, insn, curr) | ||
111 | + { | ||
112 | + basic_block next_bb; | ||
113 | + edge e, live_edge; | ||
114 | + edge_iterator ei; | ||
115 | + rtx set, scan; | ||
116 | + unsigned destreg, srcreg; | ||
117 | + | ||
118 | + if (!NONDEBUG_INSN_P (insn)) | ||
119 | + continue; | ||
120 | + set = single_set (insn); | ||
121 | + if (!set) | ||
122 | + continue; | ||
123 | + | ||
124 | + if (!REG_P (SET_SRC (set)) || !REG_P (SET_DEST (set))) | ||
125 | + continue; | ||
126 | + srcreg = REGNO (SET_SRC (set)); | ||
127 | + destreg = REGNO (SET_DEST (set)); | ||
128 | + if (hard_regno_nregs[srcreg][GET_MODE (SET_SRC (set))] > 1 | ||
129 | + || hard_regno_nregs[destreg][GET_MODE (SET_DEST (set))] > 1) | ||
130 | + continue; | ||
131 | + | ||
132 | + next_bb = entry_block; | ||
133 | + scan = insn; | ||
134 | + | ||
135 | + for (;;) | ||
136 | + { | ||
137 | + live_edge = NULL; | ||
138 | + FOR_EACH_EDGE (e, ei, next_bb->succs) | ||
139 | + { | ||
140 | + if (REGNO_REG_SET_P (df_get_live_in (e->dest), destreg)) | ||
141 | + { | ||
142 | + if (live_edge) | ||
143 | + { | ||
144 | + live_edge = NULL; | ||
145 | + break; | ||
146 | + } | ||
147 | + live_edge = e; | ||
148 | + } | ||
149 | + } | ||
150 | + if (!live_edge) | ||
151 | + break; | ||
152 | + /* We can sometimes encounter dead code. Don't try to move it | ||
153 | + into the exit block. */ | ||
154 | + if (live_edge->dest == EXIT_BLOCK_PTR) | ||
155 | + break; | ||
156 | + if (EDGE_COUNT (live_edge->dest->preds) > 1) | ||
157 | + break; | ||
158 | + while (scan != BB_END (next_bb)) | ||
159 | + { | ||
160 | + scan = NEXT_INSN (scan); | ||
161 | + if (NONDEBUG_INSN_P (scan)) | ||
162 | + { | ||
163 | + rtx link; | ||
164 | + HARD_REG_SET set_regs; | ||
165 | + | ||
166 | + CLEAR_HARD_REG_SET (set_regs); | ||
167 | + note_stores (PATTERN (scan), record_hard_reg_sets, | ||
168 | + &set_regs); | ||
169 | + if (CALL_P (scan)) | ||
170 | + IOR_HARD_REG_SET (set_regs, call_used_reg_set); | ||
171 | + for (link = REG_NOTES (scan); link; link = XEXP (link, 1)) | ||
172 | + if (REG_NOTE_KIND (link) == REG_INC) | ||
173 | + record_hard_reg_sets (XEXP (link, 0), NULL, &set_regs); | ||
174 | + | ||
175 | + if (TEST_HARD_REG_BIT (set_regs, srcreg) | ||
176 | + || reg_referenced_p (SET_DEST (set), | ||
177 | + PATTERN (scan))) | ||
178 | + { | ||
179 | + scan = NULL_RTX; | ||
180 | + break; | ||
181 | + } | ||
182 | + if (CALL_P (scan)) | ||
183 | + { | ||
184 | + rtx link = CALL_INSN_FUNCTION_USAGE (scan); | ||
185 | + while (link) | ||
186 | + { | ||
187 | + rtx tmp = XEXP (link, 0); | ||
188 | + if (GET_CODE (tmp) == USE | ||
189 | + && reg_referenced_p (SET_DEST (set), tmp)) | ||
190 | + break; | ||
191 | + link = XEXP (link, 1); | ||
192 | + } | ||
193 | + if (link) | ||
194 | + { | ||
195 | + scan = NULL_RTX; | ||
196 | + break; | ||
197 | + } | ||
198 | + } | ||
199 | + } | ||
200 | + } | ||
201 | + if (!scan) | ||
202 | + break; | ||
203 | + next_bb = live_edge->dest; | ||
204 | + } | ||
205 | + | ||
206 | + if (next_bb != entry_block) | ||
207 | + { | ||
208 | + rtx after = BB_HEAD (next_bb); | ||
209 | + while (!NOTE_P (after) | ||
210 | + || NOTE_KIND (after) != NOTE_INSN_BASIC_BLOCK) | ||
211 | + after = NEXT_INSN (after); | ||
212 | + emit_insn_after (PATTERN (insn), after); | ||
213 | + delete_insn (insn); | ||
214 | + } | ||
215 | + } | ||
216 | +} | ||
217 | + | ||
218 | #endif | ||
219 | |||
220 | #ifdef HAVE_return | ||
221 | @@ -5215,6 +5336,8 @@ | ||
222 | bitmap_head bb_antic_flags; | ||
223 | bitmap_head bb_on_list; | ||
224 | |||
225 | + prepare_shrink_wrap (entry_edge->dest); | ||
226 | + | ||
227 | bitmap_initialize (&bb_antic_flags, &bitmap_default_obstack); | ||
228 | bitmap_initialize (&bb_on_list, &bitmap_default_obstack); | ||
229 | |||
230 | |||
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99487.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99487.patch new file mode 100644 index 0000000000..186c17717f --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99487.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | 2011-03-11 Andrew Stubbs <ams@codesourcery.com> | ||
2 | Michael Hope <michael.hope@linaro.org> | ||
3 | Matthias Klose <doko@ubuntu.org> | ||
4 | |||
5 | gcc/ | ||
6 | * function. (thread_prologue_and_epilogue_insns): Initialize | ||
7 | prologue_seq. | ||
8 | * opts.c (decode_options): Move flag_shrink_wrap to -O1. | ||
9 | |||
10 | === modified file 'gcc/function.c' | ||
11 | --- old/gcc/function.c 2011-03-10 14:55:10 +0000 | ||
12 | +++ new/gcc/function.c 2011-03-11 10:35:05 +0000 | ||
13 | @@ -5252,6 +5252,8 @@ | ||
14 | edge_iterator ei; | ||
15 | bitmap_head bb_flags; | ||
16 | |||
17 | + prologue_seq = NULL_RTX; | ||
18 | + | ||
19 | df_analyze (); | ||
20 | |||
21 | rtl_profile_for_bb (ENTRY_BLOCK_PTR); | ||
22 | |||
23 | === modified file 'gcc/opts.c' | ||
24 | --- old/gcc/opts.c 2011-02-08 10:51:58 +0000 | ||
25 | +++ new/gcc/opts.c 2011-03-11 10:35:05 +0000 | ||
26 | @@ -877,6 +877,7 @@ | ||
27 | flag_tree_copy_prop = opt1; | ||
28 | flag_tree_sink = opt1; | ||
29 | flag_tree_ch = opt1; | ||
30 | + flag_shrink_wrap = opt1; | ||
31 | |||
32 | /* -O2 optimizations. */ | ||
33 | opt2 = (optimize >= 2); | ||
34 | @@ -909,7 +910,6 @@ | ||
35 | flag_ipa_cp = opt2; | ||
36 | flag_ipa_sra = opt2; | ||
37 | flag_ee = opt2; | ||
38 | - flag_shrink_wrap = opt2; | ||
39 | |||
40 | /* Track fields in field-sensitive alias analysis. */ | ||
41 | set_param_value ("max-fields-for-field-sensitive", | ||
42 | |||
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99488.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99488.patch new file mode 100644 index 0000000000..2f41a0a73c --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99488.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | 2011-03-03 Richard Sandiford <richard.sandiford@linaro.org> | ||
2 | |||
3 | gcc/ | ||
4 | * ee.c (reg_use_p): Handle subregs of promoted vars. | ||
5 | |||
6 | === modified file 'gcc/ee.c' | ||
7 | --- old/gcc/ee.c 2010-12-10 15:33:37 +0000 | ||
8 | +++ new/gcc/ee.c 2011-03-03 17:08:58 +0000 | ||
9 | @@ -209,7 +209,11 @@ | ||
10 | |||
11 | *regno = REGNO (reg); | ||
12 | |||
13 | - if (paradoxical_subreg_p (use)) | ||
14 | + /* Non-paradoxical SUBREGs of promoted vars guarantee that the | ||
15 | + upper (elided) bits of the inner register have a particular value. | ||
16 | + For our purposes, such SUBREGs act as a full reference to the | ||
17 | + inner register. */ | ||
18 | + if (paradoxical_subreg_p (use) || SUBREG_PROMOTED_VAR_P (use)) | ||
19 | *size = GET_MODE_BITSIZE (GET_MODE (reg)); | ||
20 | else | ||
21 | *size = subreg_lsb (use) + GET_MODE_BITSIZE (GET_MODE (use)); | ||
22 | |||
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99489.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99489.patch new file mode 100644 index 0000000000..12fb56ad02 --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99489.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | 2011-03-10 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> | ||
2 | |||
3 | LP:730440 | ||
4 | PR target/47668 | ||
5 | gcc/ | ||
6 | * config/arm/arm.md (arm_movtas_ze): Use 'L' instead of 'c'. | ||
7 | gcc/testsuite/ | ||
8 | * gcc.target/arm/pr47688.c: New. | ||
9 | |||
10 | === modified file 'gcc/config/arm/arm.md' | ||
11 | --- old/gcc/config/arm/arm.md 2011-03-01 14:32:39 +0000 | ||
12 | +++ new/gcc/config/arm/arm.md 2011-03-11 14:26:34 +0000 | ||
13 | @@ -11133,13 +11133,15 @@ | ||
14 | [(set_attr "conds" "clob")] | ||
15 | ) | ||
16 | |||
17 | +;; We only care about the lower 16 bits of the constant | ||
18 | +;; being inserted into the upper 16 bits of the register. | ||
19 | (define_insn "*arm_movtas_ze" | ||
20 | [(set (zero_extract:SI (match_operand:SI 0 "s_register_operand" "+r") | ||
21 | (const_int 16) | ||
22 | (const_int 16)) | ||
23 | (match_operand:SI 1 "const_int_operand" ""))] | ||
24 | "arm_arch_thumb2" | ||
25 | - "movt%?\t%0, %c1" | ||
26 | + "movt%?\t%0, %L1" | ||
27 | [(set_attr "predicable" "yes") | ||
28 | (set_attr "length" "4")] | ||
29 | ) | ||
30 | |||
31 | === added file 'gcc/testsuite/gcc.target/arm/pr47688.c' | ||
32 | --- old/gcc/testsuite/gcc.target/arm/pr47688.c 1970-01-01 00:00:00 +0000 | ||
33 | +++ new/gcc/testsuite/gcc.target/arm/pr47688.c 2011-03-11 14:26:34 +0000 | ||
34 | @@ -0,0 +1,26 @@ | ||
35 | +/* { dg-options "-mthumb -O2" } */ | ||
36 | +/* { dg-require-effective-target arm_thumb2_ok } */ | ||
37 | +/* { dg-final { scan-assembler-not "-32768" } } */ | ||
38 | + | ||
39 | +typedef union | ||
40 | +{ | ||
41 | + unsigned long int u_32_value; | ||
42 | + struct | ||
43 | + { | ||
44 | + unsigned short int u_16_value_0; | ||
45 | + unsigned short int u_16_value_1; | ||
46 | + } u_16_values; | ||
47 | +} my_union; | ||
48 | + | ||
49 | + | ||
50 | +unsigned long int Test(const unsigned short int wXe) | ||
51 | +{ | ||
52 | + my_union dwCalcVal; | ||
53 | + | ||
54 | + dwCalcVal.u_16_values.u_16_value_0=wXe; | ||
55 | + dwCalcVal.u_16_values.u_16_value_1=0x8000u; | ||
56 | + | ||
57 | + dwCalcVal.u_32_value /=3; | ||
58 | + | ||
59 | + return (dwCalcVal.u_32_value); | ||
60 | +} | ||
61 | |||