]>
Commit | Line | Data |
---|---|---|
24fd5df5 PS |
1 | Index: configure |
2 | =================================================================== | |
f4818266 AM |
3 | --- configure (.../tags/gcc_4_2_0_release) (wersja 125589) |
4 | +++ configure (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
5 | @@ -7337,6 +7337,12 @@ |
6 | #line 7338 "configure" | |
7 | #include "confdefs.h" | |
8 | ||
9 | +#if (__GNUC__ < 3) \ | |
10 | + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \ | |
11 | + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1))) | |
12 | +#error http://gcc.gnu.org/PR29382 | |
13 | +#endif | |
14 | + | |
15 | int main() { | |
03ccbf4b | 16 | |
24fd5df5 PS |
17 | ; return 0; } |
18 | Index: gcc/tree-vrp.c | |
03ccbf4b | 19 | =================================================================== |
f4818266 AM |
20 | --- gcc/tree-vrp.c (.../tags/gcc_4_2_0_release) (wersja 125589) |
21 | +++ gcc/tree-vrp.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
22 | @@ -195,7 +195,28 @@ |
23 | || operand_equal_p (val, TYPE_MIN_VALUE (TREE_TYPE (val)), 0))); | |
dd66b3e5 PS |
24 | } |
25 | ||
24fd5df5 PS |
26 | +/* If VAL is now an overflow infinity, return VAL. Otherwise, return |
27 | + the same value with TREE_OVERFLOW clear. This can be used to avoid | |
28 | + confusing a regular value with an overflow value. */ | |
29 | ||
30 | +static inline tree | |
31 | +avoid_overflow_infinity (tree val) | |
dd66b3e5 | 32 | +{ |
24fd5df5 PS |
33 | + if (!is_overflow_infinity (val)) |
34 | + return val; | |
35 | + | |
36 | + if (operand_equal_p (val, TYPE_MAX_VALUE (TREE_TYPE (val)), 0)) | |
37 | + return TYPE_MAX_VALUE (TREE_TYPE (val)); | |
38 | + else | |
dd66b3e5 | 39 | + { |
24fd5df5 PS |
40 | +#ifdef ENABLE_CHECKING |
41 | + gcc_assert (operand_equal_p (val, TYPE_MIN_VALUE (TREE_TYPE (val)), 0)); | |
42 | +#endif | |
43 | + return TYPE_MIN_VALUE (TREE_TYPE (val)); | |
dd66b3e5 | 44 | + } |
dd66b3e5 PS |
45 | +} |
46 | + | |
24fd5df5 PS |
47 | + |
48 | /* Return whether VAL is equal to the maximum value of its type. This | |
49 | will be true for a positive overflow infinity. We can't do a | |
50 | simple equality comparison with TYPE_MAX_VALUE because C typedefs | |
51 | @@ -351,23 +372,11 @@ | |
52 | infinity when we shouldn't. */ | |
53 | ||
54 | static inline void | |
55 | -set_value_range_to_value (value_range_t *vr, tree val) | |
56 | +set_value_range_to_value (value_range_t *vr, tree val, bitmap equiv) | |
57 | { | |
58 | gcc_assert (is_gimple_min_invariant (val)); | |
59 | - if (is_overflow_infinity (val)) | |
60 | - { | |
61 | - if (operand_equal_p (val, TYPE_MAX_VALUE (TREE_TYPE (val)), 0)) | |
62 | - val = TYPE_MAX_VALUE (TREE_TYPE (val)); | |
63 | - else | |
64 | - { | |
65 | -#ifdef ENABLE_CHECKING | |
66 | - gcc_assert (operand_equal_p (val, | |
67 | - TYPE_MIN_VALUE (TREE_TYPE (val)), 0)); | |
68 | -#endif | |
69 | - val = TYPE_MIN_VALUE (TREE_TYPE (val)); | |
70 | - } | |
71 | - } | |
72 | - set_value_range (vr, VR_RANGE, val, val, NULL); | |
73 | + val = avoid_overflow_infinity (val); | |
74 | + set_value_range (vr, VR_RANGE, val, val, equiv); | |
75 | } | |
76 | ||
dd66b3e5 | 77 | /* Set value range VR to a non-negative range of type TYPE. |
24fd5df5 PS |
78 | @@ -411,8 +420,7 @@ |
79 | static inline void | |
80 | set_value_range_to_null (value_range_t *vr, tree type) | |
81 | { | |
82 | - tree zero = build_int_cst (type, 0); | |
83 | - set_value_range (vr, VR_RANGE, zero, zero, vr->equiv); | |
84 | + set_value_range_to_value (vr, build_int_cst (type, 0), vr->equiv); | |
85 | } | |
86 | ||
87 | ||
f4818266 AM |
88 | @@ -763,7 +771,9 @@ |
89 | if (!TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (val1))) | |
90 | return -2; | |
91 | ||
92 | - if (strict_overflow_p != NULL) | |
93 | + if (strict_overflow_p != NULL | |
94 | + && (code1 == SSA_NAME || !TREE_NO_WARNING (val1)) | |
95 | + && (code2 == SSA_NAME || !TREE_NO_WARNING (val2))) | |
96 | *strict_overflow_p = true; | |
97 | ||
98 | if (code1 == SSA_NAME) | |
99 | @@ -1028,6 +1038,8 @@ | |
24fd5df5 PS |
100 | cond_code = swap_tree_comparison (TREE_CODE (cond)); |
101 | } | |
102 | ||
103 | + limit = avoid_overflow_infinity (limit); | |
104 | + | |
105 | type = TREE_TYPE (limit); | |
106 | gcc_assert (limit != var); | |
107 | ||
f4818266 AM |
108 | @@ -1167,6 +1179,8 @@ |
109 | { | |
110 | tree one = build_int_cst (type, 1); | |
111 | max = fold_build2 (MINUS_EXPR, type, max, one); | |
112 | + if (EXPR_P (max)) | |
113 | + TREE_NO_WARNING (max) = 1; | |
114 | } | |
115 | ||
116 | set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv); | |
117 | @@ -1200,6 +1214,8 @@ | |
118 | { | |
119 | tree one = build_int_cst (type, 1); | |
120 | min = fold_build2 (PLUS_EXPR, type, min, one); | |
121 | + if (EXPR_P (min)) | |
122 | + TREE_NO_WARNING (min) = 1; | |
123 | } | |
124 | ||
125 | set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv); | |
126 | @@ -1619,7 +1635,7 @@ | |
dd66b3e5 PS |
127 | if (TREE_CODE (op0) == SSA_NAME) |
128 | vr0 = *(get_value_range (op0)); | |
129 | else if (is_gimple_min_invariant (op0)) | |
24fd5df5 PS |
130 | - set_value_range_to_value (&vr0, op0); |
131 | + set_value_range_to_value (&vr0, op0, NULL); | |
dd66b3e5 PS |
132 | else |
133 | set_value_range_to_varying (&vr0); | |
134 | ||
f4818266 | 135 | @@ -1627,7 +1643,7 @@ |
dd66b3e5 PS |
136 | if (TREE_CODE (op1) == SSA_NAME) |
137 | vr1 = *(get_value_range (op1)); | |
138 | else if (is_gimple_min_invariant (op1)) | |
24fd5df5 PS |
139 | - set_value_range_to_value (&vr1, op1); |
140 | + set_value_range_to_value (&vr1, op1, NULL); | |
dd66b3e5 PS |
141 | else |
142 | set_value_range_to_varying (&vr1); | |
143 | ||
f4818266 | 144 | @@ -2006,7 +2022,7 @@ |
dd66b3e5 PS |
145 | if (TREE_CODE (op0) == SSA_NAME) |
146 | vr0 = *(get_value_range (op0)); | |
147 | else if (is_gimple_min_invariant (op0)) | |
24fd5df5 PS |
148 | - set_value_range_to_value (&vr0, op0); |
149 | + set_value_range_to_value (&vr0, op0, NULL); | |
dd66b3e5 PS |
150 | else |
151 | set_value_range_to_varying (&vr0); | |
152 | ||
f4818266 | 153 | @@ -2393,7 +2409,10 @@ |
24fd5df5 PS |
154 | its type may be different from _Bool. Convert VAL to EXPR's |
155 | type. */ | |
156 | val = fold_convert (TREE_TYPE (expr), val); | |
157 | - set_value_range (vr, VR_RANGE, val, val, vr->equiv); | |
158 | + if (is_gimple_min_invariant (val)) | |
159 | + set_value_range_to_value (vr, val, vr->equiv); | |
160 | + else | |
161 | + set_value_range (vr, VR_RANGE, val, val, vr->equiv); | |
162 | } | |
163 | else | |
164 | set_value_range_to_varying (vr); | |
f4818266 | 165 | @@ -2424,7 +2443,7 @@ |
dd66b3e5 PS |
166 | else if (TREE_CODE_CLASS (code) == tcc_comparison) |
167 | extract_range_from_comparison (vr, expr); | |
168 | else if (is_gimple_min_invariant (expr)) | |
24fd5df5 PS |
169 | - set_value_range_to_value (vr, expr); |
170 | + set_value_range_to_value (vr, expr, NULL); | |
dd66b3e5 PS |
171 | else |
172 | set_value_range_to_varying (vr); | |
173 | ||
f4818266 AM |
174 | @@ -2545,6 +2564,13 @@ |
175 | if (compare_values (min, max) == 1) | |
176 | return; | |
177 | } | |
178 | + | |
179 | + /* According to the loop information, the variable does not | |
180 | + overflow. If we think it does, probably because of an | |
181 | + overflow due to arithmetic on a different INF value, | |
182 | + reset now. */ | |
183 | + if (is_negative_overflow_infinity (min)) | |
184 | + min = tmin; | |
185 | } | |
186 | else | |
187 | { | |
188 | @@ -2557,13 +2583,62 @@ | |
189 | if (compare_values (min, max) == 1) | |
190 | return; | |
191 | } | |
192 | + | |
193 | + if (is_positive_overflow_infinity (max)) | |
194 | + max = tmax; | |
195 | } | |
196 | ||
197 | set_value_range (vr, VR_RANGE, min, max, vr->equiv); | |
198 | } | |
199 | } | |
200 | ||
201 | +/* Return true if VAR may overflow at STMT. This checks any available | |
202 | + loop information to see if we can determine that VAR does not | |
203 | + overflow. */ | |
204 | ||
205 | +static bool | |
206 | +vrp_var_may_overflow (tree var, tree stmt) | |
207 | +{ | |
208 | + struct loop *l; | |
209 | + tree chrec, init, step; | |
210 | + | |
211 | + if (current_loops == NULL) | |
212 | + return true; | |
213 | + | |
214 | + l = loop_containing_stmt (stmt); | |
215 | + if (l == NULL) | |
216 | + return true; | |
217 | + | |
218 | + chrec = instantiate_parameters (l, analyze_scalar_evolution (l, var)); | |
219 | + if (TREE_CODE (chrec) != POLYNOMIAL_CHREC) | |
220 | + return true; | |
221 | + | |
222 | + init = initial_condition_in_loop_num (chrec, l->num); | |
223 | + step = evolution_part_in_loop_num (chrec, l->num); | |
224 | + | |
225 | + if (step == NULL_TREE | |
226 | + || !is_gimple_min_invariant (step) | |
227 | + || !valid_value_p (init)) | |
228 | + return true; | |
229 | + | |
230 | + /* If we get here, we know something useful about VAR based on the | |
231 | + loop information. If it wraps, it may overflow. */ | |
232 | + | |
233 | + if (scev_probably_wraps_p (init, step, stmt, | |
234 | + current_loops->parray[CHREC_VARIABLE (chrec)], | |
235 | + true)) | |
236 | + return true; | |
237 | + | |
238 | + if (dump_file && (dump_flags & TDF_DETAILS) != 0) | |
239 | + { | |
240 | + print_generic_expr (dump_file, var, 0); | |
241 | + fprintf (dump_file, ": loop information indicates does not overflow\n"); | |
242 | + } | |
243 | + | |
244 | + return false; | |
245 | +} | |
246 | + | |
247 | + | |
248 | /* Given two numeric value ranges VR0, VR1 and a comparison code COMP: | |
249 | ||
250 | - Return BOOLEAN_TRUE_NODE if VR0 COMP VR1 always returns true for | |
251 | @@ -4156,7 +4231,7 @@ | |
24fd5df5 PS |
252 | t = retval = NULL_TREE; |
253 | EXECUTE_IF_SET_IN_BITMAP (e2, 0, i2, bi2) | |
254 | { | |
255 | - bool sop; | |
256 | + bool sop = false; | |
dd66b3e5 | 257 | |
24fd5df5 | 258 | value_range_t vr2 = *(vr_value[i2]); |
dd66b3e5 | 259 | |
f4818266 AM |
260 | @@ -4773,7 +4848,8 @@ |
261 | if (vrp_val_is_max (vr_result.max)) | |
262 | goto varying; | |
263 | ||
264 | - if (!needs_overflow_infinity (TREE_TYPE (vr_result.min))) | |
265 | + if (!needs_overflow_infinity (TREE_TYPE (vr_result.min)) | |
266 | + || !vrp_var_may_overflow (lhs, phi)) | |
267 | vr_result.min = TYPE_MIN_VALUE (TREE_TYPE (vr_result.min)); | |
268 | else if (supports_overflow_infinity (TREE_TYPE (vr_result.min))) | |
269 | vr_result.min = | |
270 | @@ -4791,7 +4867,8 @@ | |
271 | if (vrp_val_is_min (vr_result.min)) | |
272 | goto varying; | |
273 | ||
274 | - if (!needs_overflow_infinity (TREE_TYPE (vr_result.max))) | |
275 | + if (!needs_overflow_infinity (TREE_TYPE (vr_result.max)) | |
276 | + || !vrp_var_may_overflow (lhs, phi)) | |
277 | vr_result.max = TYPE_MAX_VALUE (TREE_TYPE (vr_result.max)); | |
278 | else if (supports_overflow_infinity (TREE_TYPE (vr_result.max))) | |
279 | vr_result.max = | |
280 | @@ -4971,6 +5048,8 @@ | |
281 | { | |
282 | tree one = build_int_cst (TREE_TYPE (op0), 1); | |
283 | max = fold_build2 (MINUS_EXPR, TREE_TYPE (op0), max, one); | |
284 | + if (EXPR_P (max)) | |
285 | + TREE_NO_WARNING (max) = 1; | |
286 | } | |
287 | } | |
288 | else if (cond_code == GE_EXPR || cond_code == GT_EXPR) | |
289 | @@ -4984,6 +5063,8 @@ | |
290 | { | |
291 | tree one = build_int_cst (TREE_TYPE (op0), 1); | |
292 | min = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), min, one); | |
293 | + if (EXPR_P (min)) | |
294 | + TREE_NO_WARNING (min) = 1; | |
295 | } | |
296 | } | |
297 | ||
24fd5df5 | 298 | Index: gcc/DATESTAMP |
dd66b3e5 | 299 | =================================================================== |
f4818266 AM |
300 | --- gcc/DATESTAMP (.../tags/gcc_4_2_0_release) (wersja 125589) |
301 | +++ gcc/DATESTAMP (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
302 | @@ -1 +1 @@ |
303 | -20070514 | |
f4818266 | 304 | +20070609 |
24fd5df5 PS |
305 | Index: gcc/pointer-set.c |
306 | =================================================================== | |
f4818266 AM |
307 | --- gcc/pointer-set.c (.../tags/gcc_4_2_0_release) (wersja 125589) |
308 | +++ gcc/pointer-set.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
309 | @@ -22,13 +22,12 @@ |
310 | #include "system.h" | |
311 | #include "pointer-set.h" | |
312 | ||
313 | -/* A pointer sets is represented as a simple open-addressing hash | |
314 | +/* A pointer set is represented as a simple open-addressing hash | |
315 | table. Simplifications: The hash code is based on the value of the | |
316 | pointer, not what it points to. The number of buckets is always a | |
317 | power of 2. Null pointers are a reserved value. Deletion is not | |
318 | - supported. There is no mechanism for user control of hash | |
319 | - function, equality comparison, initial size, or resizing policy. | |
320 | -*/ | |
321 | + supported (yet). There is no mechanism for user control of hash | |
322 | + function, equality comparison, initial size, or resizing policy. */ | |
323 | ||
324 | struct pointer_set_t | |
03ccbf4b | 325 | { |
24fd5df5 PS |
326 | @@ -114,22 +113,16 @@ |
327 | } | |
03ccbf4b | 328 | } |
03ccbf4b | 329 | |
24fd5df5 PS |
330 | -/* Subroutine of pointer_set_insert. Inserts P into an empty |
331 | - element of SLOTS, an array of length N_SLOTS. Returns nonzero | |
332 | - if P was already present in N_SLOTS. */ | |
333 | -static int | |
334 | +/* Subroutine of pointer_set_insert. Return the insertion slot for P into | |
335 | + an empty element of SLOTS, an array of length N_SLOTS. */ | |
336 | +static inline size_t | |
337 | insert_aux (void *p, void **slots, size_t n_slots, size_t log_slots) | |
338 | { | |
339 | size_t n = hash1 (p, n_slots, log_slots); | |
340 | while (true) | |
03ccbf4b | 341 | { |
24fd5df5 PS |
342 | - if (slots[n] == p) |
343 | - return 1; | |
344 | - else if (slots[n] == 0) | |
345 | - { | |
346 | - slots[n] = p; | |
347 | - return 0; | |
348 | - } | |
349 | + if (slots[n] == p || slots[n] == 0) | |
350 | + return n; | |
03ccbf4b | 351 | else |
24fd5df5 PS |
352 | { |
353 | ++n; | |
354 | @@ -144,12 +137,10 @@ | |
355 | int | |
356 | pointer_set_insert (struct pointer_set_t *pset, void *p) | |
03ccbf4b | 357 | { |
24fd5df5 PS |
358 | - if (insert_aux (p, pset->slots, pset->n_slots, pset->log_slots)) |
359 | - return 1; | |
360 | - | |
361 | - /* We've inserted a new element. Expand the table if necessary to keep | |
362 | - the load factor small. */ | |
363 | - ++pset->n_elements; | |
364 | + size_t n; | |
365 | + | |
366 | + /* For simplicity, expand the set even if P is already there. This can be | |
367 | + superfluous but can happen at most once. */ | |
368 | if (pset->n_elements > pset->n_slots / 4) | |
03ccbf4b | 369 | { |
24fd5df5 PS |
370 | size_t new_log_slots = pset->log_slots + 1; |
371 | @@ -158,9 +149,10 @@ | |
372 | size_t i; | |
03ccbf4b | 373 | |
24fd5df5 PS |
374 | for (i = 0; i < pset->n_slots; ++i) |
375 | - { | |
376 | - if (pset->slots[i]) | |
377 | - insert_aux (pset->slots[i], new_slots, new_n_slots, new_log_slots); | |
378 | + { | |
379 | + void *value = pset->slots[i]; | |
380 | + n = insert_aux (value, new_slots, new_n_slots, new_log_slots); | |
381 | + new_slots[n] = value; | |
dd66b3e5 PS |
382 | } |
383 | ||
24fd5df5 PS |
384 | XDELETEVEC (pset->slots); |
385 | @@ -169,5 +161,144 @@ | |
386 | pset->slots = new_slots; | |
03ccbf4b | 387 | } |
03ccbf4b | 388 | |
24fd5df5 PS |
389 | + n = insert_aux (p, pset->slots, pset->n_slots, pset->log_slots); |
390 | + if (pset->slots[n]) | |
391 | + return 1; | |
03ccbf4b | 392 | + |
24fd5df5 PS |
393 | + pset->slots[n] = p; |
394 | + ++pset->n_elements; | |
395 | return 0; | |
03ccbf4b | 396 | } |
dd66b3e5 | 397 | + |
24fd5df5 PS |
398 | +/* Pass each pointer in PSET to the function in FN, together with the fixed |
399 | + parameter DATA. If FN returns false, the iteration stops. */ | |
dd66b3e5 | 400 | + |
24fd5df5 PS |
401 | +void pointer_set_traverse (struct pointer_set_t *pset, |
402 | + bool (*fn) (void *, void *), void *data) | |
403 | +{ | |
404 | + size_t i; | |
405 | + for (i = 0; i < pset->n_slots; ++i) | |
406 | + if (pset->slots[i] && !fn (pset->slots[i], data)) | |
407 | + break; | |
408 | +} | |
dd66b3e5 | 409 | + |
24fd5df5 PS |
410 | +\f |
411 | +/* A pointer map is represented the same way as a pointer_set, so | |
412 | + the hash code is based on the address of the key, rather than | |
413 | + its contents. Null keys are a reserved value. Deletion is not | |
414 | + supported (yet). There is no mechanism for user control of hash | |
415 | + function, equality comparison, initial size, or resizing policy. */ | |
dd66b3e5 | 416 | + |
24fd5df5 PS |
417 | +struct pointer_map_t |
418 | +{ | |
419 | + size_t log_slots; | |
420 | + size_t n_slots; /* n_slots = 2^log_slots */ | |
421 | + size_t n_elements; | |
dd66b3e5 | 422 | + |
24fd5df5 PS |
423 | + void **keys; |
424 | + void **values; | |
425 | +}; | |
dd66b3e5 | 426 | + |
24fd5df5 PS |
427 | +/* Allocate an empty pointer map. */ |
428 | +struct pointer_map_t * | |
429 | +pointer_map_create (void) | |
430 | +{ | |
431 | + struct pointer_map_t *result = XNEW (struct pointer_map_t); | |
dd66b3e5 | 432 | + |
24fd5df5 PS |
433 | + result->n_elements = 0; |
434 | + result->log_slots = 8; | |
435 | + result->n_slots = (size_t) 1 << result->log_slots; | |
dd66b3e5 | 436 | + |
24fd5df5 PS |
437 | + result->keys = XCNEWVEC (void *, result->n_slots); |
438 | + result->values = XCNEWVEC (void *, result->n_slots); | |
439 | + return result; | |
440 | +} | |
dd66b3e5 | 441 | + |
24fd5df5 PS |
442 | +/* Reclaims all memory associated with PMAP. */ |
443 | +void pointer_map_destroy (struct pointer_map_t *pmap) | |
444 | +{ | |
445 | + XDELETEVEC (pmap->keys); | |
446 | + XDELETEVEC (pmap->values); | |
447 | + XDELETE (pmap); | |
448 | +} | |
dd66b3e5 | 449 | + |
24fd5df5 PS |
450 | +/* Returns a pointer to the value to which P maps, if PMAP contains P. P |
451 | + must be nonnull. Return NULL if PMAP does not contain P. | |
dd66b3e5 | 452 | + |
24fd5df5 PS |
453 | + Collisions are resolved by linear probing. */ |
454 | +void ** | |
455 | +pointer_map_contains (struct pointer_map_t *pmap, void *p) | |
456 | +{ | |
457 | + size_t n = hash1 (p, pmap->n_slots, pmap->log_slots); | |
dd66b3e5 | 458 | + |
24fd5df5 PS |
459 | + while (true) |
460 | + { | |
461 | + if (pmap->keys[n] == p) | |
462 | + return &pmap->values[n]; | |
463 | + else if (pmap->keys[n] == 0) | |
464 | + return NULL; | |
465 | + else | |
466 | + { | |
467 | + ++n; | |
468 | + if (n == pmap->n_slots) | |
469 | + n = 0; | |
470 | + } | |
471 | + } | |
472 | +} | |
dd66b3e5 | 473 | + |
24fd5df5 PS |
474 | +/* Inserts P into PMAP if it wasn't already there. Returns a pointer |
475 | + to the value. P must be nonnull. */ | |
476 | +void ** | |
477 | +pointer_map_insert (struct pointer_map_t *pmap, void *p) | |
478 | +{ | |
479 | + size_t n; | |
dd66b3e5 | 480 | + |
24fd5df5 PS |
481 | + /* For simplicity, expand the map even if P is already there. This can be |
482 | + superfluous but can happen at most once. */ | |
483 | + if (pmap->n_elements > pmap->n_slots / 4) | |
484 | + { | |
485 | + size_t new_log_slots = pmap->log_slots + 1; | |
486 | + size_t new_n_slots = pmap->n_slots * 2; | |
487 | + void **new_keys = XCNEWVEC (void *, new_n_slots); | |
488 | + void **new_values = XCNEWVEC (void *, new_n_slots); | |
489 | + size_t i; | |
490 | + | |
491 | + for (i = 0; i < pmap->n_slots; ++i) | |
492 | + if (pmap->keys[i]) | |
493 | + { | |
494 | + void *key = pmap->keys[i]; | |
495 | + n = insert_aux (key, new_keys, new_n_slots, new_log_slots); | |
496 | + new_keys[n] = key; | |
497 | + new_values[n] = pmap->values[i]; | |
498 | + } | |
dd66b3e5 | 499 | + |
24fd5df5 PS |
500 | + XDELETEVEC (pmap->keys); |
501 | + XDELETEVEC (pmap->values); | |
502 | + pmap->n_slots = new_n_slots; | |
503 | + pmap->log_slots = new_log_slots; | |
504 | + pmap->keys = new_keys; | |
505 | + pmap->values = new_values; | |
506 | + } | |
dd66b3e5 | 507 | + |
24fd5df5 PS |
508 | + n = insert_aux (p, pmap->keys, pmap->n_slots, pmap->log_slots); |
509 | + if (!pmap->keys[n]) | |
510 | + { | |
511 | + ++pmap->n_elements; | |
512 | + pmap->keys[n] = p; | |
513 | + } | |
dd66b3e5 | 514 | + |
24fd5df5 PS |
515 | + return &pmap->values[n]; |
516 | +} | |
dd66b3e5 | 517 | + |
24fd5df5 PS |
518 | +/* Pass each pointer in PMAP to the function in FN, together with the pointer |
519 | + to the value and the fixed parameter DATA. If FN returns false, the | |
520 | + iteration stops. */ | |
dd66b3e5 | 521 | + |
24fd5df5 PS |
522 | +void pointer_map_traverse (struct pointer_map_t *pmap, |
523 | + bool (*fn) (void *, void **, void *), void *data) | |
524 | +{ | |
525 | + size_t i; | |
526 | + for (i = 0; i < pmap->n_slots; ++i) | |
527 | + if (pmap->keys[i] && !fn (pmap->keys[i], &pmap->values[i], data)) | |
528 | + break; | |
529 | +} | |
530 | Index: gcc/pointer-set.h | |
531 | =================================================================== | |
f4818266 AM |
532 | --- gcc/pointer-set.h (.../tags/gcc_4_2_0_release) (wersja 125589) |
533 | +++ gcc/pointer-set.h (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
534 | @@ -22,11 +22,21 @@ |
535 | #define POINTER_SET_H | |
536 | ||
537 | struct pointer_set_t; | |
538 | - | |
539 | struct pointer_set_t *pointer_set_create (void); | |
540 | void pointer_set_destroy (struct pointer_set_t *pset); | |
541 | ||
542 | int pointer_set_contains (struct pointer_set_t *pset, void *p); | |
543 | int pointer_set_insert (struct pointer_set_t *pset, void *p); | |
544 | +void pointer_set_traverse (struct pointer_set_t *, bool (*) (void *, void *), | |
545 | + void *); | |
546 | ||
547 | +struct pointer_map_t; | |
548 | +struct pointer_map_t *pointer_map_create (void); | |
549 | +void pointer_map_destroy (struct pointer_map_t *pmap); | |
dd66b3e5 | 550 | + |
24fd5df5 PS |
551 | +void **pointer_map_contains (struct pointer_map_t *pmap, void *p); |
552 | +void **pointer_map_insert (struct pointer_map_t *pmap, void *p); | |
553 | +void pointer_map_traverse (struct pointer_map_t *, | |
554 | + bool (*) (void *, void **, void *), void *); | |
dd66b3e5 | 555 | + |
24fd5df5 PS |
556 | #endif /* POINTER_SET_H */ |
557 | Index: gcc/fold-const.c | |
558 | =================================================================== | |
f4818266 AM |
559 | --- gcc/fold-const.c (.../tags/gcc_4_2_0_release) (wersja 125589) |
560 | +++ gcc/fold-const.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
561 | @@ -4450,13 +4450,24 @@ | |
562 | { | |
563 | low = range_successor (high1); | |
564 | high = high0; | |
565 | - in_p = (low != 0); | |
566 | + in_p = 1; | |
567 | + if (low == 0) | |
568 | + { | |
569 | + /* We are in the weird situation where high0 > high1 but | |
570 | + high1 has no successor. Punt. */ | |
571 | + return 0; | |
572 | + } | |
573 | } | |
574 | else if (! subset || highequal) | |
575 | { | |
576 | low = low0; | |
577 | high = range_predecessor (low1); | |
578 | - in_p = (high != 0); | |
579 | + in_p = 1; | |
580 | + if (high == 0) | |
581 | + { | |
582 | + /* low0 < low1 but low1 has no predecessor. Punt. */ | |
583 | + return 0; | |
584 | + } | |
585 | } | |
586 | else | |
587 | return 0; | |
588 | @@ -4476,7 +4487,12 @@ | |
589 | { | |
590 | low = range_successor (high0); | |
591 | high = high1; | |
592 | - in_p = (low != 0); | |
593 | + in_p = 1; | |
594 | + if (low == 0) | |
595 | + { | |
596 | + /* high1 > high0 but high0 has no successor. Punt. */ | |
597 | + return 0; | |
598 | + } | |
599 | } | |
600 | } | |
601 | ||
602 | @@ -12634,9 +12650,14 @@ | |
24fd5df5 PS |
603 | /* ... fall through ... */ |
604 | ||
605 | default: | |
606 | - if (truth_value_p (TREE_CODE (t))) | |
607 | - /* Truth values evaluate to 0 or 1, which is nonnegative. */ | |
608 | - return 1; | |
609 | + { | |
610 | + tree type = TREE_TYPE (t); | |
611 | + if ((TYPE_PRECISION (type) != 1 || TYPE_UNSIGNED (type)) | |
612 | + && truth_value_p (TREE_CODE (t))) | |
613 | + /* Truth values evaluate to 0 or 1, which is nonnegative unless we | |
614 | + have a signed:1 type (where the value is -1 and 0). */ | |
615 | + return true; | |
616 | + } | |
617 | } | |
618 | ||
619 | /* We don't know sign of `t', so be conservative and return false. */ | |
620 | Index: gcc/DEV-PHASE | |
621 | =================================================================== | |
f4818266 AM |
622 | --- gcc/DEV-PHASE (.../tags/gcc_4_2_0_release) (wersja 125589) |
623 | +++ gcc/DEV-PHASE (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
624 | @@ -0,0 +1 @@ |
625 | +prerelease | |
626 | Index: gcc/ChangeLog | |
627 | =================================================================== | |
f4818266 AM |
628 | --- gcc/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589) |
629 | +++ gcc/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589) | |
630 | @@ -1,3 +1,201 @@ | |
631 | +2007-06-08 Kaz Kojima <kkojima@gcc.gnu.org> | |
632 | + | |
633 | + PR target/32163 | |
634 | + Backport from mainline. | |
635 | + * config/sh/sh.md (symGOT_load): Don't schedule insns when | |
636 | + the symbol is generated with the stack protector. | |
637 | + | |
638 | +2007-06-06 Ian Lance Taylor <iant@google.com> | |
639 | + | |
640 | + * fold-const.c (merge_ranges): If range_successor or | |
641 | + range_predecessor fail, just return 0. | |
642 | + | |
643 | +2007-06-05 Ian Lance Taylor <iant@google.com> | |
644 | + | |
645 | + * tree-vrp.c (compare_values_warnv): Check TREE_NO_WARNING on a | |
646 | + PLUS_EXPR or MINUS_EXPR node before setting *strict_overflow_p. | |
647 | + (extract_range_from_assert): Set TREE_NO_WARNING when creating an | |
648 | + expression. | |
649 | + (test_for_singularity): Likewise. | |
650 | + | |
651 | +2007-06-04 Ian Lance Taylor <iant@google.com> | |
652 | + | |
653 | + * tree-vrp.c (adjust_range_with_scev): When loop is not expected | |
654 | + to overflow, reduce overflow infinity to regular infinity. | |
655 | + (vrp_var_may_overflow): New static function. | |
656 | + (vrp_visit_phi_node): Check vrp_var_may_overflow. | |
657 | + | |
24fd5df5 | 658 | +2007-05-31 H.J. Lu <hongjiu.lu@intel.com> |
dd66b3e5 | 659 | + |
24fd5df5 PS |
660 | + Backport from mainline: |
661 | + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com> | |
dd66b3e5 | 662 | + |
24fd5df5 PS |
663 | + * config/i386/i386.c (__builtin_ia32_vec_ext_v2df): Mark it |
664 | + with MASK_SSE2. | |
665 | + (__builtin_ia32_vec_ext_v2di): Likewise. | |
666 | + (__builtin_ia32_vec_ext_v4si): Likewise. | |
667 | + (__builtin_ia32_vec_ext_v8hi): Likewise. | |
668 | + (__builtin_ia32_vec_set_v8hi): Likewise. | |
dd66b3e5 | 669 | + |
24fd5df5 | 670 | +2007-05-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> |
dd66b3e5 | 671 | + |
24fd5df5 PS |
672 | + Backport from mainline: |
673 | + 2007-05-05 Aurelien Jarno <aurelien@aurel32.net> | |
dd66b3e5 | 674 | + |
24fd5df5 PS |
675 | + * config/pa/pa.md: Split tgd_load, tld_load and tie_load |
676 | + into pic and non-pic versions. Mark r19 as used for | |
677 | + tgd_load_pic, tld_load_pic and tie_load_pic. Mark r27 as used | |
678 | + for tgd_load, tld_load and tie_load . | |
679 | + * config/pa/pa.c (legitimize_tls_address): Emit pic or non-pic | |
680 | + version of tgd_load, tld_load and tie_load depending on the | |
681 | + value of flag_pic. | |
dd66b3e5 | 682 | + |
24fd5df5 | 683 | +2007-05-27 Daniel Berlin <dberlin@dberlin.org> |
dd66b3e5 | 684 | + |
24fd5df5 PS |
685 | + Fix PR/30052 |
686 | + Backport PTA solver from mainline | |
dd66b3e5 | 687 | + |
24fd5df5 PS |
688 | + * pointer-set.c: Copy from mainline |
689 | + * pointer-set.h: Ditto. | |
690 | + * tree-ssa-structalias.c: Copy solver portions from mainline. | |
691 | + * Makefile.in (tree-ssa-structalias.o): Update dependencies | |
dd66b3e5 | 692 | + |
24fd5df5 | 693 | +2007-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> |
dd66b3e5 | 694 | + |
24fd5df5 | 695 | + * tree-vrp.c (compare_names): Initialize sop. |
dd66b3e5 | 696 | + |
24fd5df5 | 697 | +2007-05-30 Jakub Jelinek <jakub@redhat.com> |
dd66b3e5 | 698 | + |
24fd5df5 PS |
699 | + PR tree-optimization/31769 |
700 | + * except.c (duplicate_eh_regions): Clear prev_try if | |
701 | + ERT_MUST_NOT_THROW region is inside of ERT_TRY region. | |
dd66b3e5 | 702 | + |
24fd5df5 | 703 | +2007-05-28 Andrew Pinski <andrew_pinski@playstation.sony.com> |
dd66b3e5 | 704 | + |
24fd5df5 PS |
705 | + PR tree-opt/32100 |
706 | + * fold-const.c (tree_expr_nonnegative_warnv_p): Don't | |
707 | + return true when truth_value_p is true and the type | |
708 | + is of signed:1. | |
dd66b3e5 | 709 | + |
24fd5df5 | 710 | +2007-05-27 H.J. Lu <hongjiu.lu@intel.com> |
dd66b3e5 | 711 | + |
24fd5df5 PS |
712 | + Backport from mainline: |
713 | + 2007-05-25 Uros Bizjak <ubizjak@gmail.com> | |
714 | + | |
715 | + * config/i386/sse.md (*vec_extractv2di_1_sse2): Do not calculate | |
716 | + "memory" attribute for "sseishft" type insn without operands[2]. | |
717 | + | |
718 | + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com> | |
719 | + | |
720 | + * config/i386/sse.md (*vec_extractv2di_1_sse2): Correct shift. | |
721 | + | |
722 | +2007-05-22 Ian Lance Taylor <iant@google.com> | |
723 | + | |
724 | + * tree-vrp.c (avoid_overflow_infinity): New static function, | |
725 | + broken out of set_value_range_to_value. | |
726 | + (set_value_range_to_value): Call avoid_overflow_infinity. | |
727 | + (extract_range_from_assert): Likewise. | |
728 | + | |
729 | +2007-05-23 Chen Liqin <liqin@sunnorth.com.cn> | |
730 | + | |
731 | + PR target/30987 | |
732 | + * config/score/misc.md (bitclr_c, bitset_c, bittgl_c): remove. | |
733 | + * config/score/predicate.md (const_pow2, const_npow2): remove. | |
734 | + * config/score/score.h (ASM_OUTPUT_EXTERNAL): add ASM_OUTPUT_EXTERNAL undef. | |
735 | + PR target/30474 | |
736 | + * config/score/score.c (score_print_operand): makes sure that only lower | |
737 | + bits are used. | |
738 | + | |
739 | +2007-05-21 Uros Bizjak <ubizjak@gmail.com> | |
740 | + | |
741 | + PR target/31167 | |
742 | + Backport from mainline. | |
743 | + * config/i386/i386.md (*addti3_1, *addti3_1 splitter): Use | |
744 | + x86_64_general_operand as operand[2] predicate. Remove "iF" | |
745 | + from operand constraints and use "e" constraint instead. | |
746 | + (*subti3_1, *subti3_1 splitter): Ditto. | |
747 | + (*negti2_1, *negti2_1 splitter): Use nonimmediate_operand as | |
748 | + operand[1] predicate. | |
749 | + | |
750 | +2007-05-21 Uros Bizjak <ubizjak@gmail.com> | |
751 | + | |
752 | + PR target/30041 | |
753 | + Backport from mainline. | |
754 | + * config/i386/sse.md ("*sse3_movddup"): Use operands[0] and | |
755 | + operands[1] in insn constraint. Correct type attribute to sselog1. | |
756 | + | |
757 | +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org> | |
758 | + | |
759 | + PR target/31701 | |
760 | + Backport from mainline. | |
761 | + * config/sh/sh.c (output_stack_adjust): Avoid using the frame | |
762 | + register itself to hold the offset constant. Tell flow the use | |
763 | + of r4 and r5 when they are used. | |
764 | + | |
765 | +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org> | |
766 | + | |
767 | + PR target/31480 | |
768 | + Backport from mainline. | |
769 | + * config/sh/sh.md (length): Check if prev_nonnote_insn (insn) | |
770 | + is null. | |
771 | + | |
772 | +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org> | |
773 | + | |
774 | + PR target/31022 | |
775 | + Backport from mainline. | |
776 | + * config/sh/sh.c (sh_adjust_cost): Use the result of single_set | |
777 | + instead of PATTERN. | |
778 | + | |
779 | +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org> | |
780 | + | |
781 | + PR target/27405 | |
782 | + Backport from mainline. | |
783 | + * config/sh/sh.md (cmp{eq,gt,gtu}{si,di}_media): Remove. | |
784 | + (cmpsi{eq,gt,gtu}{si,di}_media): Rename to | |
785 | + cmp{eq,gt,gtu}{si,di}_media. | |
786 | + (*cmpne0si_media): Remove. | |
787 | + (*movsicc_umin): Adjust gen_cmp*_media call. | |
788 | + (unordered): Change the mode of unordered and operands[1] to | |
789 | + SImode. | |
790 | + (seq): Adjust gen_cmp*_media calls. Make the mode of | |
791 | + a temporary result of compare SImode if needed. If the mode | |
792 | + of operands[0] is DImode, extend the temporary result to DImode. | |
793 | + (slt, sle, sgt, sge, sgtu, sltu, sleu, sgue, sne): Likewise. | |
794 | + (sunorderd): Change the mode of match_operand and unorderd to | |
795 | + SImode. | |
796 | + (cmpeq{sf,df}_media): Remove. | |
797 | + (cmpsieq{sf,df}_media): Rename to cmpeq{sf,df}_media. | |
798 | + (cmp{gt,ge,un}{sf,df}_media): Change the mode of match_operand | |
799 | + and compare operation to SImode. | |
800 | + | |
801 | +2007-05-18 Joseph Myers <joseph@codesourcery.com> | |
802 | + | |
803 | + * config/soft-fp/double.h, config/soft-fp/extended.h, | |
804 | + config/soft-fp/floatundidf.c, config/soft-fp/floatundisf.c, | |
805 | + config/soft-fp/floatunsidf.c, config/soft-fp/floatunsisf.c, | |
806 | + config/soft-fp/op-2.h, config/soft-fp/op-4.h, | |
807 | + config/soft-fp/op-common.h, config/soft-fp/quad.h: Update from | |
808 | + glibc CVS. | |
809 | + | |
810 | +2007-05-17 Ian Lance Taylor <iant@google.com> | |
811 | + | |
812 | + PR tree-optimization/31953 | |
813 | + * tree-vrp.c (set_value_range_to_value): Add equiv parameter. | |
814 | + Change all callers. | |
815 | + (set_value_range_to_null): Call set_value_range_to_value. | |
816 | + (extract_range_from_comparison): Likewise. | |
817 | + | |
818 | +2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr> | |
819 | + | |
820 | + PR rtl-optimization/31691 | |
821 | + * combine.c (simplify_set): Build a new src pattern instead of | |
822 | + substituting its operands in the COMPARE case. | |
823 | + | |
824 | +2007-05-14 Mark Mitchell <mark@codesourcery.com> | |
825 | + | |
826 | + * BASE-VER: Set to 4.2.1. | |
827 | + * DEV-PHASE: Set to prerelease. | |
828 | + | |
829 | 2007-05-13 Release Manager | |
830 | ||
831 | * GCC 4.2.0 released. | |
f4818266 | 832 | @@ -307,7 +505,8 @@ |
24fd5df5 PS |
833 | 2007-04-03 Stuart Hastings <stuart@apple.com> |
834 | ||
835 | PR 31281 | |
836 | - * objc/objc-act.c (next_sjlj_build_catch_list): Delete volatile from rethrow decl. | |
837 | + * objc/objc-act.c (next_sjlj_build_catch_list): Delete volatile | |
838 | + from rethrow decl. | |
839 | * cse.c (record_jump_equiv): Bail out on CCmode comparisons. | |
840 | ||
841 | 2007-04-03 Jakub Jelinek <jakub@redhat.com> | |
842 | Index: gcc/testsuite/gcc.c-torture/execute/vrp-7.c | |
843 | =================================================================== | |
f4818266 AM |
844 | --- gcc/testsuite/gcc.c-torture/execute/vrp-7.c (.../tags/gcc_4_2_0_release) (wersja 0) |
845 | +++ gcc/testsuite/gcc.c-torture/execute/vrp-7.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
846 | @@ -0,0 +1,20 @@ |
847 | + | |
848 | +void abort (void); | |
dd66b3e5 | 849 | + |
24fd5df5 PS |
850 | +struct T |
851 | +{ | |
852 | + int b : 1; | |
853 | +} t; | |
dd66b3e5 | 854 | + |
24fd5df5 PS |
855 | +void __attribute__((noinline)) foo (int f) |
856 | +{ | |
857 | + t.b = (f & 0x10) ? 1 : 0; | |
858 | +} | |
dd66b3e5 | 859 | + |
24fd5df5 PS |
860 | +int main (void) |
861 | +{ | |
862 | + foo (0x10); | |
863 | + if (!t.b) | |
864 | + abort (); | |
865 | + return 0; | |
866 | +} | |
867 | Index: gcc/testsuite/gcc.c-torture/execute/20070517-1.c | |
868 | =================================================================== | |
f4818266 AM |
869 | --- gcc/testsuite/gcc.c-torture/execute/20070517-1.c (.../tags/gcc_4_2_0_release) (wersja 0) |
870 | +++ gcc/testsuite/gcc.c-torture/execute/20070517-1.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
871 | @@ -0,0 +1,41 @@ |
872 | +/* PR rtl-optimization/31691 */ | |
873 | +/* Origin: Chi-Hua Chen <stephaniechc-gccbug@yahoo.com> */ | |
dd66b3e5 | 874 | + |
24fd5df5 | 875 | +extern void abort (void); |
dd66b3e5 | 876 | + |
24fd5df5 | 877 | +static int get_kind(int) __attribute__ ((noinline)); |
dd66b3e5 | 878 | + |
24fd5df5 PS |
879 | +static int get_kind(int v) |
880 | +{ | |
881 | + volatile int k = v; | |
882 | + return k; | |
883 | +} | |
dd66b3e5 | 884 | + |
24fd5df5 | 885 | +static int some_call(void) __attribute__ ((noinline)); |
dd66b3e5 | 886 | + |
24fd5df5 PS |
887 | +static int some_call(void) |
888 | +{ | |
889 | + return 0; | |
890 | +} | |
03ccbf4b | 891 | + |
24fd5df5 PS |
892 | +static void example (int arg) |
893 | +{ | |
894 | + int tmp, kind = get_kind (arg); | |
03ccbf4b | 895 | + |
24fd5df5 PS |
896 | + if (kind == 9 || kind == 10 || kind == 5) |
897 | + { | |
898 | + if (some_call() == 0) | |
899 | + { | |
900 | + if (kind == 9 || kind == 10) | |
901 | + tmp = arg; | |
902 | + else | |
903 | + abort(); | |
904 | + } | |
905 | + } | |
906 | +} | |
03ccbf4b | 907 | + |
24fd5df5 PS |
908 | +int main(void) |
909 | +{ | |
910 | + example(10); | |
911 | + return 0; | |
912 | +} | |
913 | Index: gcc/testsuite/gcc.c-torture/compile/pr31953.c | |
914 | =================================================================== | |
f4818266 AM |
915 | --- gcc/testsuite/gcc.c-torture/compile/pr31953.c (.../tags/gcc_4_2_0_release) (wersja 0) |
916 | +++ gcc/testsuite/gcc.c-torture/compile/pr31953.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
917 | @@ -0,0 +1,14 @@ |
918 | +struct WView | |
919 | +{ | |
920 | + int hexedit_mode:1; | |
921 | +}; | |
922 | +toggle_hexedit_mode (struct WView *view) | |
923 | +{ | |
924 | + if (view->hexedit_mode) | |
925 | + { | |
926 | + } | |
927 | + else | |
928 | + { | |
929 | + view->hexedit_mode = !view->hexedit_mode; | |
930 | + } | |
931 | +} | |
932 | Index: gcc/testsuite/gcc.target/i386/sse2-vec-3.c | |
933 | =================================================================== | |
f4818266 AM |
934 | --- gcc/testsuite/gcc.target/i386/sse2-vec-3.c (.../tags/gcc_4_2_0_release) (wersja 0) |
935 | +++ gcc/testsuite/gcc.target/i386/sse2-vec-3.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
936 | @@ -0,0 +1,37 @@ |
937 | +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ | |
938 | +/* { dg-options "-O2 -msse2" } */ | |
03ccbf4b | 939 | + |
24fd5df5 | 940 | +#include "sse2-check.h" |
03ccbf4b | 941 | + |
24fd5df5 | 942 | +#include <emmintrin.h> |
03ccbf4b | 943 | + |
24fd5df5 PS |
944 | +static void |
945 | +sse2_test (void) | |
946 | +{ | |
947 | + union | |
948 | + { | |
949 | + __m128i x; | |
950 | + char c[16]; | |
951 | + short s[8]; | |
952 | + int i[4]; | |
953 | + long long ll[2]; | |
954 | + } val1; | |
955 | + int res[4]; | |
956 | + int masks[4]; | |
957 | + int i; | |
958 | + | |
959 | + for (i = 0; i < 16; i++) | |
960 | + val1.c[i] = i; | |
961 | + | |
962 | + res[0] = __builtin_ia32_vec_ext_v4si ((__v4si)val1.x, 0); | |
963 | + res[1] = __builtin_ia32_vec_ext_v4si ((__v4si)val1.x, 1); | |
964 | + res[2] = __builtin_ia32_vec_ext_v4si ((__v4si)val1.x, 2); | |
965 | + res[3] = __builtin_ia32_vec_ext_v4si ((__v4si)val1.x, 3); | |
966 | + | |
967 | + for (i = 0; i < 4; i++) | |
968 | + masks[i] = i; | |
969 | + | |
970 | + for (i = 0; i < 4; i++) | |
971 | + if (res[i] != val1.i [masks[i]]) | |
972 | + abort (); | |
973 | +} | |
974 | Index: gcc/testsuite/gcc.target/i386/pr31167.c | |
975 | =================================================================== | |
f4818266 AM |
976 | --- gcc/testsuite/gcc.target/i386/pr31167.c (.../tags/gcc_4_2_0_release) (wersja 0) |
977 | +++ gcc/testsuite/gcc.target/i386/pr31167.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
978 | @@ -0,0 +1,20 @@ |
979 | +/* { dg-do compile { target x86_64-*-* } } */ | |
980 | +/* { dg-options "-O" } */ | |
03ccbf4b | 981 | + |
24fd5df5 | 982 | +typedef int int32_t; |
03ccbf4b | 983 | + |
24fd5df5 PS |
984 | +int32_t round32hi (const __int128_t arg) |
985 | +{ | |
986 | + const int SHIFT = 96; | |
987 | + const int mshift = 96; | |
988 | + const __int128_t M = (~(__int128_t) 0) << mshift; | |
989 | + const __int128_t L = (~M) + 1; | |
990 | + const __int128_t L1 = ((__int128_t) L) >> 1; | |
991 | + const __int128_t Mlo = ((__int128_t) (~M)) >> 1; | |
992 | + __int128_t vv = arg & M; | |
993 | + | |
994 | + if ((arg & (L1)) && ((arg & Mlo) || (arg & L))) | |
995 | + vv += L; | |
996 | + | |
997 | + return (int32_t) (vv >> SHIFT); | |
998 | +} | |
999 | Index: gcc/testsuite/gcc.target/i386/sse2-vec-4.c | |
1000 | =================================================================== | |
f4818266 AM |
1001 | --- gcc/testsuite/gcc.target/i386/sse2-vec-4.c (.../tags/gcc_4_2_0_release) (wersja 0) |
1002 | +++ gcc/testsuite/gcc.target/i386/sse2-vec-4.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1003 | @@ -0,0 +1,41 @@ |
1004 | +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ | |
1005 | +/* { dg-options "-O2 -msse2" } */ | |
03ccbf4b | 1006 | + |
24fd5df5 | 1007 | +#include "sse2-check.h" |
03ccbf4b | 1008 | + |
24fd5df5 | 1009 | +#include <emmintrin.h> |
03ccbf4b | 1010 | + |
24fd5df5 PS |
1011 | +static void |
1012 | +sse2_test (void) | |
1013 | +{ | |
1014 | + union | |
1015 | + { | |
1016 | + __m128i x; | |
1017 | + char c[16]; | |
1018 | + short s[8]; | |
1019 | + int i[4]; | |
1020 | + long long ll[2]; | |
1021 | + } val1; | |
1022 | + short res[8]; | |
1023 | + int masks[8]; | |
1024 | + int i; | |
1025 | + | |
1026 | + for (i = 0; i < 16; i++) | |
1027 | + val1.c[i] = i; | |
1028 | + | |
1029 | + res[0] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 0); | |
1030 | + res[1] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 1); | |
1031 | + res[2] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 2); | |
1032 | + res[3] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 3); | |
1033 | + res[4] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 4); | |
1034 | + res[5] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 5); | |
1035 | + res[6] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 6); | |
1036 | + res[7] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 7); | |
1037 | + | |
1038 | + for (i = 0; i < 8; i++) | |
1039 | + masks[i] = i; | |
1040 | + | |
1041 | + for (i = 0; i < 8; i++) | |
1042 | + if (res[i] != val1.s [masks[i]]) | |
1043 | + abort (); | |
1044 | +} | |
1045 | Index: gcc/testsuite/gcc.target/i386/sse2-check.h | |
1046 | =================================================================== | |
f4818266 AM |
1047 | --- gcc/testsuite/gcc.target/i386/sse2-check.h (.../tags/gcc_4_2_0_release) (wersja 0) |
1048 | +++ gcc/testsuite/gcc.target/i386/sse2-check.h (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1049 | @@ -0,0 +1,20 @@ |
1050 | +#include <stdio.h> | |
1051 | +#include <stdlib.h> | |
03ccbf4b | 1052 | + |
24fd5df5 | 1053 | +#include "../../gcc.dg/i386-cpuid.h" |
03ccbf4b | 1054 | + |
24fd5df5 | 1055 | +static void sse2_test (void); |
03ccbf4b | 1056 | + |
24fd5df5 PS |
1057 | +int |
1058 | +main () | |
1059 | +{ | |
1060 | + unsigned long cpu_facilities; | |
1061 | + | |
1062 | + cpu_facilities = i386_cpuid_edx (); | |
03ccbf4b | 1063 | + |
24fd5df5 PS |
1064 | + /* Run SSE2 test only if host has SSE2 support. */ |
1065 | + if ((cpu_facilities & bit_SSE2)) | |
1066 | + sse2_test (); | |
03ccbf4b | 1067 | + |
24fd5df5 PS |
1068 | + exit (0); |
1069 | +} | |
1070 | Index: gcc/testsuite/gcc.target/i386/sse2-vec-1.c | |
1071 | =================================================================== | |
f4818266 AM |
1072 | --- gcc/testsuite/gcc.target/i386/sse2-vec-1.c (.../tags/gcc_4_2_0_release) (wersja 0) |
1073 | +++ gcc/testsuite/gcc.target/i386/sse2-vec-1.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1074 | @@ -0,0 +1,35 @@ |
1075 | +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ | |
1076 | +/* { dg-options "-O2 -msse2" } */ | |
03ccbf4b | 1077 | + |
24fd5df5 | 1078 | +#include "sse2-check.h" |
03ccbf4b | 1079 | + |
24fd5df5 | 1080 | +#include <emmintrin.h> |
03ccbf4b | 1081 | + |
24fd5df5 PS |
1082 | +#define msk0 0 |
1083 | +#define msk1 1 | |
03ccbf4b | 1084 | + |
24fd5df5 PS |
1085 | +static void |
1086 | +sse2_test (void) | |
1087 | +{ | |
1088 | + union | |
1089 | + { | |
1090 | + __m128d x; | |
1091 | + double d[2]; | |
1092 | + } val1; | |
1093 | + double res[2]; | |
1094 | + int masks[2]; | |
1095 | + int i; | |
03ccbf4b | 1096 | + |
24fd5df5 PS |
1097 | + val1.d[0] = 23.; |
1098 | + val1.d[1] = 45; | |
03ccbf4b | 1099 | + |
24fd5df5 PS |
1100 | + res[0] = __builtin_ia32_vec_ext_v2df ((__v2df)val1.x, msk0); |
1101 | + res[1] = __builtin_ia32_vec_ext_v2df ((__v2df)val1.x, msk1); | |
03ccbf4b | 1102 | + |
24fd5df5 PS |
1103 | + masks[0] = msk0; |
1104 | + masks[1] = msk1; | |
03ccbf4b | 1105 | + |
24fd5df5 PS |
1106 | + for (i = 0; i < 2; i++) |
1107 | + if (res[i] != val1.d [masks[i]]) | |
1108 | + abort (); | |
1109 | +} | |
1110 | Index: gcc/testsuite/gcc.target/i386/sse2-vec-5.c | |
1111 | =================================================================== | |
f4818266 AM |
1112 | --- gcc/testsuite/gcc.target/i386/sse2-vec-5.c (.../tags/gcc_4_2_0_release) (wersja 0) |
1113 | +++ gcc/testsuite/gcc.target/i386/sse2-vec-5.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1114 | @@ -0,0 +1,49 @@ |
1115 | +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ | |
1116 | +/* { dg-options "-O2 -msse2" } */ | |
03ccbf4b | 1117 | + |
24fd5df5 | 1118 | +#include "sse2-check.h" |
03ccbf4b | 1119 | + |
24fd5df5 | 1120 | +#include <emmintrin.h> |
03ccbf4b | 1121 | + |
24fd5df5 PS |
1122 | +static void |
1123 | +sse2_test (void) | |
1124 | +{ | |
1125 | + union | |
1126 | + { | |
1127 | + __m128i x; | |
1128 | + char c[16]; | |
1129 | + short s[8]; | |
1130 | + int i[4]; | |
1131 | + long long ll[2]; | |
1132 | + } val1; | |
1133 | + char res[16]; | |
1134 | + int masks[16]; | |
1135 | + int i; | |
1136 | + | |
1137 | + for (i = 0; i < 16; i++) | |
1138 | + val1.c[i] = i; | |
1139 | + | |
1140 | + res[0] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 0); | |
1141 | + res[1] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 1); | |
1142 | + res[2] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 2); | |
1143 | + res[3] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 3); | |
1144 | + res[4] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 4); | |
1145 | + res[5] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 5); | |
1146 | + res[6] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 6); | |
1147 | + res[7] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 7); | |
1148 | + res[8] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 8); | |
1149 | + res[9] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 9); | |
1150 | + res[10] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 10); | |
1151 | + res[11] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 11); | |
1152 | + res[12] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 12); | |
1153 | + res[13] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 13); | |
1154 | + res[14] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 14); | |
1155 | + res[15] = __builtin_ia32_vec_ext_v16qi ((__v16qi)val1.x, 15); | |
1156 | + | |
1157 | + for (i = 0; i < 16; i++) | |
1158 | + masks[i] = i; | |
1159 | + | |
1160 | + for (i = 0; i < 16; i++) | |
1161 | + if (res[i] != val1.c [masks[i]]) | |
1162 | + abort (); | |
1163 | +} | |
1164 | Index: gcc/testsuite/gcc.target/i386/sse2-vec-2.c | |
1165 | =================================================================== | |
f4818266 AM |
1166 | --- gcc/testsuite/gcc.target/i386/sse2-vec-2.c (.../tags/gcc_4_2_0_release) (wersja 0) |
1167 | +++ gcc/testsuite/gcc.target/i386/sse2-vec-2.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1168 | @@ -0,0 +1,35 @@ |
1169 | +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ | |
1170 | +/* { dg-options "-O2 -msse2" } */ | |
03ccbf4b | 1171 | + |
24fd5df5 | 1172 | +#include "sse2-check.h" |
03ccbf4b | 1173 | + |
24fd5df5 | 1174 | +#include <emmintrin.h> |
03ccbf4b | 1175 | + |
24fd5df5 PS |
1176 | +static void |
1177 | +sse2_test (void) | |
1178 | +{ | |
1179 | + union | |
1180 | + { | |
1181 | + __m128i x; | |
1182 | + char c[16]; | |
1183 | + short s[8]; | |
1184 | + int i[4]; | |
1185 | + long long ll[2]; | |
1186 | + } val1; | |
1187 | + long long res[2]; | |
1188 | + int masks[2]; | |
1189 | + int i; | |
1190 | + | |
1191 | + for (i = 0; i < 16; i++) | |
1192 | + val1.c[i] = i; | |
1193 | + | |
1194 | + res[0] = __builtin_ia32_vec_ext_v2di ((__v2di)val1.x, 0); | |
1195 | + res[1] = __builtin_ia32_vec_ext_v2di ((__v2di)val1.x, 1); | |
1196 | + | |
1197 | + for (i = 0; i < 2; i++) | |
1198 | + masks[i] = i; | |
1199 | + | |
1200 | + for (i = 0; i < 2; i++) | |
1201 | + if (res[i] != val1.ll [masks[i]]) | |
1202 | + abort (); | |
1203 | +} | |
1204 | Index: gcc/testsuite/gcc.target/i386/sse2-vec-6.c | |
1205 | =================================================================== | |
f4818266 AM |
1206 | --- gcc/testsuite/gcc.target/i386/sse2-vec-6.c (.../tags/gcc_4_2_0_release) (wersja 0) |
1207 | +++ gcc/testsuite/gcc.target/i386/sse2-vec-6.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1208 | @@ -0,0 +1,69 @@ |
1209 | +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ | |
1210 | +/* { dg-options "-O2 -msse2" } */ | |
03ccbf4b | 1211 | + |
24fd5df5 | 1212 | +#include "sse2-check.h" |
03ccbf4b | 1213 | + |
24fd5df5 PS |
1214 | +#include <emmintrin.h> |
1215 | +#include <string.h> | |
03ccbf4b | 1216 | + |
24fd5df5 PS |
1217 | +static void |
1218 | +sse2_test (void) | |
1219 | +{ | |
1220 | + union | |
1221 | + { | |
1222 | + __m128i x; | |
1223 | + char c[16]; | |
1224 | + short s[8]; | |
1225 | + int i[4]; | |
1226 | + long long ll[2]; | |
1227 | + } val1, res[16], tmp; | |
1228 | + short ins[8] = { 8, 5, 9, 4, 2, 6, 1, 20 }; | |
1229 | + int masks[8]; | |
1230 | + int i; | |
1231 | + | |
1232 | + for (i = 0; i < 16; i++) | |
1233 | + val1.c[i] = i; | |
1234 | + | |
1235 | + res[0].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1236 | + ins[0], 0); | |
1237 | + res[1].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1238 | + ins[0], 1); | |
1239 | + res[2].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1240 | + ins[0], 2); | |
1241 | + res[3].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1242 | + ins[0], 3); | |
1243 | + res[4].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1244 | + ins[0], 4); | |
1245 | + res[5].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1246 | + ins[0], 5); | |
1247 | + res[6].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1248 | + ins[0], 6); | |
1249 | + res[7].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1250 | + ins[0], 7); | |
1251 | + | |
1252 | + for (i = 0; i < 8; i++) | |
1253 | + masks[i] = i; | |
1254 | + | |
1255 | + for (i = 0; i < 8; i++) | |
1256 | + { | |
1257 | + tmp.x = val1.x; | |
1258 | + tmp.s[masks[i]] = ins[0]; | |
1259 | + if (memcmp (&tmp, &res[i], sizeof (tmp))) | |
1260 | + abort (); | |
1261 | + } | |
03ccbf4b | 1262 | + |
24fd5df5 PS |
1263 | + for (i = 0; i < 8; i++) |
1264 | + { | |
1265 | + res[i].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x, | |
1266 | + ins[i], 0); | |
1267 | + masks[i] = 0; | |
1268 | + } | |
03ccbf4b | 1269 | + |
24fd5df5 PS |
1270 | + for (i = 0; i < 8; i++) |
1271 | + { | |
1272 | + tmp.x = val1.x; | |
1273 | + tmp.s[masks[i]] = ins[i]; | |
1274 | + if (memcmp (&tmp, &res[i], sizeof (tmp))) | |
1275 | + abort (); | |
1276 | + } | |
1277 | +} | |
f4818266 AM |
1278 | Index: gcc/testsuite/gcc.dg/Wstrict-overflow-18.c |
1279 | =================================================================== | |
1280 | --- gcc/testsuite/gcc.dg/Wstrict-overflow-18.c (.../tags/gcc_4_2_0_release) (wersja 0) | |
1281 | +++ gcc/testsuite/gcc.dg/Wstrict-overflow-18.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
1282 | @@ -0,0 +1,22 @@ | |
1283 | +/* { dg-do compile } */ | |
1284 | +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */ | |
1285 | + | |
1286 | +/* Don't warn about an overflow when folding i > 0. The loop analysis | |
1287 | + should determine that i does not wrap. */ | |
1288 | + | |
1289 | +struct c { unsigned int a; unsigned int b; }; | |
1290 | +extern void bar (struct c *); | |
1291 | +int | |
1292 | +foo (struct c *p) | |
1293 | +{ | |
1294 | + int i; | |
1295 | + int sum = 0; | |
1296 | + | |
1297 | + for (i = 0; i < p->a - p->b; ++i) | |
1298 | + { | |
1299 | + if (i > 0) | |
1300 | + sum += 2; | |
1301 | + bar (p); | |
1302 | + } | |
1303 | + return sum; | |
1304 | +} | |
1305 | Index: gcc/testsuite/gcc.dg/Wstrict-overflow-19.c | |
1306 | =================================================================== | |
1307 | --- gcc/testsuite/gcc.dg/Wstrict-overflow-19.c (.../tags/gcc_4_2_0_release) (wersja 0) | |
1308 | +++ gcc/testsuite/gcc.dg/Wstrict-overflow-19.c (.../branches/gcc-4_2-branch) (wersja 125589) | |
1309 | @@ -0,0 +1,15 @@ | |
1310 | +/* { dg-do compile } */ | |
1311 | +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */ | |
1312 | + | |
1313 | +/* Don't warn about an overflow when threading jumps. We used to get | |
1314 | + a warning from comparing bounds generated by VRP. */ | |
1315 | + | |
1316 | +int | |
1317 | +bar(int a, int b, int n) | |
1318 | +{ | |
1319 | + if (b > a) | |
1320 | + n = a - b; | |
1321 | + if (a >= b) | |
1322 | + n = 1; | |
1323 | + return n; | |
1324 | +} | |
24fd5df5 PS |
1325 | Index: gcc/testsuite/ChangeLog |
1326 | =================================================================== | |
f4818266 AM |
1327 | --- gcc/testsuite/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589) |
1328 | +++ gcc/testsuite/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589) | |
1329 | @@ -1,3 +1,124 @@ | |
1330 | +2007-06-08 Dirk Mueller <dmueller@suse.de> | |
1331 | + | |
1332 | + PR c++/31809 | |
1333 | + Backport from mainline: | |
1334 | + 2007-05-30 Jakub Jelinek <jakub@redhat.com> | |
1335 | + | |
1336 | + * g++.dg/opt/static5.C: New test. | |
1337 | + | |
1338 | +2007-06-06 Ian Lance Taylor <iant@google.com> | |
1339 | + | |
1340 | + * g++.dg/conversion/enum1.C: New test. | |
1341 | + | |
1342 | +2007-06-05 Ian Lance Taylor <iant@google.com> | |
1343 | + | |
1344 | + * gcc.dg/Wstrict-overflow-19.c: New test. | |
1345 | + | |
1346 | +2007-06-04 Ian Lance Taylor <iant@google.com> | |
1347 | + | |
1348 | + * gcc.dg/Wstrict-overflow-18.c: New test. | |
1349 | + | |
24fd5df5 | 1350 | +2007-05-31 H.J. Lu <hongjiu.lu@intel.com> |
03ccbf4b | 1351 | + |
24fd5df5 PS |
1352 | + Backport from mainline: |
1353 | + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com> | |
03ccbf4b | 1354 | + |
24fd5df5 PS |
1355 | + * gcc.target/i386/sse2-check.h: New. |
1356 | + * gcc.target/i386/sse2-vec-1.c: Likewise. | |
1357 | + * gcc.target/i386/sse2-vec-2.c: Likewise. | |
1358 | + * gcc.target/i386/sse2-vec-3.c: Likewise. | |
1359 | + * gcc.target/i386/sse2-vec-4.c: Likewise. | |
1360 | + * gcc.target/i386/sse2-vec-5.c: Likewise. | |
1361 | + * gcc.target/i386/sse2-vec-6.c: Likewise. | |
03ccbf4b | 1362 | + |
24fd5df5 | 1363 | +2007-05-31 Paul Thomas <pault@gcc.gnu.org> |
03ccbf4b | 1364 | + |
24fd5df5 PS |
1365 | + PR fortran/31483 |
1366 | + * gfortran.dg/altreturn_5.f90: New test. | |
03ccbf4b | 1367 | + |
24fd5df5 PS |
1368 | + PR fortran/31540 |
1369 | + * gfortran.dg/char_result_5.f90: New test. | |
03ccbf4b | 1370 | + |
24fd5df5 PS |
1371 | + PR fortran/31867 |
1372 | + * gfortran.dg/char_length_5.f90: New test. | |
03ccbf4b | 1373 | + |
24fd5df5 PS |
1374 | + PR fortran/31994 |
1375 | + * gfortran.dg/array_reference_1.f90: New test. | |
03ccbf4b | 1376 | + |
24fd5df5 | 1377 | +2007-05-22 Tobias Burnus <burnus@net-b.de> |
03ccbf4b | 1378 | + |
24fd5df5 PS |
1379 | + PR fortran/31559 |
1380 | + Backport from mainline. | |
1381 | + * primary.c (match_variable): External functions | |
1382 | + are no variables. | |
03ccbf4b | 1383 | + |
24fd5df5 | 1384 | +2007-05-30 Jakub Jelinek <jakub@redhat.com> |
03ccbf4b | 1385 | + |
24fd5df5 PS |
1386 | + PR tree-optimization/31769 |
1387 | + * g++.dg/gomp/pr31769.C: New test. | |
03ccbf4b | 1388 | + |
24fd5df5 | 1389 | +2007-05-28 Andrew Pinski <andrew_pinski@playstation.sony.com> |
03ccbf4b | 1390 | + |
24fd5df5 PS |
1391 | + PR tree-opt/32100 |
1392 | + * gcc.c-torture/execute/vrp-7.c: New test. | |
1393 | + | |
1394 | +2007-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> | |
03ccbf4b | 1395 | + |
24fd5df5 PS |
1396 | + PR libfortran/31964 |
1397 | + * gfortran.fortran-torture/execute/intrinsic_bitops.f90: Update. | |
03ccbf4b | 1398 | + |
24fd5df5 | 1399 | +2007-05-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> |
03ccbf4b | 1400 | + |
24fd5df5 PS |
1401 | + PR libgfortran/31051 |
1402 | + * gfortran.dg/fmt_t_3.f90: New. | |
03ccbf4b | 1403 | + |
24fd5df5 | 1404 | +2007-05-22 Dominique d'Humieres <dominiq@lps.ens.fr> |
03ccbf4b | 1405 | + |
24fd5df5 | 1406 | + * gfortran.dg/unf_io_convert_3.f90: Fix dg directive. |
03ccbf4b | 1407 | + |
24fd5df5 | 1408 | +2007-05-22 Tobias Burnus <burnus@net-b.de> |
03ccbf4b | 1409 | + |
24fd5df5 PS |
1410 | + PR fortran/31559 |
1411 | + Backport from mainline. | |
1412 | + * func_assign.f90: New test. | |
dd66b3e5 | 1413 | + |
24fd5df5 | 1414 | +2007-05-21 Uros Bizjak <ubizjak@gmail.com> |
dd66b3e5 | 1415 | + |
24fd5df5 PS |
1416 | + PR target/31167 |
1417 | + Backport from mainline. | |
1418 | + * gcc.target/i386/pr31167.c: New test. | |
dd66b3e5 | 1419 | + |
24fd5df5 | 1420 | +2007-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> |
dd66b3e5 | 1421 | + |
24fd5df5 PS |
1422 | + PR libgfortran/31395 |
1423 | + * gfortran.dg/fmt_colon.f90: New test. | |
03ccbf4b | 1424 | + |
24fd5df5 | 1425 | +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org> |
03ccbf4b | 1426 | + |
24fd5df5 PS |
1427 | + PR fortran/31618 |
1428 | + Backport from trunk. | |
1429 | + * gfortran.dg/backspace_8.f: New test case. | |
03ccbf4b | 1430 | + |
24fd5df5 | 1431 | +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org> |
03ccbf4b | 1432 | + |
24fd5df5 PS |
1433 | + PR libfortran/31196 |
1434 | + Backport from trunk. | |
1435 | + * gfortran.dg/reshape_transpose_1.f90: New test. | |
03ccbf4b | 1436 | + |
24fd5df5 | 1437 | +2007-05-17 Ian Lance Taylor <iant@google.com> |
03ccbf4b | 1438 | + |
24fd5df5 PS |
1439 | + PR tree-optimization/31953 |
1440 | + * gcc.c-torture/compile/pr31953.c: New test. | |
03ccbf4b | 1441 | + |
24fd5df5 | 1442 | +2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr> |
03ccbf4b | 1443 | + |
24fd5df5 | 1444 | + * gcc.c-torture/execute/20070517-1.c: New test. |
03ccbf4b | 1445 | + |
24fd5df5 | 1446 | +2007-05-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> |
dd66b3e5 | 1447 | + |
24fd5df5 PS |
1448 | + PR fortran/31725 |
1449 | + * gfortran.dg/substr_4.f: New test. | |
03ccbf4b | 1450 | + |
24fd5df5 PS |
1451 | 2007-05-13 Release Manager |
1452 | ||
1453 | * GCC 4.2.0 released. | |
1454 | Index: gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_bitops.f90 | |
dd66b3e5 | 1455 | =================================================================== |
f4818266 AM |
1456 | --- gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_bitops.f90 (.../tags/gcc_4_2_0_release) (wersja 125589) |
1457 | +++ gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_bitops.f90 (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1458 | @@ -8,7 +8,8 @@ |
1459 | i = 2 | |
1460 | j = 3 | |
1461 | k = 12 | |
1462 | - | |
1463 | + a = 5 | |
1464 | + | |
1465 | if (.not. btest (i, o+1)) call abort | |
1466 | if (btest (i, o+2)) call abort | |
1467 | if (iand (i, j) .ne. 2) call abort | |
1468 | @@ -26,4 +27,6 @@ | |
1469 | if (ishftc (k, o-30) .ne. 48) call abort | |
1470 | if (ishftc (k, o+1, o+3) .ne. 9) call abort | |
1471 | if (not (i) .ne. -3) call abort | |
1472 | + if (ishftc (a, 1, bit_size(a)) .ne. 10) call abort | |
1473 | + if (ishftc (1, 1, 32) .ne. 2) call abort | |
1474 | end program | |
f4818266 AM |
1475 | Index: gcc/testsuite/g++.dg/conversion/enum1.C |
1476 | =================================================================== | |
1477 | --- gcc/testsuite/g++.dg/conversion/enum1.C (.../tags/gcc_4_2_0_release) (wersja 0) | |
1478 | +++ gcc/testsuite/g++.dg/conversion/enum1.C (.../branches/gcc-4_2-branch) (wersja 125589) | |
1479 | @@ -0,0 +1,10 @@ | |
1480 | +// { dg-do run } | |
1481 | +// { dg-options "-O2 -finline-functions" } | |
1482 | + | |
1483 | +enum E { V = 1 }; | |
1484 | +static const E E_MIN = V; | |
1485 | +static const E E_MAX = V; | |
1486 | + | |
1487 | +bool valid(E v) { return v >= E_MIN && v <= E_MAX; } | |
1488 | + | |
1489 | +int main() { return valid(E(2)); } | |
24fd5df5 PS |
1490 | Index: gcc/testsuite/g++.dg/gomp/pr31769.C |
1491 | =================================================================== | |
f4818266 AM |
1492 | --- gcc/testsuite/g++.dg/gomp/pr31769.C (.../tags/gcc_4_2_0_release) (wersja 0) |
1493 | +++ gcc/testsuite/g++.dg/gomp/pr31769.C (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1494 | @@ -0,0 +1,61 @@ |
1495 | +// PR tree-optimization/31769 | |
1496 | +// { dg-options "-O2 -fopenmp" } | |
1497 | +// { dg-do compile } | |
dd66b3e5 | 1498 | + |
24fd5df5 | 1499 | +struct B |
dd66b3e5 | 1500 | +{ |
24fd5df5 PS |
1501 | + B () {} |
1502 | + virtual ~B () {} | |
dd66b3e5 | 1503 | +}; |
24fd5df5 | 1504 | +struct C |
03ccbf4b | 1505 | +{ |
24fd5df5 PS |
1506 | + C (int x, int y) {} |
1507 | +}; | |
1508 | +template<typename T, int U> | |
1509 | +struct D | |
03ccbf4b | 1510 | +{ |
24fd5df5 PS |
1511 | + D () {} |
1512 | + ~D () {} | |
1513 | +}; | |
1514 | +struct E | |
dd66b3e5 | 1515 | +{ |
24fd5df5 PS |
1516 | + E () {} |
1517 | + ~E () {} | |
1518 | + D<int, 1> e; | |
1519 | +}; | |
1520 | +struct A | |
dd66b3e5 | 1521 | +{ |
24fd5df5 PS |
1522 | + B *b; |
1523 | + A () { b = __null; } | |
1524 | + ~A () { if (b != __null) delete b; } | |
1525 | +}; | |
1526 | +struct F : public A | |
dd66b3e5 | 1527 | +{ |
24fd5df5 PS |
1528 | + explicit F (int x) { foo (0); } |
1529 | + F (const F &x) {} | |
1530 | + F (F &x, C y) {} | |
1531 | + F operator () (C x) const | |
1532 | + { | |
1533 | + return F (const_cast<F &>(*this), x); | |
1534 | + } | |
1535 | + template <typename U> F & operator+= (const U &); | |
1536 | + void foo (int); | |
1537 | + E f; | |
1538 | +}; | |
dd66b3e5 | 1539 | + |
24fd5df5 PS |
1540 | +int |
1541 | +main () | |
dd66b3e5 | 1542 | +{ |
24fd5df5 PS |
1543 | + try |
1544 | + { | |
1545 | + F f (10); | |
1546 | + F g (10); | |
1547 | + C h (0, 9); | |
1548 | +#pragma omp parallel for | |
1549 | + for (int i = 0; i < 2; ++i) | |
1550 | + g += f (h); | |
1551 | + } | |
1552 | + catch (int &e) | |
1553 | + { | |
1554 | + } | |
dd66b3e5 | 1555 | +} |
f4818266 AM |
1556 | Index: gcc/testsuite/g++.dg/opt/static5.C |
1557 | =================================================================== | |
1558 | --- gcc/testsuite/g++.dg/opt/static5.C (.../tags/gcc_4_2_0_release) (wersja 0) | |
1559 | +++ gcc/testsuite/g++.dg/opt/static5.C (.../branches/gcc-4_2-branch) (wersja 125589) | |
1560 | @@ -0,0 +1,29 @@ | |
1561 | +// PR c++/31809 | |
1562 | +// { dg-do run } | |
1563 | +// { dg-options "-O2" } | |
1564 | + | |
1565 | +struct S | |
1566 | +{ | |
1567 | + unsigned v; | |
1568 | + static inline S f (unsigned a); | |
1569 | +}; | |
1570 | + | |
1571 | +inline S | |
1572 | +S::f (unsigned a) | |
1573 | +{ | |
1574 | + static S t = { a }; | |
1575 | + return t; | |
1576 | +} | |
1577 | + | |
1578 | +const static S s = S::f (26); | |
1579 | + | |
1580 | +extern "C" void abort (void); | |
1581 | + | |
1582 | +int | |
1583 | +main () | |
1584 | +{ | |
1585 | + S t = s; | |
1586 | + if (t.v != 26) | |
1587 | + abort (); | |
1588 | + return 0; | |
1589 | +} | |
24fd5df5 | 1590 | Index: gcc/testsuite/gfortran.dg/char_length_5.f90 |
dd66b3e5 | 1591 | =================================================================== |
f4818266 AM |
1592 | --- gcc/testsuite/gfortran.dg/char_length_5.f90 (.../tags/gcc_4_2_0_release) (wersja 0) |
1593 | +++ gcc/testsuite/gfortran.dg/char_length_5.f90 (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1594 | @@ -0,0 +1,61 @@ |
1595 | +! { dg-do run } | |
1596 | +! Tests the fix for PR31867, in which the interface evaluation | |
1597 | +! of the character length of 'join' (ie. the length available in | |
1598 | +! the caller) was wrong. | |
1599 | +! | |
1600 | +! Contributed by <beliavsky@aol.com> | |
1601 | +! | |
1602 | +module util_mod | |
1603 | + implicit none | |
1604 | +contains | |
1605 | + function join (words, sep) result(str) | |
1606 | + character (len=*), intent(in) :: words(:),sep | |
1607 | + character (len = (size (words) - 1) * len_trim (sep) + & | |
1608 | + sum (len_trim (words))) :: str | |
1609 | + integer :: i,nw | |
1610 | + nw = size (words) | |
1611 | + str = "" | |
1612 | + if (nw < 1) then | |
1613 | + return | |
1614 | + else | |
1615 | + str = words(1) | |
1616 | + end if | |
1617 | + do i=2,nw | |
1618 | + str = trim (str) // trim (sep) // words(i) | |
1619 | + end do | |
1620 | + end function join | |
1621 | +end module util_mod | |
1622 | +! | |
1623 | +program xjoin | |
1624 | + use util_mod, only: join | |
1625 | + implicit none | |
1626 | + integer yy | |
1627 | + character (len=5) :: words(5:8) = (/"two ","three","four ","five "/), sep = "^#^" | |
1628 | + character (len=5) :: words2(4) = (/"bat ","ball ","goal ","stump"/), sep2 = "&" | |
1629 | + | |
1630 | + if (join (words, sep) .ne. "two^#^three^#^four^#^five") call abort () | |
1631 | + if (len (join (words, sep)) .ne. 25) call abort () | |
1632 | + | |
1633 | + if (join (words(5:6), sep) .ne. "two^#^three") call abort () | |
1634 | + if (len (join (words(5:6), sep)) .ne. 11) call abort () | |
1635 | + | |
1636 | + if (join (words(7:8), sep) .ne. "four^#^five") call abort () | |
1637 | + if (len (join (words(7:8), sep)) .ne. 11) call abort () | |
1638 | + | |
1639 | + if (join (words(5:7:2), sep) .ne. "two^#^four") call abort () | |
1640 | + if (len (join (words(5:7:2), sep)) .ne. 10) call abort () | |
1641 | + | |
1642 | + if (join (words(6:8:2), sep) .ne. "three^#^five") call abort () | |
1643 | + if (len (join (words(6:8:2), sep)) .ne. 12) call abort () | |
1644 | + | |
1645 | + if (join (words2, sep2) .ne. "bat&ball&goal&stump") call abort () | |
1646 | + if (len (join (words2, sep2)) .ne. 19) call abort () | |
1647 | + | |
1648 | + if (join (words2(1:2), sep2) .ne. "bat&ball") call abort () | |
1649 | + if (len (join (words2(1:2), sep2)) .ne. 8) call abort () | |
1650 | + | |
1651 | + if (join (words2(2:4:2), sep2) .ne. "ball&stump") call abort () | |
1652 | + if (len (join (words2(2:4:2), sep2)) .ne. 10) call abort () | |
1653 | + | |
1654 | +end program xjoin | |
1655 | +! { dg-final { cleanup-modules "util_mod" } } | |
1656 | Index: gcc/testsuite/gfortran.dg/array_reference_1.f90 | |
1657 | =================================================================== | |
f4818266 AM |
1658 | --- gcc/testsuite/gfortran.dg/array_reference_1.f90 (.../tags/gcc_4_2_0_release) (wersja 0) |
1659 | +++ gcc/testsuite/gfortran.dg/array_reference_1.f90 (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1660 | @@ -0,0 +1,35 @@ |
1661 | +! { dg-do run } | |
1662 | +! Tests the fix for PR31994, aka 31867, in which the offset | |
1663 | +! of 'a' in both subroutines was being evaluated incorrectly. | |
1664 | +! The testcase for PR31867 is char_length_5.f90 | |
1665 | +! | |
1666 | +! Contributed by Elizabeth Yip <elizabeth.l.yip@boeing.com> | |
1667 | +! and Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | |
1668 | +! | |
1669 | +program main | |
1670 | + call PR31994 | |
1671 | + call PR31994_comment6 | |
1672 | +contains | |
1673 | + subroutine PR31994 | |
1674 | + implicit none | |
1675 | + complex (kind=4), dimension(2,2) :: a, b, c | |
1676 | + a(1,1) = (1.,1.) | |
1677 | + a(2,1) = (2.,2.) | |
1678 | + a(1,2) = (3.,3.) | |
1679 | + a(2,2) = (4.,4.) | |
1680 | + b=conjg (transpose (a)) | |
1681 | + c=transpose (a) | |
1682 | + c=conjg (c) | |
1683 | + if (any (b .ne. c)) call abort () | |
1684 | + end subroutine PR31994 | |
1685 | + subroutine PR31994_comment6 | |
1686 | + implicit none | |
1687 | + real ,dimension(2,2)::a | |
1688 | + integer ,dimension(2,2) :: b, c | |
1689 | + a = reshape ((/1.,2.,3.,4./), (/2,2/)) | |
1690 | + b=int (transpose(a)) | |
1691 | + c = int (a) | |
1692 | + c = transpose (c) | |
1693 | + if (any (b .ne. c)) call abort () | |
1694 | + end subroutine PR31994_comment6 | |
1695 | +END program main | |
1696 | Index: gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 | |
1697 | =================================================================== | |
f4818266 AM |
1698 | --- gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 (.../tags/gcc_4_2_0_release) (wersja 0) |
1699 | +++ gcc/testsuite/gfortran.dg/reshape_transpose_1.f90 (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1700 | @@ -0,0 +1,18 @@ |
1701 | +! { dg-do run } | |
1702 | +! PR 31196 - reshape of transposed derived types generated | |
1703 | +! wront results. | |
1704 | +program main | |
1705 | + implicit none | |
1706 | + TYPE datatype | |
1707 | + INTEGER :: I | |
1708 | + END TYPE datatype | |
1709 | + character (len=20) line1, line2 | |
1710 | + TYPE(datatype), dimension(2,2) :: data, result | |
1711 | + data(1,1)%i = 1 | |
1712 | + data(2,1)%i = 2 | |
1713 | + data(1,2)%i = 3 | |
1714 | + data(2,2)%i = 4 | |
1715 | + write (unit=line1, fmt="(4I4)") reshape(transpose(data),shape(data)) | |
1716 | + write (unit=line2, fmt="(4I4)") (/ 1, 3, 2, 4 /) | |
1717 | + if (line1 /= line2) call abort | |
1718 | +END program main | |
1719 | Index: gcc/testsuite/gfortran.dg/fmt_colon.f90 | |
1720 | =================================================================== | |
f4818266 AM |
1721 | --- gcc/testsuite/gfortran.dg/fmt_colon.f90 (.../tags/gcc_4_2_0_release) (wersja 0) |
1722 | +++ gcc/testsuite/gfortran.dg/fmt_colon.f90 (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1723 | @@ -0,0 +1,14 @@ |
1724 | +! { dg-do run } | |
1725 | +! PR31395 Colon edit descriptor is ignored. | |
1726 | +! Test case derived from PR. Prepared by Jerry DeLisle | |
1727 | +! <jvdelisle@gcc.gnu.org> | |
1728 | +PROGRAM test | |
1729 | + INTEGER :: i = 1 | |
1730 | + character(30) :: astring | |
1731 | + WRITE(astring, 10) i | |
1732 | + 10 FORMAT('i =',I2:' this should not print') | |
1733 | + if (astring.ne."i = 1") call abort | |
1734 | + write(astring, 20) i, i | |
1735 | + 20 format('i =',I2:' this should print',I2) | |
1736 | + if (astring.ne."i = 1 this should print 1") call abort | |
1737 | +END PROGRAM test | |
f4818266 | 1738 | \ brakuje znaku końca linii na końcu pliku |
24fd5df5 PS |
1739 | Index: gcc/testsuite/gfortran.dg/char_result_13.f90 |
1740 | =================================================================== | |
f4818266 AM |
1741 | --- gcc/testsuite/gfortran.dg/char_result_13.f90 (.../tags/gcc_4_2_0_release) (wersja 0) |
1742 | +++ gcc/testsuite/gfortran.dg/char_result_13.f90 (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1743 | @@ -0,0 +1,13 @@ |
1744 | +! { dg-do compile } | |
1745 | +! tests the fix for PR31540, in which the character lengths in | |
1746 | +! parentheses were not resolved. | |
1747 | +! | |
1748 | +! Contributed by Tobias Burnus <burnus@gcc.gnu.org> | |
1749 | +! | |
1750 | + subroutine pfb() | |
1751 | + implicit none | |
1752 | + external pfname1, pfname2 | |
1753 | + character ((136)) pfname1 | |
1754 | + character ((129+7)) pfname2 | |
1755 | + return | |
1756 | + end | |
1757 | Index: gcc/testsuite/gfortran.dg/altreturn_5.f90 | |
1758 | =================================================================== | |
f4818266 AM |
1759 | --- gcc/testsuite/gfortran.dg/altreturn_5.f90 (.../tags/gcc_4_2_0_release) (wersja 0) |
1760 | +++ gcc/testsuite/gfortran.dg/altreturn_5.f90 (.../branches/gcc-4_2-branch) (wersja 125589) | |
24fd5df5 PS |
1761 | @@ -0,0 +1,30 @@ |
1762 | +! { dg-do run } | |
1763 | +! Tests the fix for PR31483, in which dummy argument procedures | |
1764 | +! produced an ICE if they had an alternate return. | |
1765 | +! | |
1766 |