diff options
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106741.patch')
-rw-r--r-- | toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106741.patch | 255 |
1 files changed, 0 insertions, 255 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106741.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106741.patch deleted file mode 100644 index 6e76c2127..000000000 --- a/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106741.patch +++ /dev/null | |||
@@ -1,255 +0,0 @@ | |||
1 | 2011-04-26 Andrew Stubbs <ams@codesourcery.com> | ||
2 | |||
3 | Backport from FSF: | ||
4 | |||
5 | 2011-04-15 Maxim Kuvyrkov <maxim@codesourcery.com> | ||
6 | |||
7 | gcc/ | ||
8 | * combine.c (subst, combine_simlify_rtx): Add new argument, use it | ||
9 | to track processing of conditionals. Update all callers. | ||
10 | (try_combine, simplify_if_then_else): Update. | ||
11 | |||
12 | 2011-04-25 Maxim Kuvyrkov <maxim@codesourcery.com> | ||
13 | Eric Botcazou <ebotcazou@adacore.com> | ||
14 | |||
15 | gcc/ | ||
16 | * combine.c (combine_simplify_rtx): Avoid mis-simplifying conditionals | ||
17 | for STORE_FLAG_VALUE==-1 case. | ||
18 | |||
19 | === modified file 'gcc/combine.c' | ||
20 | Index: gcc-4_6-branch/gcc/combine.c | ||
21 | =================================================================== | ||
22 | --- gcc-4_6-branch.orig/gcc/combine.c 2012-03-05 00:16:20.000000000 -0800 | ||
23 | +++ gcc-4_6-branch/gcc/combine.c 2012-03-05 16:05:01.212928507 -0800 | ||
24 | @@ -391,8 +391,8 @@ | ||
25 | static void undo_all (void); | ||
26 | static void undo_commit (void); | ||
27 | static rtx *find_split_point (rtx *, rtx, bool); | ||
28 | -static rtx subst (rtx, rtx, rtx, int, int); | ||
29 | -static rtx combine_simplify_rtx (rtx, enum machine_mode, int); | ||
30 | +static rtx subst (rtx, rtx, rtx, int, int, int); | ||
31 | +static rtx combine_simplify_rtx (rtx, enum machine_mode, int, int); | ||
32 | static rtx simplify_if_then_else (rtx); | ||
33 | static rtx simplify_set (rtx); | ||
34 | static rtx simplify_logical (rtx); | ||
35 | @@ -3119,12 +3119,12 @@ | ||
36 | if (i1) | ||
37 | { | ||
38 | subst_low_luid = DF_INSN_LUID (i1); | ||
39 | - i1src = subst (i1src, pc_rtx, pc_rtx, 0, 0); | ||
40 | + i1src = subst (i1src, pc_rtx, pc_rtx, 0, 0, 0); | ||
41 | } | ||
42 | else | ||
43 | { | ||
44 | subst_low_luid = DF_INSN_LUID (i2); | ||
45 | - i2src = subst (i2src, pc_rtx, pc_rtx, 0, 0); | ||
46 | + i2src = subst (i2src, pc_rtx, pc_rtx, 0, 0, 0); | ||
47 | } | ||
48 | } | ||
49 | |||
50 | @@ -3136,7 +3136,7 @@ | ||
51 | self-referential RTL when we will be substituting I1SRC for I1DEST | ||
52 | later. Likewise if I0 feeds into I2, either directly or indirectly | ||
53 | through I1, and I0DEST is in I0SRC. */ | ||
54 | - newpat = subst (PATTERN (i3), i2dest, i2src, 0, | ||
55 | + newpat = subst (PATTERN (i3), i2dest, i2src, 0, 0, | ||
56 | (i1_feeds_i2_n && i1dest_in_i1src) | ||
57 | || ((i0_feeds_i2_n || (i0_feeds_i1_n && i1_feeds_i2_n)) | ||
58 | && i0dest_in_i0src)); | ||
59 | @@ -3180,7 +3180,7 @@ | ||
60 | copy of I1SRC each time we substitute it, in order to avoid creating | ||
61 | self-referential RTL when we will be substituting I0SRC for I0DEST | ||
62 | later. */ | ||
63 | - newpat = subst (newpat, i1dest, i1src, 0, | ||
64 | + newpat = subst (newpat, i1dest, i1src, 0, 0, | ||
65 | i0_feeds_i1_n && i0dest_in_i0src); | ||
66 | substed_i1 = 1; | ||
67 | |||
68 | @@ -3214,7 +3214,7 @@ | ||
69 | |||
70 | n_occurrences = 0; | ||
71 | subst_low_luid = DF_INSN_LUID (i0); | ||
72 | - newpat = subst (newpat, i0dest, i0src, 0, 0); | ||
73 | + newpat = subst (newpat, i0dest, i0src, 0, 0, 0); | ||
74 | substed_i0 = 1; | ||
75 | } | ||
76 | |||
77 | @@ -3276,7 +3276,7 @@ | ||
78 | { | ||
79 | rtx t = i1pat; | ||
80 | if (i0_feeds_i1_n) | ||
81 | - t = subst (t, i0dest, i0src_copy ? i0src_copy : i0src, 0, 0); | ||
82 | + t = subst (t, i0dest, i0src_copy ? i0src_copy : i0src, 0, 0, 0); | ||
83 | |||
84 | XVECEXP (newpat, 0, --total_sets) = t; | ||
85 | } | ||
86 | @@ -3284,10 +3284,10 @@ | ||
87 | { | ||
88 | rtx t = i2pat; | ||
89 | if (i1_feeds_i2_n) | ||
90 | - t = subst (t, i1dest, i1src_copy ? i1src_copy : i1src, 0, | ||
91 | + t = subst (t, i1dest, i1src_copy ? i1src_copy : i1src, 0, 0, | ||
92 | i0_feeds_i1_n && i0dest_in_i0src); | ||
93 | if ((i0_feeds_i1_n && i1_feeds_i2_n) || i0_feeds_i2_n) | ||
94 | - t = subst (t, i0dest, i0src_copy2 ? i0src_copy2 : i0src, 0, 0); | ||
95 | + t = subst (t, i0dest, i0src_copy2 ? i0src_copy2 : i0src, 0, 0, 0); | ||
96 | |||
97 | XVECEXP (newpat, 0, --total_sets) = t; | ||
98 | } | ||
99 | @@ -4959,11 +4959,13 @@ | ||
100 | |||
101 | IN_DEST is nonzero if we are processing the SET_DEST of a SET. | ||
102 | |||
103 | + IN_COND is nonzero if we are on top level of the condition. | ||
104 | + | ||
105 | UNIQUE_COPY is nonzero if each substitution must be unique. We do this | ||
106 | by copying if `n_occurrences' is nonzero. */ | ||
107 | |||
108 | static rtx | ||
109 | -subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy) | ||
110 | +subst (rtx x, rtx from, rtx to, int in_dest, int in_cond, int unique_copy) | ||
111 | { | ||
112 | enum rtx_code code = GET_CODE (x); | ||
113 | enum machine_mode op0_mode = VOIDmode; | ||
114 | @@ -5024,7 +5026,7 @@ | ||
115 | && GET_CODE (XVECEXP (x, 0, 0)) == SET | ||
116 | && GET_CODE (SET_SRC (XVECEXP (x, 0, 0))) == ASM_OPERANDS) | ||
117 | { | ||
118 | - new_rtx = subst (XVECEXP (x, 0, 0), from, to, 0, unique_copy); | ||
119 | + new_rtx = subst (XVECEXP (x, 0, 0), from, to, 0, 0, unique_copy); | ||
120 | |||
121 | /* If this substitution failed, this whole thing fails. */ | ||
122 | if (GET_CODE (new_rtx) == CLOBBER | ||
123 | @@ -5041,7 +5043,7 @@ | ||
124 | && GET_CODE (dest) != CC0 | ||
125 | && GET_CODE (dest) != PC) | ||
126 | { | ||
127 | - new_rtx = subst (dest, from, to, 0, unique_copy); | ||
128 | + new_rtx = subst (dest, from, to, 0, 0, unique_copy); | ||
129 | |||
130 | /* If this substitution failed, this whole thing fails. */ | ||
131 | if (GET_CODE (new_rtx) == CLOBBER | ||
132 | @@ -5087,8 +5089,8 @@ | ||
133 | } | ||
134 | else | ||
135 | { | ||
136 | - new_rtx = subst (XVECEXP (x, i, j), from, to, 0, | ||
137 | - unique_copy); | ||
138 | + new_rtx = subst (XVECEXP (x, i, j), from, to, 0, 0, | ||
139 | + unique_copy); | ||
140 | |||
141 | /* If this substitution failed, this whole thing | ||
142 | fails. */ | ||
143 | @@ -5165,7 +5167,9 @@ | ||
144 | && (code == SUBREG || code == STRICT_LOW_PART | ||
145 | || code == ZERO_EXTRACT)) | ||
146 | || code == SET) | ||
147 | - && i == 0), unique_copy); | ||
148 | + && i == 0), | ||
149 | + code == IF_THEN_ELSE && i == 0, | ||
150 | + unique_copy); | ||
151 | |||
152 | /* If we found that we will have to reject this combination, | ||
153 | indicate that by returning the CLOBBER ourselves, rather than | ||
154 | @@ -5222,7 +5226,7 @@ | ||
155 | /* If X is sufficiently simple, don't bother trying to do anything | ||
156 | with it. */ | ||
157 | if (code != CONST_INT && code != REG && code != CLOBBER) | ||
158 | - x = combine_simplify_rtx (x, op0_mode, in_dest); | ||
159 | + x = combine_simplify_rtx (x, op0_mode, in_dest, in_cond); | ||
160 | |||
161 | if (GET_CODE (x) == code) | ||
162 | break; | ||
163 | @@ -5242,10 +5246,12 @@ | ||
164 | expression. | ||
165 | |||
166 | OP0_MODE is the original mode of XEXP (x, 0). IN_DEST is nonzero | ||
167 | - if we are inside a SET_DEST. */ | ||
168 | + if we are inside a SET_DEST. IN_COND is nonzero if we are on the top level | ||
169 | + of a condition. */ | ||
170 | |||
171 | static rtx | ||
172 | -combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) | ||
173 | +combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest, | ||
174 | + int in_cond) | ||
175 | { | ||
176 | enum rtx_code code = GET_CODE (x); | ||
177 | enum machine_mode mode = GET_MODE (x); | ||
178 | @@ -5300,8 +5306,8 @@ | ||
179 | false arms to store-flag values. Be careful to use copy_rtx | ||
180 | here since true_rtx or false_rtx might share RTL with x as a | ||
181 | result of the if_then_else_cond call above. */ | ||
182 | - true_rtx = subst (copy_rtx (true_rtx), pc_rtx, pc_rtx, 0, 0); | ||
183 | - false_rtx = subst (copy_rtx (false_rtx), pc_rtx, pc_rtx, 0, 0); | ||
184 | + true_rtx = subst (copy_rtx (true_rtx), pc_rtx, pc_rtx, 0, 0, 0); | ||
185 | + false_rtx = subst (copy_rtx (false_rtx), pc_rtx, pc_rtx, 0, 0, 0); | ||
186 | |||
187 | /* If true_rtx and false_rtx are not general_operands, an if_then_else | ||
188 | is unlikely to be simpler. */ | ||
189 | @@ -5645,7 +5651,7 @@ | ||
190 | { | ||
191 | /* Try to simplify the expression further. */ | ||
192 | rtx tor = simplify_gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); | ||
193 | - temp = combine_simplify_rtx (tor, VOIDmode, in_dest); | ||
194 | + temp = combine_simplify_rtx (tor, VOIDmode, in_dest, 0); | ||
195 | |||
196 | /* If we could, great. If not, do not go ahead with the IOR | ||
197 | replacement, since PLUS appears in many special purpose | ||
198 | @@ -5738,7 +5744,16 @@ | ||
199 | ZERO_EXTRACT is indeed appropriate, it will be placed back by | ||
200 | the call to make_compound_operation in the SET case. */ | ||
201 | |||
202 | - if (STORE_FLAG_VALUE == 1 | ||
203 | + if (in_cond) | ||
204 | + /* Don't apply below optimizations if the caller would | ||
205 | + prefer a comparison rather than a value. | ||
206 | + E.g., for the condition in an IF_THEN_ELSE most targets need | ||
207 | + an explicit comparison. */ | ||
208 | + { | ||
209 | + ; | ||
210 | + } | ||
211 | + | ||
212 | + else if (STORE_FLAG_VALUE == 1 | ||
213 | && new_code == NE && GET_MODE_CLASS (mode) == MODE_INT | ||
214 | && op1 == const0_rtx | ||
215 | && mode == GET_MODE (op0) | ||
216 | @@ -5784,7 +5799,10 @@ | ||
217 | |||
218 | /* If STORE_FLAG_VALUE is -1, we have cases similar to | ||
219 | those above. */ | ||
220 | - if (STORE_FLAG_VALUE == -1 | ||
221 | + if (in_cond) | ||
222 | + ; | ||
223 | + | ||
224 | + else if (STORE_FLAG_VALUE == -1 | ||
225 | && new_code == NE && GET_MODE_CLASS (mode) == MODE_INT | ||
226 | && op1 == const0_rtx | ||
227 | && (num_sign_bit_copies (op0, mode) | ||
228 | @@ -5982,11 +6000,11 @@ | ||
229 | if (reg_mentioned_p (from, true_rtx)) | ||
230 | true_rtx = subst (known_cond (copy_rtx (true_rtx), true_code, | ||
231 | from, true_val), | ||
232 | - pc_rtx, pc_rtx, 0, 0); | ||
233 | + pc_rtx, pc_rtx, 0, 0, 0); | ||
234 | if (reg_mentioned_p (from, false_rtx)) | ||
235 | false_rtx = subst (known_cond (copy_rtx (false_rtx), false_code, | ||
236 | from, false_val), | ||
237 | - pc_rtx, pc_rtx, 0, 0); | ||
238 | + pc_rtx, pc_rtx, 0, 0, 0); | ||
239 | |||
240 | SUBST (XEXP (x, 1), swapped ? false_rtx : true_rtx); | ||
241 | SUBST (XEXP (x, 2), swapped ? true_rtx : false_rtx); | ||
242 | @@ -6203,11 +6221,11 @@ | ||
243 | { | ||
244 | temp = subst (simplify_gen_relational (true_code, m, VOIDmode, | ||
245 | cond_op0, cond_op1), | ||
246 | - pc_rtx, pc_rtx, 0, 0); | ||
247 | + pc_rtx, pc_rtx, 0, 0, 0); | ||
248 | temp = simplify_gen_binary (MULT, m, temp, | ||
249 | simplify_gen_binary (MULT, m, c1, | ||
250 | const_true_rtx)); | ||
251 | - temp = subst (temp, pc_rtx, pc_rtx, 0, 0); | ||
252 | + temp = subst (temp, pc_rtx, pc_rtx, 0, 0, 0); | ||
253 | temp = simplify_gen_binary (op, m, gen_lowpart (m, z), temp); | ||
254 | |||
255 | if (extend_op != UNKNOWN) | ||