2 ===================================================================
3 --- configure (.../tags/gcc_4_2_0_release) (wersja 125589)
4 +++ configure (.../branches/gcc-4_2-branch) (wersja 125589)
10 + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \
11 + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1)))
12 +#error http://gcc.gnu.org/PR29382
19 ===================================================================
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)
23 || operand_equal_p (val, TYPE_MIN_VALUE (TREE_TYPE (val)), 0)));
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. */
31 +avoid_overflow_infinity (tree val)
33 + if (!is_overflow_infinity (val))
36 + if (operand_equal_p (val, TYPE_MAX_VALUE (TREE_TYPE (val)), 0))
37 + return TYPE_MAX_VALUE (TREE_TYPE (val));
40 +#ifdef ENABLE_CHECKING
41 + gcc_assert (operand_equal_p (val, TYPE_MIN_VALUE (TREE_TYPE (val)), 0));
43 + return TYPE_MIN_VALUE (TREE_TYPE (val));
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
52 infinity when we shouldn't. */
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)
58 gcc_assert (is_gimple_min_invariant (val));
59 - if (is_overflow_infinity (val))
61 - if (operand_equal_p (val, TYPE_MAX_VALUE (TREE_TYPE (val)), 0))
62 - val = TYPE_MAX_VALUE (TREE_TYPE (val));
65 -#ifdef ENABLE_CHECKING
66 - gcc_assert (operand_equal_p (val,
67 - TYPE_MIN_VALUE (TREE_TYPE (val)), 0));
69 - val = TYPE_MIN_VALUE (TREE_TYPE (val));
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);
77 /* Set value range VR to a non-negative range of type TYPE.
80 set_value_range_to_null (value_range_t *vr, tree type)
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);
89 if (!TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (val1)))
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;
98 if (code1 == SSA_NAME)
100 cond_code = swap_tree_comparison (TREE_CODE (cond));
103 + limit = avoid_overflow_infinity (limit);
105 type = TREE_TYPE (limit);
106 gcc_assert (limit != var);
108 @@ -1167,6 +1179,8 @@
110 tree one = build_int_cst (type, 1);
111 max = fold_build2 (MINUS_EXPR, type, max, one);
113 + TREE_NO_WARNING (max) = 1;
116 set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
117 @@ -1200,6 +1214,8 @@
119 tree one = build_int_cst (type, 1);
120 min = fold_build2 (PLUS_EXPR, type, min, one);
122 + TREE_NO_WARNING (min) = 1;
125 set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
126 @@ -1619,7 +1635,7 @@
127 if (TREE_CODE (op0) == SSA_NAME)
128 vr0 = *(get_value_range (op0));
129 else if (is_gimple_min_invariant (op0))
130 - set_value_range_to_value (&vr0, op0);
131 + set_value_range_to_value (&vr0, op0, NULL);
133 set_value_range_to_varying (&vr0);
135 @@ -1627,7 +1643,7 @@
136 if (TREE_CODE (op1) == SSA_NAME)
137 vr1 = *(get_value_range (op1));
138 else if (is_gimple_min_invariant (op1))
139 - set_value_range_to_value (&vr1, op1);
140 + set_value_range_to_value (&vr1, op1, NULL);
142 set_value_range_to_varying (&vr1);
144 @@ -2006,7 +2022,7 @@
145 if (TREE_CODE (op0) == SSA_NAME)
146 vr0 = *(get_value_range (op0));
147 else if (is_gimple_min_invariant (op0))
148 - set_value_range_to_value (&vr0, op0);
149 + set_value_range_to_value (&vr0, op0, NULL);
151 set_value_range_to_varying (&vr0);
153 @@ -2393,7 +2409,10 @@
154 its type may be different from _Bool. Convert VAL to EXPR's
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);
161 + set_value_range (vr, VR_RANGE, val, val, vr->equiv);
164 set_value_range_to_varying (vr);
165 @@ -2424,7 +2443,7 @@
166 else if (TREE_CODE_CLASS (code) == tcc_comparison)
167 extract_range_from_comparison (vr, expr);
168 else if (is_gimple_min_invariant (expr))
169 - set_value_range_to_value (vr, expr);
170 + set_value_range_to_value (vr, expr, NULL);
172 set_value_range_to_varying (vr);
174 @@ -2545,6 +2564,13 @@
175 if (compare_values (min, max) == 1)
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,
183 + if (is_negative_overflow_infinity (min))
188 @@ -2557,13 +2583,62 @@
189 if (compare_values (min, max) == 1)
193 + if (is_positive_overflow_infinity (max))
197 set_value_range (vr, VR_RANGE, min, max, vr->equiv);
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
206 +vrp_var_may_overflow (tree var, tree stmt)
209 + tree chrec, init, step;
211 + if (current_loops == NULL)
214 + l = loop_containing_stmt (stmt);
218 + chrec = instantiate_parameters (l, analyze_scalar_evolution (l, var));
219 + if (TREE_CODE (chrec) != POLYNOMIAL_CHREC)
222 + init = initial_condition_in_loop_num (chrec, l->num);
223 + step = evolution_part_in_loop_num (chrec, l->num);
225 + if (step == NULL_TREE
226 + || !is_gimple_min_invariant (step)
227 + || !valid_value_p (init))
230 + /* If we get here, we know something useful about VAR based on the
231 + loop information. If it wraps, it may overflow. */
233 + if (scev_probably_wraps_p (init, step, stmt,
234 + current_loops->parray[CHREC_VARIABLE (chrec)],
238 + if (dump_file && (dump_flags & TDF_DETAILS) != 0)
240 + print_generic_expr (dump_file, var, 0);
241 + fprintf (dump_file, ": loop information indicates does not overflow\n");
248 /* Given two numeric value ranges VR0, VR1 and a comparison code COMP:
250 - Return BOOLEAN_TRUE_NODE if VR0 COMP VR1 always returns true for
251 @@ -4156,7 +4231,7 @@
252 t = retval = NULL_TREE;
253 EXECUTE_IF_SET_IN_BITMAP (e2, 0, i2, bi2)
258 value_range_t vr2 = *(vr_value[i2]);
260 @@ -4773,7 +4848,8 @@
261 if (vrp_val_is_max (vr_result.max))
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)))
270 @@ -4791,7 +4867,8 @@
271 if (vrp_val_is_min (vr_result.min))
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)))
280 @@ -4971,6 +5048,8 @@
282 tree one = build_int_cst (TREE_TYPE (op0), 1);
283 max = fold_build2 (MINUS_EXPR, TREE_TYPE (op0), max, one);
285 + TREE_NO_WARNING (max) = 1;
288 else if (cond_code == GE_EXPR || cond_code == GT_EXPR)
289 @@ -4984,6 +5063,8 @@
291 tree one = build_int_cst (TREE_TYPE (op0), 1);
292 min = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), min, one);
294 + TREE_NO_WARNING (min) = 1;
299 ===================================================================
300 --- gcc/DATESTAMP (.../tags/gcc_4_2_0_release) (wersja 125589)
301 +++ gcc/DATESTAMP (.../branches/gcc-4_2-branch) (wersja 125589)
305 Index: gcc/pointer-set.c
306 ===================================================================
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)
311 #include "pointer-set.h"
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.
321 + supported (yet). There is no mechanism for user control of hash
322 + function, equality comparison, initial size, or resizing policy. */
326 @@ -114,22 +113,16 @@
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. */
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)
339 size_t n = hash1 (p, n_slots, log_slots);
344 - else if (slots[n] == 0)
349 + if (slots[n] == p || slots[n] == 0)
354 @@ -144,12 +137,10 @@
356 pointer_set_insert (struct pointer_set_t *pset, void *p)
358 - if (insert_aux (p, pset->slots, pset->n_slots, pset->log_slots))
361 - /* We've inserted a new element. Expand the table if necessary to keep
362 - the load factor small. */
363 - ++pset->n_elements;
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)
370 size_t new_log_slots = pset->log_slots + 1;
374 for (i = 0; i < pset->n_slots; ++i)
376 - if (pset->slots[i])
377 - insert_aux (pset->slots[i], new_slots, new_n_slots, new_log_slots);
379 + void *value = pset->slots[i];
380 + n = insert_aux (value, new_slots, new_n_slots, new_log_slots);
381 + new_slots[n] = value;
384 XDELETEVEC (pset->slots);
385 @@ -169,5 +161,144 @@
386 pset->slots = new_slots;
389 + n = insert_aux (p, pset->slots, pset->n_slots, pset->log_slots);
390 + if (pset->slots[n])
393 + pset->slots[n] = p;
394 + ++pset->n_elements;
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. */
401 +void pointer_set_traverse (struct pointer_set_t *pset,
402 + bool (*fn) (void *, void *), void *data)
405 + for (i = 0; i < pset->n_slots; ++i)
406 + if (pset->slots[i] && !fn (pset->slots[i], data))
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. */
417 +struct pointer_map_t
420 + size_t n_slots; /* n_slots = 2^log_slots */
427 +/* Allocate an empty pointer map. */
428 +struct pointer_map_t *
429 +pointer_map_create (void)
431 + struct pointer_map_t *result = XNEW (struct pointer_map_t);
433 + result->n_elements = 0;
434 + result->log_slots = 8;
435 + result->n_slots = (size_t) 1 << result->log_slots;
437 + result->keys = XCNEWVEC (void *, result->n_slots);
438 + result->values = XCNEWVEC (void *, result->n_slots);
442 +/* Reclaims all memory associated with PMAP. */
443 +void pointer_map_destroy (struct pointer_map_t *pmap)
445 + XDELETEVEC (pmap->keys);
446 + XDELETEVEC (pmap->values);
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.
453 + Collisions are resolved by linear probing. */
455 +pointer_map_contains (struct pointer_map_t *pmap, void *p)
457 + size_t n = hash1 (p, pmap->n_slots, pmap->log_slots);
461 + if (pmap->keys[n] == p)
462 + return &pmap->values[n];
463 + else if (pmap->keys[n] == 0)
468 + if (n == pmap->n_slots)
474 +/* Inserts P into PMAP if it wasn't already there. Returns a pointer
475 + to the value. P must be nonnull. */
477 +pointer_map_insert (struct pointer_map_t *pmap, void *p)
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)
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);
491 + for (i = 0; i < pmap->n_slots; ++i)
494 + void *key = pmap->keys[i];
495 + n = insert_aux (key, new_keys, new_n_slots, new_log_slots);
497 + new_values[n] = pmap->values[i];
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;
508 + n = insert_aux (p, pmap->keys, pmap->n_slots, pmap->log_slots);
509 + if (!pmap->keys[n])
511 + ++pmap->n_elements;
515 + return &pmap->values[n];
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. */
522 +void pointer_map_traverse (struct pointer_map_t *pmap,
523 + bool (*fn) (void *, void **, void *), void *data)
526 + for (i = 0; i < pmap->n_slots; ++i)
527 + if (pmap->keys[i] && !fn (pmap->keys[i], &pmap->values[i], data))
530 Index: gcc/pointer-set.h
531 ===================================================================
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)
535 #define POINTER_SET_H
537 struct pointer_set_t;
539 struct pointer_set_t *pointer_set_create (void);
540 void pointer_set_destroy (struct pointer_set_t *pset);
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 *),
547 +struct pointer_map_t;
548 +struct pointer_map_t *pointer_map_create (void);
549 +void pointer_map_destroy (struct pointer_map_t *pmap);
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 *);
556 #endif /* POINTER_SET_H */
557 Index: gcc/fold-const.c
558 ===================================================================
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 @@
563 low = range_successor (high1);
569 + /* We are in the weird situation where high0 > high1 but
570 + high1 has no successor. Punt. */
574 else if (! subset || highequal)
577 high = range_predecessor (low1);
578 - in_p = (high != 0);
582 + /* low0 < low1 but low1 has no predecessor. Punt. */
588 @@ -4476,7 +4487,12 @@
590 low = range_successor (high0);
596 + /* high1 > high0 but high0 has no successor. Punt. */
602 @@ -12634,9 +12650,14 @@
603 /* ... fall through ... */
606 - if (truth_value_p (TREE_CODE (t)))
607 - /* Truth values evaluate to 0 or 1, which is nonnegative. */
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). */
619 /* We don't know sign of `t', so be conservative and return false. */
621 ===================================================================
622 --- gcc/DEV-PHASE (.../tags/gcc_4_2_0_release) (wersja 125589)
623 +++ gcc/DEV-PHASE (.../branches/gcc-4_2-branch) (wersja 125589)
627 ===================================================================
628 --- gcc/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
629 +++ gcc/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
631 +2007-06-08 Kaz Kojima <kkojima@gcc.gnu.org>
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.
638 +2007-06-06 Ian Lance Taylor <iant@google.com>
640 + * fold-const.c (merge_ranges): If range_successor or
641 + range_predecessor fail, just return 0.
643 +2007-06-05 Ian Lance Taylor <iant@google.com>
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
649 + (test_for_singularity): Likewise.
651 +2007-06-04 Ian Lance Taylor <iant@google.com>
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.
658 +2007-05-31 H.J. Lu <hongjiu.lu@intel.com>
660 + Backport from mainline:
661 + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
663 + * config/i386/i386.c (__builtin_ia32_vec_ext_v2df): Mark it
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.
670 +2007-05-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
672 + Backport from mainline:
673 + 2007-05-05 Aurelien Jarno <aurelien@aurel32.net>
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
683 +2007-05-27 Daniel Berlin <dberlin@dberlin.org>
686 + Backport PTA solver from mainline
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
693 +2007-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
695 + * tree-vrp.c (compare_names): Initialize sop.
697 +2007-05-30 Jakub Jelinek <jakub@redhat.com>
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.
703 +2007-05-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
706 + * fold-const.c (tree_expr_nonnegative_warnv_p): Don't
707 + return true when truth_value_p is true and the type
710 +2007-05-27 H.J. Lu <hongjiu.lu@intel.com>
712 + Backport from mainline:
713 + 2007-05-25 Uros Bizjak <ubizjak@gmail.com>
715 + * config/i386/sse.md (*vec_extractv2di_1_sse2): Do not calculate
716 + "memory" attribute for "sseishft" type insn without operands[2].
718 + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
720 + * config/i386/sse.md (*vec_extractv2di_1_sse2): Correct shift.
722 +2007-05-22 Ian Lance Taylor <iant@google.com>
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.
729 +2007-05-23 Chen Liqin <liqin@sunnorth.com.cn>
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.
736 + * config/score/score.c (score_print_operand): makes sure that only lower
739 +2007-05-21 Uros Bizjak <ubizjak@gmail.com>
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.
750 +2007-05-21 Uros Bizjak <ubizjak@gmail.com>
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.
757 +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org>
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.
765 +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org>
768 + Backport from mainline.
769 + * config/sh/sh.md (length): Check if prev_nonnote_insn (insn)
772 +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org>
775 + Backport from mainline.
776 + * config/sh/sh.c (sh_adjust_cost): Use the result of single_set
777 + instead of PATTERN.
779 +2007-05-20 Kaz Kojima <kkojima@gcc.gnu.org>
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
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
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.
801 +2007-05-18 Joseph Myers <joseph@codesourcery.com>
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
810 +2007-05-17 Ian Lance Taylor <iant@google.com>
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.
818 +2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr>
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.
824 +2007-05-14 Mark Mitchell <mark@codesourcery.com>
826 + * BASE-VER: Set to 4.2.1.
827 + * DEV-PHASE: Set to prerelease.
829 2007-05-13 Release Manager
831 * GCC 4.2.0 released.
833 2007-04-03 Stuart Hastings <stuart@apple.com>
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
839 * cse.c (record_jump_equiv): Bail out on CCmode comparisons.
841 2007-04-03 Jakub Jelinek <jakub@redhat.com>
842 Index: gcc/testsuite/gcc.c-torture/execute/vrp-7.c
843 ===================================================================
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)
855 +void __attribute__((noinline)) foo (int f)
857 + t.b = (f & 0x10) ? 1 : 0;
867 Index: gcc/testsuite/gcc.c-torture/execute/20070517-1.c
868 ===================================================================
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)
872 +/* PR rtl-optimization/31691 */
873 +/* Origin: Chi-Hua Chen <stephaniechc-gccbug@yahoo.com> */
875 +extern void abort (void);
877 +static int get_kind(int) __attribute__ ((noinline));
879 +static int get_kind(int v)
881 + volatile int k = v;
885 +static int some_call(void) __attribute__ ((noinline));
887 +static int some_call(void)
892 +static void example (int arg)
894 + int tmp, kind = get_kind (arg);
896 + if (kind == 9 || kind == 10 || kind == 5)
898 + if (some_call() == 0)
900 + if (kind == 9 || kind == 10)
913 Index: gcc/testsuite/gcc.c-torture/compile/pr31953.c
914 ===================================================================
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)
920 + int hexedit_mode:1;
922 +toggle_hexedit_mode (struct WView *view)
924 + if (view->hexedit_mode)
929 + view->hexedit_mode = !view->hexedit_mode;
932 Index: gcc/testsuite/gcc.target/i386/sse2-vec-3.c
933 ===================================================================
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)
937 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
938 +/* { dg-options "-O2 -msse2" } */
940 +#include "sse2-check.h"
942 +#include <emmintrin.h>
959 + for (i = 0; i < 16; i++)
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);
967 + for (i = 0; i < 4; i++)
970 + for (i = 0; i < 4; i++)
971 + if (res[i] != val1.i [masks[i]])
974 Index: gcc/testsuite/gcc.target/i386/pr31167.c
975 ===================================================================
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)
979 +/* { dg-do compile { target x86_64-*-* } } */
980 +/* { dg-options "-O" } */
982 +typedef int int32_t;
984 +int32_t round32hi (const __int128_t arg)
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;
994 + if ((arg & (L1)) && ((arg & Mlo) || (arg & L)))
997 + return (int32_t) (vv >> SHIFT);
999 Index: gcc/testsuite/gcc.target/i386/sse2-vec-4.c
1000 ===================================================================
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)
1004 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
1005 +/* { dg-options "-O2 -msse2" } */
1007 +#include "sse2-check.h"
1009 +#include <emmintrin.h>
1026 + for (i = 0; i < 16; i++)
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);
1038 + for (i = 0; i < 8; i++)
1041 + for (i = 0; i < 8; i++)
1042 + if (res[i] != val1.s [masks[i]])
1045 Index: gcc/testsuite/gcc.target/i386/sse2-check.h
1046 ===================================================================
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)
1051 +#include <stdlib.h>
1053 +#include "../../gcc.dg/i386-cpuid.h"
1055 +static void sse2_test (void);
1060 + unsigned long cpu_facilities;
1062 + cpu_facilities = i386_cpuid_edx ();
1064 + /* Run SSE2 test only if host has SSE2 support. */
1065 + if ((cpu_facilities & bit_SSE2))
1070 Index: gcc/testsuite/gcc.target/i386/sse2-vec-1.c
1071 ===================================================================
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)
1075 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
1076 +/* { dg-options "-O2 -msse2" } */
1078 +#include "sse2-check.h"
1080 +#include <emmintrin.h>
1100 + res[0] = __builtin_ia32_vec_ext_v2df ((__v2df)val1.x, msk0);
1101 + res[1] = __builtin_ia32_vec_ext_v2df ((__v2df)val1.x, msk1);
1106 + for (i = 0; i < 2; i++)
1107 + if (res[i] != val1.d [masks[i]])
1110 Index: gcc/testsuite/gcc.target/i386/sse2-vec-5.c
1111 ===================================================================
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)
1115 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
1116 +/* { dg-options "-O2 -msse2" } */
1118 +#include "sse2-check.h"
1120 +#include <emmintrin.h>
1137 + for (i = 0; i < 16; i++)
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);
1157 + for (i = 0; i < 16; i++)
1160 + for (i = 0; i < 16; i++)
1161 + if (res[i] != val1.c [masks[i]])
1164 Index: gcc/testsuite/gcc.target/i386/sse2-vec-2.c
1165 ===================================================================
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)
1169 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
1170 +/* { dg-options "-O2 -msse2" } */
1172 +#include "sse2-check.h"
1174 +#include <emmintrin.h>
1191 + for (i = 0; i < 16; i++)
1194 + res[0] = __builtin_ia32_vec_ext_v2di ((__v2di)val1.x, 0);
1195 + res[1] = __builtin_ia32_vec_ext_v2di ((__v2di)val1.x, 1);
1197 + for (i = 0; i < 2; i++)
1200 + for (i = 0; i < 2; i++)
1201 + if (res[i] != val1.ll [masks[i]])
1204 Index: gcc/testsuite/gcc.target/i386/sse2-vec-6.c
1205 ===================================================================
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)
1209 +/* { dg-do run { target i?86-*-* x86_64-*-* } } */
1210 +/* { dg-options "-O2 -msse2" } */
1212 +#include "sse2-check.h"
1214 +#include <emmintrin.h>
1215 +#include <string.h>
1227 + } val1, res[16], tmp;
1228 + short ins[8] = { 8, 5, 9, 4, 2, 6, 1, 20 };
1232 + for (i = 0; i < 16; i++)
1235 + res[0].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1237 + res[1].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1239 + res[2].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1241 + res[3].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1243 + res[4].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1245 + res[5].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1247 + res[6].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1249 + res[7].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1252 + for (i = 0; i < 8; i++)
1255 + for (i = 0; i < 8; i++)
1258 + tmp.s[masks[i]] = ins[0];
1259 + if (memcmp (&tmp, &res[i], sizeof (tmp)))
1263 + for (i = 0; i < 8; i++)
1265 + res[i].x = (__m128i) __builtin_ia32_vec_set_v8hi ((__v8hi)val1.x,
1270 + for (i = 0; i < 8; i++)
1273 + tmp.s[masks[i]] = ins[i];
1274 + if (memcmp (&tmp, &res[i], sizeof (tmp)))
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)
1283 +/* { dg-do compile } */
1284 +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
1286 +/* Don't warn about an overflow when folding i > 0. The loop analysis
1287 + should determine that i does not wrap. */
1289 +struct c { unsigned int a; unsigned int b; };
1290 +extern void bar (struct c *);
1297 + for (i = 0; i < p->a - p->b; ++i)
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)
1310 +/* { dg-do compile } */
1311 +/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
1313 +/* Don't warn about an overflow when threading jumps. We used to get
1314 + a warning from comparing bounds generated by VRP. */
1317 +bar(int a, int b, int n)
1325 Index: gcc/testsuite/ChangeLog
1326 ===================================================================
1327 --- gcc/testsuite/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
1328 +++ gcc/testsuite/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
1330 +2007-06-08 Dirk Mueller <dmueller@suse.de>
1333 + Backport from mainline:
1334 + 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1336 + * g++.dg/opt/static5.C: New test.
1338 +2007-06-06 Ian Lance Taylor <iant@google.com>
1340 + * g++.dg/conversion/enum1.C: New test.
1342 +2007-06-05 Ian Lance Taylor <iant@google.com>
1344 + * gcc.dg/Wstrict-overflow-19.c: New test.
1346 +2007-06-04 Ian Lance Taylor <iant@google.com>
1348 + * gcc.dg/Wstrict-overflow-18.c: New test.
1350 +2007-05-31 H.J. Lu <hongjiu.lu@intel.com>
1352 + Backport from mainline:
1353 + 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
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.
1363 +2007-05-31 Paul Thomas <pault@gcc.gnu.org>
1366 + * gfortran.dg/altreturn_5.f90: New test.
1369 + * gfortran.dg/char_result_5.f90: New test.
1372 + * gfortran.dg/char_length_5.f90: New test.
1375 + * gfortran.dg/array_reference_1.f90: New test.
1377 +2007-05-22 Tobias Burnus <burnus@net-b.de>
1380 + Backport from mainline.
1381 + * primary.c (match_variable): External functions
1384 +2007-05-30 Jakub Jelinek <jakub@redhat.com>
1386 + PR tree-optimization/31769
1387 + * g++.dg/gomp/pr31769.C: New test.
1389 +2007-05-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
1392 + * gcc.c-torture/execute/vrp-7.c: New test.
1394 +2007-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1396 + PR libfortran/31964
1397 + * gfortran.fortran-torture/execute/intrinsic_bitops.f90: Update.
1399 +2007-05-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1401 + PR libgfortran/31051
1402 + * gfortran.dg/fmt_t_3.f90: New.
1404 +2007-05-22 Dominique d'Humieres <dominiq@lps.ens.fr>
1406 + * gfortran.dg/unf_io_convert_3.f90: Fix dg directive.
1408 +2007-05-22 Tobias Burnus <burnus@net-b.de>
1411 + Backport from mainline.
1412 + * func_assign.f90: New test.
1414 +2007-05-21 Uros Bizjak <ubizjak@gmail.com>
1417 + Backport from mainline.
1418 + * gcc.target/i386/pr31167.c: New test.
1420 +2007-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1422 + PR libgfortran/31395
1423 + * gfortran.dg/fmt_colon.f90: New test.
1425 +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org>
1428 + Backport from trunk.
1429 + * gfortran.dg/backspace_8.f: New test case.
1431 +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org>
1433 + PR libfortran/31196
1434 + Backport from trunk.
1435 + * gfortran.dg/reshape_transpose_1.f90: New test.
1437 +2007-05-17 Ian Lance Taylor <iant@google.com>
1439 + PR tree-optimization/31953
1440 + * gcc.c-torture/compile/pr31953.c: New test.
1442 +2007-05-17 Eric Botcazou <ebotcazou@libertysurf.fr>
1444 + * gcc.c-torture/execute/20070517-1.c: New test.
1446 +2007-05-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1449 + * gfortran.dg/substr_4.f: New test.
1451 2007-05-13 Release Manager
1453 * GCC 4.2.0 released.
1454 Index: gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_bitops.f90
1455 ===================================================================
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)
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
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
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)
1481 +// { dg-options "-O2 -finline-functions" }
1484 +static const E E_MIN = V;
1485 +static const E E_MAX = V;
1487 +bool valid(E v) { return v >= E_MIN && v <= E_MAX; }
1489 +int main() { return valid(E(2)); }
1490 Index: gcc/testsuite/g++.dg/gomp/pr31769.C
1491 ===================================================================
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)
1495 +// PR tree-optimization/31769
1496 +// { dg-options "-O2 -fopenmp" }
1497 +// { dg-do compile }
1506 + C (int x, int y) {}
1508 +template<typename T, int U>
1523 + A () { b = __null; }
1524 + ~A () { if (b != __null) delete b; }
1526 +struct F : public A
1528 + explicit F (int x) { foo (0); }
1531 + F operator () (C x) const
1533 + return F (const_cast<F &>(*this), x);
1535 + template <typename U> F & operator+= (const U &);
1548 +#pragma omp parallel for
1549 + for (int i = 0; i < 2; ++i)
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)
1563 +// { dg-options "-O2" }
1568 + static inline S f (unsigned a);
1574 + static S t = { a };
1578 +const static S s = S::f (26);
1580 +extern "C" void abort (void);
1590 Index: gcc/testsuite/gfortran.dg/char_length_5.f90
1591 ===================================================================
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)
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.
1600 +! Contributed by <beliavsky@aol.com>
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
1618 + str = trim (str) // trim (sep) // words(i)
1621 +end module util_mod
1624 + use util_mod, only: join
1627 + character (len=5) :: words(5:8) = (/"two ","three","four ","five "/), sep = "^#^"
1628 + character (len=5) :: words2(4) = (/"bat ","ball ","goal ","stump"/), sep2 = "&"
1630 + if (join (words, sep) .ne. "two^#^three^#^four^#^five") call abort ()
1631 + if (len (join (words, sep)) .ne. 25) call abort ()
1633 + if (join (words(5:6), sep) .ne. "two^#^three") call abort ()
1634 + if (len (join (words(5:6), sep)) .ne. 11) call abort ()
1636 + if (join (words(7:8), sep) .ne. "four^#^five") call abort ()
1637 + if (len (join (words(7:8), sep)) .ne. 11) call abort ()
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 ()
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 ()
1645 + if (join (words2, sep2) .ne. "bat&ball&goal&stump") call abort ()
1646 + if (len (join (words2, sep2)) .ne. 19) call abort ()
1648 + if (join (words2(1:2), sep2) .ne. "bat&ball") call abort ()
1649 + if (len (join (words2(1:2), sep2)) .ne. 8) call abort ()
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 ()
1655 +! { dg-final { cleanup-modules "util_mod" } }
1656 Index: gcc/testsuite/gfortran.dg/array_reference_1.f90
1657 ===================================================================
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)
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
1666 +! Contributed by Elizabeth Yip <elizabeth.l.yip@boeing.com>
1667 +! and Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1671 + call PR31994_comment6
1673 + subroutine PR31994
1675 + complex (kind=4), dimension(2,2) :: a, b, c
1680 + b=conjg (transpose (a))
1683 + if (any (b .ne. c)) call abort ()
1684 + end subroutine PR31994
1685 + subroutine PR31994_comment6
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))
1693 + if (any (b .ne. c)) call abort ()
1694 + end subroutine PR31994_comment6
1696 Index: gcc/testsuite/gfortran.dg/reshape_transpose_1.f90
1697 ===================================================================
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)
1702 +! PR 31196 - reshape of transposed derived types generated
1709 + character (len=20) line1, line2
1710 + TYPE(datatype), dimension(2,2) :: data, result
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
1719 Index: gcc/testsuite/gfortran.dg/fmt_colon.f90
1720 ===================================================================
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)
1725 +! PR31395 Colon edit descriptor is ignored.
1726 +! Test case derived from PR. Prepared by Jerry DeLisle
1727 +! <jvdelisle@gcc.gnu.org>
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
1738 \ brakuje znaku końca linii na końcu pliku
1739 Index: gcc/testsuite/gfortran.dg/char_result_13.f90
1740 ===================================================================
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)
1744 +! { dg-do compile }
1745 +! tests the fix for PR31540, in which the character lengths in
1746 +! parentheses were not resolved.
1748 +! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
1752 + external pfname1, pfname2
1753 + character ((136)) pfname1
1754 + character ((129+7)) pfname2
1757 Index: gcc/testsuite/gfortran.dg/altreturn_5.f90
1758 ===================================================================
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)
1763 +! Tests the fix for PR31483, in which dummy argument procedures
1764 +! produced an ICE if they had an alternate return.
1766 +! Contributed by Mathias Fröhlich <M.Froehlich@science-computing.de>
1768 + SUBROUTINE R (i, *, *)
1773 + SUBROUTINE PHLOAD (READER, i, res)
1778 + CALL READER (i, *1, *2)
1787 + call PHLOAD (R, 1, res)
1788 + if (res .ne. "one") call abort ()
1789 + CALL PHLOAD (R, 2, res)
1790 + if (res .ne. "two") call abort ()
1792 \ brakuje znaku końca linii na końcu pliku
1793 Index: gcc/testsuite/gfortran.dg/substr_4.f
1794 ===================================================================
1795 --- gcc/testsuite/gfortran.dg/substr_4.f (.../tags/gcc_4_2_0_release) (wersja 0)
1796 +++ gcc/testsuite/gfortran.dg/substr_4.f (.../branches/gcc-4_2-branch) (wersja 125589)
1799 + subroutine test_lower
1801 + character(3), dimension(3) :: zsymel,zsymelr
1802 + common /xx/ zsymel, zsymelr
1803 + integer :: znsymelr
1804 + zsymel = (/ 'X', 'Y', ' ' /)
1805 + zsymelr= (/ 'X', 'Y', ' ' /)
1807 + call check_zsymel(zsymel,zsymelr,znsymelr)
1811 + subroutine check_zsymel(zsymel,zsymelr,znsymelr)
1813 + integer znsymelr, isym
1814 + character(*) zsymel(*),zsymelr(*)
1815 + character(len=80) buf
1816 + zsymel(3)(lenstr(zsymel(3))+1:)='X'
1817 + write (buf,10) (trim(zsymelr(isym)),isym=1,znsymelr)
1818 +10 format(3(a,:,','))
1819 + if (trim(buf) /= 'X,Y') call abort
1820 + end subroutine check_zsymel
1822 + function lenstr(s)
1823 + character(len=*),intent(in) :: s
1825 + if (len_trim(s) /= 0) call abort
1826 + lenstr = len_trim(s)
1827 + end function lenstr
1829 + end subroutine test_lower
1831 + subroutine test_upper
1833 + character(3), dimension(3) :: zsymel,zsymelr
1834 + common /xx/ zsymel, zsymelr
1835 + integer :: znsymelr
1836 + zsymel = (/ 'X', 'Y', ' ' /)
1837 + zsymelr= (/ 'X', 'Y', ' ' /)
1839 + call check_zsymel(zsymel,zsymelr,znsymelr)
1843 + subroutine check_zsymel(zsymel,zsymelr,znsymelr)
1845 + integer znsymelr, isym
1846 + character(*) zsymel(*),zsymelr(*)
1847 + character(len=80) buf
1848 + zsymel(3)(:lenstr(zsymel(3))+1)='X'
1849 + write (buf,20) (trim(zsymelr(isym)),isym=1,znsymelr)
1850 +20 format(3(a,:,','))
1851 + if (trim(buf) /= 'X,Y') call abort
1852 + end subroutine check_zsymel
1854 + function lenstr(s)
1855 + character(len=*),intent(in) :: s
1857 + if (len_trim(s) /= 0) call abort
1858 + lenstr = len_trim(s)
1859 + end function lenstr
1861 + end subroutine test_upper
1867 Index: gcc/testsuite/gfortran.dg/fmt_t_3.f90
1868 ===================================================================
1869 --- gcc/testsuite/gfortran.dg/fmt_t_3.f90 (.../tags/gcc_4_2_0_release) (wersja 0)
1870 +++ gcc/testsuite/gfortran.dg/fmt_t_3.f90 (.../branches/gcc-4_2-branch) (wersja 125589)
1873 +! PR31051 bug with x and t format descriptors.
1874 +! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org> from PR.
1876 + integer, parameter :: n = 9
1877 + character(len=40) :: fmt
1878 + character(len=2), dimension(n) :: y
1879 + open(unit=10, status="scratch")
1881 + fmt = '(a,1x,(t7, 3a))'
1882 + write(10, fmt) 'xxxx', (y(i), i = 1,n)
1884 + read(10, '(a)') fmt
1885 + if (fmt.ne."xxxx a a a") call abort()
1887 Index: gcc/testsuite/gfortran.dg/backspace_8.f
1888 ===================================================================
1889 --- gcc/testsuite/gfortran.dg/backspace_8.f (.../tags/gcc_4_2_0_release) (wersja 0)
1890 +++ gcc/testsuite/gfortran.dg/backspace_8.f (.../branches/gcc-4_2-branch) (wersja 125589)
1893 +C PR libfortran/31618 - backspace after an error didn't work.
1896 + open (21, file="backspace_7.dat", form="unformatted")
1898 + write (21) 4711, 4712
1902 + read (21,err=100,end=100) i,j,k
1907 + if (i .ne. 4711 .or. j .ne. 4712) call abort
1908 + close (21,status="delete")
1910 Index: gcc/testsuite/gfortran.dg/func_assign.f90
1911 ===================================================================
1912 --- gcc/testsuite/gfortran.dg/func_assign.f90 (.../tags/gcc_4_2_0_release) (wersja 0)
1913 +++ gcc/testsuite/gfortran.dg/func_assign.f90 (.../branches/gcc-4_2-branch) (wersja 125589)
1915 +! { dg-do compile }
1918 +! Do not allow assigning to external functions
1920 +! Contributed by Steve Kargl <sgk@troutmask.apl.washington.edu>
1925 + integer function bar()
1934 + function funget(a)
1938 + end subroutine sub
1940 + sub = 'a' ! { dg-error "Expected VARIABLE" }
1941 + fun = 4.4 ! { dg-error "Expected VARIABLE" }
1942 + funget = 4 ! { dg-error "is not a VALUE" }
1943 + bar = 5 ! { dg-error "is not a VALUE" }
1948 Index: gcc/testsuite/gfortran.dg/unf_io_convert_3.f90
1949 ===================================================================
1950 --- gcc/testsuite/gfortran.dg/unf_io_convert_3.f90 (.../tags/gcc_4_2_0_release) (wersja 125589)
1951 +++ gcc/testsuite/gfortran.dg/unf_io_convert_3.f90 (.../branches/gcc-4_2-branch) (wersja 125589)
1955 ! { dg-require-effective-target fortran_large_real }
1957 integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1)
1958 Index: gcc/cp/decl.c
1959 ===================================================================
1960 --- gcc/cp/decl.c (.../tags/gcc_4_2_0_release) (wersja 125589)
1961 +++ gcc/cp/decl.c (.../branches/gcc-4_2-branch) (wersja 125589)
1962 @@ -5368,7 +5368,18 @@
1963 initializer. It is not legal to redeclare a static data
1964 member, so this issue does not arise in that case. */
1965 if (var_definition_p && TREE_STATIC (decl))
1966 - expand_static_init (decl, init);
1968 + /* If a TREE_READONLY variable needs initialization
1969 + at runtime, it is no longer readonly and we need to
1970 + avoid MEM_READONLY_P being set on RTL created for it. */
1973 + if (TREE_READONLY (decl))
1974 + TREE_READONLY (decl) = 0;
1977 + expand_static_init (decl, init);
1982 Index: gcc/cp/ChangeLog
1983 ===================================================================
1984 --- gcc/cp/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
1985 +++ gcc/cp/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
1987 +2007-06-08 Dirk Mueller <dmueller@suse.de>
1991 + Backport from mainline:
1992 + 2007-05-31 Jakub Jelinek <jakub@redhat.com>
1994 + * decl.c (cp_finish_decl): Also clear was_readonly if a static var
1995 + needs runtime initialization.
1997 + 2007-05-30 Jakub Jelinek <jakub@redhat.com>
1999 + * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
2000 + variables that need runtime initialization.
2002 2007-05-13 Release Manager
2004 * GCC 4.2.0 released.
2005 Index: gcc/fortran/trans-expr.c
2006 ===================================================================
2007 --- gcc/fortran/trans-expr.c (.../tags/gcc_4_2_0_release) (wersja 125589)
2008 +++ gcc/fortran/trans-expr.c (.../branches/gcc-4_2-branch) (wersja 125589)
2009 @@ -255,6 +255,10 @@
2010 gfc_conv_string_parameter (se);
2013 + /* Avoid multiple evaluation of substring start. */
2014 + if (!CONSTANT_CLASS_P (start.expr) && !DECL_P (start.expr))
2015 + start.expr = gfc_evaluate_now (start.expr, &se->pre);
2017 /* Change the start of the string. */
2018 if (TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
2020 @@ -273,6 +277,10 @@
2021 gfc_conv_expr_type (&end, ref->u.ss.end, gfc_charlen_type_node);
2022 gfc_add_block_to_block (&se->pre, &end.pre);
2025 + if (!CONSTANT_CLASS_P (end.expr) && !DECL_P (end.expr))
2026 + end.expr = gfc_evaluate_now (end.expr, &se->pre);
2028 tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node,
2029 build_int_cst (gfc_charlen_type_node, 1),
2031 @@ -2340,17 +2348,23 @@
2033 /* Generate the actual call. */
2034 gfc_conv_function_val (se, sym);
2036 /* If there are alternate return labels, function type should be
2037 integer. Can't modify the type in place though, since it can be shared
2038 - with other functions. */
2039 + with other functions. For dummy arguments, the typing is done to
2040 + to this result, even if it has to be repeated for each call. */
2041 if (has_alternate_specifier
2042 && TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr))) != integer_type_node)
2044 - gcc_assert (! sym->attr.dummy);
2045 - TREE_TYPE (sym->backend_decl)
2046 - = build_function_type (integer_type_node,
2047 - TYPE_ARG_TYPES (TREE_TYPE (sym->backend_decl)));
2048 - se->expr = build_fold_addr_expr (sym->backend_decl);
2049 + if (!sym->attr.dummy)
2051 + TREE_TYPE (sym->backend_decl)
2052 + = build_function_type (integer_type_node,
2053 + TYPE_ARG_TYPES (TREE_TYPE (sym->backend_decl)));
2054 + se->expr = build_fold_addr_expr (sym->backend_decl);
2057 + TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr))) = integer_type_node;
2060 fntype = TREE_TYPE (TREE_TYPE (se->expr));
2061 Index: gcc/fortran/trans-array.c
2062 ===================================================================
2063 --- gcc/fortran/trans-array.c (.../tags/gcc_4_2_0_release) (wersja 125589)
2064 +++ gcc/fortran/trans-array.c (.../branches/gcc-4_2-branch) (wersja 125589)
2065 @@ -4422,6 +4422,8 @@
2067 if (se->direct_byref)
2068 base = gfc_index_zero_node;
2069 + else if (GFC_ARRAY_TYPE_P (TREE_TYPE (desc)))
2070 + base = gfc_evaluate_now (gfc_conv_array_offset (desc), &loop.pre);
2074 @@ -4489,8 +4491,20 @@
2075 stride, info->stride[dim]);
2077 if (se->direct_byref)
2078 - base = fold_build2 (MINUS_EXPR, TREE_TYPE (base),
2081 + base = fold_build2 (MINUS_EXPR, TREE_TYPE (base),
2084 + else if (GFC_ARRAY_TYPE_P (TREE_TYPE (desc)))
2086 + tmp = gfc_conv_array_lbound (desc, n);
2087 + tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (base),
2088 + tmp, loop.from[dim]);
2089 + tmp = fold_build2 (MULT_EXPR, TREE_TYPE (base),
2090 + tmp, gfc_conv_array_stride (desc, n));
2091 + base = fold_build2 (PLUS_EXPR, TREE_TYPE (base),
2095 /* Store the new stride. */
2096 tmp = gfc_conv_descriptor_stride (parm, gfc_rank_cst[dim]);
2097 @@ -4511,7 +4525,8 @@
2098 gfc_conv_descriptor_data_set (&loop.pre, parm, offset);
2101 - if (se->direct_byref && !se->data_not_needed)
2102 + if ((se->direct_byref || GFC_ARRAY_TYPE_P (TREE_TYPE (desc)))
2103 + && !se->data_not_needed)
2105 /* Set the offset. */
2106 tmp = gfc_conv_descriptor_offset (parm);
2107 Index: gcc/fortran/gfortran.texi
2108 ===================================================================
2109 --- gcc/fortran/gfortran.texi (.../tags/gcc_4_2_0_release) (wersja 125589)
2110 +++ gcc/fortran/gfortran.texi (.../branches/gcc-4_2-branch) (wersja 125589)
2112 to change the representation of data for unformatted files.
2113 The syntax for the @env{GFORTRAN_CONVERT_UNIT} variable is:
2115 -GFORTRAN_CONVERT_UNIT: mode | mode ';' exception ;
2116 +GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
2117 mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
2118 exception: mode ':' unit_list | unit_list ;
2119 unit_list: unit_spec | unit_list unit_spec ;
2120 @@ -668,7 +668,12 @@
2121 setting a default data representation for the whole program. The
2122 @code{CONVERT} specifier overrides the @option{-fconvert} compile options.
2124 +@emph{Note that the values specified via the GFORTRAN_CONVERT_UNIT
2125 +environment variable will override the CONVERT specifier in the
2126 +open statement}. This is to give control over data formats to
2127 +users who do not have the source code of their program available.
2130 @c =====================================================================
2131 @c PART II: LANGUAGE REFERENCE
2132 @c =====================================================================
2133 Index: gcc/fortran/ChangeLog
2134 ===================================================================
2135 --- gcc/fortran/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
2136 +++ gcc/fortran/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
2138 +2007-05-31 Paul Thomas <pault@gcc.gnu.org>
2141 + * trans-expr.c (gfc_conv_function_call): Give a dummy
2142 + procedure the correct type if it has alternate returns.
2146 + * resolve.c (resolve_fl_procedure): Resolve constant character
2151 + * trans-array.c (gfc_conv_expr_descriptor): Obtain the stored
2152 + offset for non-descriptor, source arrays and correct for stride
2153 + not equal to one before writing to field of output descriptor.
2155 +2007-05-17 Tobias Burnus <burnus@net-b.de>
2157 + * gfortran.texi (GFORTRAN_CONVERT_UNIT): Improve documentation.
2159 +2007-05-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
2162 + * trans-expr.c (gfc_conv_substring): Evaluate substring bounds
2165 2007-05-13 Release Manager
2167 * GCC 4.2.0 released.
2168 Index: gcc/fortran/resolve.c
2169 ===================================================================
2170 --- gcc/fortran/resolve.c (.../tags/gcc_4_2_0_release) (wersja 125589)
2171 +++ gcc/fortran/resolve.c (.../branches/gcc-4_2-branch) (wersja 125589)
2172 @@ -5742,6 +5742,11 @@
2173 if (sym->ts.type == BT_CHARACTER)
2175 gfc_charlen *cl = sym->ts.cl;
2177 + if (cl && cl->length && gfc_is_constant_expr (cl->length)
2178 + && resolve_charlen (cl) == FAILURE)
2181 if (!cl || !cl->length || cl->length->expr_type != EXPR_CONSTANT)
2183 if (sym->attr.proc == PROC_ST_FUNCTION)
2184 Index: gcc/fortran/primary.c
2185 ===================================================================
2186 --- gcc/fortran/primary.c (.../tags/gcc_4_2_0_release) (wersja 125589)
2187 +++ gcc/fortran/primary.c (.../branches/gcc-4_2-branch) (wersja 125589)
2188 @@ -2415,7 +2415,8 @@
2191 /* Check for a nonrecursive function result */
2192 - if (sym->attr.function && (sym->result == sym || sym->attr.entry))
2193 + if (sym->attr.function && (sym->result == sym || sym->attr.entry)
2194 + && !sym->attr.external)
2196 /* If a function result is a derived type, then the derived
2197 type may still have to be resolved. */
2199 ===================================================================
2200 --- gcc/BASE-VER (.../tags/gcc_4_2_0_release) (wersja 125589)
2201 +++ gcc/BASE-VER (.../branches/gcc-4_2-branch) (wersja 125589)
2206 ===================================================================
2207 --- gcc/except.c (.../tags/gcc_4_2_0_release) (wersja 125589)
2208 +++ gcc/except.c (.../branches/gcc-4_2-branch) (wersja 125589)
2209 @@ -1005,7 +1005,11 @@
2210 for (prev_try = VEC_index (eh_region, cfun->eh->region_array, outer_region);
2211 prev_try && prev_try->type != ERT_TRY;
2212 prev_try = prev_try->outer)
2214 + if (prev_try->type == ERT_MUST_NOT_THROW)
2220 /* Remap all of the internal catch and cleanup linkages. Since we
2221 duplicate entire subtrees, all of the referenced regions will have
2222 Index: gcc/combine.c
2223 ===================================================================
2224 --- gcc/combine.c (.../tags/gcc_4_2_0_release) (wersja 125589)
2225 +++ gcc/combine.c (.../branches/gcc-4_2-branch) (wersja 125589)
2226 @@ -5341,14 +5341,14 @@
2228 else if (GET_MODE (op0) == compare_mode && op1 == const0_rtx)
2230 - SUBST(SET_SRC (x), op0);
2231 + SUBST (SET_SRC (x), op0);
2235 + /* Otherwise, update the COMPARE if needed. */
2236 + else if (XEXP (src, 0) != op0 || XEXP (src, 1) != op1)
2238 - /* Otherwise, update the COMPARE if needed. */
2239 - SUBST (XEXP (src, 0), op0);
2240 - SUBST (XEXP (src, 1), op1);
2241 + SUBST (SET_SRC (x), gen_rtx_COMPARE (compare_mode, op0, op1));
2242 + src = SET_SRC (x);
2246 Index: gcc/Makefile.in
2247 ===================================================================
2248 --- gcc/Makefile.in (.../tags/gcc_4_2_0_release) (wersja 125589)
2249 +++ gcc/Makefile.in (.../branches/gcc-4_2-branch) (wersja 125589)
2250 @@ -1839,7 +1839,7 @@
2251 tree-ssa-structalias.o: tree-ssa-structalias.c tree-ssa-structalias.h \
2252 $(SYSTEM_H) $(CONFIG_H) $(GGC_H) $(TREE_H) $(TREE_FLOW_H) \
2253 $(TM_H) coretypes.h $(CGRAPH_H) tree-pass.h $(TIMEVAR_H) \
2254 - gt-tree-ssa-structalias.h $(PARAMS_H)
2255 + gt-tree-ssa-structalias.h $(PARAMS_H) pointer-set.h
2256 tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
2257 $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \
2258 toplev.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
2259 Index: gcc/tree-ssa-structalias.c
2260 ===================================================================
2261 --- gcc/tree-ssa-structalias.c (.../tags/gcc_4_2_0_release) (wersja 125589)
2262 +++ gcc/tree-ssa-structalias.c (.../branches/gcc-4_2-branch) (wersja 125589)
2265 #include "tree-ssa-structalias.h"
2267 +#include "pointer-set.h"
2269 /* The idea behind this analyzer is to generate set constraints from the
2270 program, then solve the resulting constraints in order to generate the
2274 Set constraints are a way of modeling program analysis problems that
2275 involve sets. They consist of an inclusion constraint language,
2278 Also see "Ultra-fast Aliasing Analysis using CLA: A Million Lines
2279 of C Code in a Second" by ""Nevin Heintze and Olivier Tardieu" at
2280 - http://citeseer.ist.psu.edu/heintze01ultrafast.html
2281 + http://citeseer.ist.psu.edu/heintze01ultrafast.html
2283 - There are three types of constraint expressions, DEREF, ADDRESSOF, and
2284 - SCALAR. Each constraint expression consists of a constraint type,
2285 - a variable, and an offset.
2287 + There are three types of real constraint expressions, DEREF,
2288 + ADDRESSOF, and SCALAR. Each constraint expression consists
2289 + of a constraint type, a variable, and an offset.
2291 SCALAR is a constraint expression type used to represent x, whether
2292 it appears on the LHS or the RHS of a statement.
2293 DEREF is a constraint expression type used to represent *x, whether
2294 - it appears on the LHS or the RHS of a statement.
2295 + it appears on the LHS or the RHS of a statement.
2296 ADDRESSOF is a constraint expression used to represent &x, whether
2297 it appears on the LHS or the RHS of a statement.
2300 Each pointer variable in the program is assigned an integer id, and
2301 each field of a structure variable is assigned an integer id as well.
2304 Structure variables are linked to their list of fields through a "next
2305 field" in each variable that points to the next field in offset
2307 - Each variable for a structure field has
2309 + Each variable for a structure field has
2311 1. "size", that tells the size in bits of that field.
2312 2. "fullsize, that tells the size in bits of the entire structure.
2313 3. "offset", that tells the offset in bits from the beginning of the
2314 structure to this field.
2321 @@ -110,50 +111,51 @@
2322 foo.b -> id 2, size 32, offset 32, fullsize 64, next NULL
2323 bar -> id 3, size 32, offset 0, fullsize 32, next NULL
2327 In order to solve the system of set constraints, the following is
2330 1. Each constraint variable x has a solution set associated with it,
2334 2. Constraints are separated into direct, copy, and complex.
2335 Direct constraints are ADDRESSOF constraints that require no extra
2336 processing, such as P = &Q
2337 Copy constraints are those of the form P = Q.
2338 - Complex constraints are all the constraints involving dereferences.
2340 + Complex constraints are all the constraints involving dereferences
2341 + and offsets (including offsetted copies).
2343 3. All direct constraints of the form P = &Q are processed, such
2344 - that Q is added to Sol(P)
2345 + that Q is added to Sol(P)
2347 4. All complex constraints for a given constraint variable are stored in a
2348 - linked list attached to that variable's node.
2349 + linked list attached to that variable's node.
2351 5. A directed graph is built out of the copy constraints. Each
2352 - constraint variable is a node in the graph, and an edge from
2353 + constraint variable is a node in the graph, and an edge from
2354 Q to P is added for each copy constraint of the form P = Q
2357 6. The graph is then walked, and solution sets are
2358 propagated along the copy edges, such that an edge from Q to P
2359 causes Sol(P) <- Sol(P) union Sol(Q).
2362 7. As we visit each node, all complex constraints associated with
2363 that node are processed by adding appropriate copy edges to the graph, or the
2364 - appropriate variables to the solution set.
2365 + appropriate variables to the solution set.
2367 8. The process of walking the graph is iterated until no solution
2370 Prior to walking the graph in steps 6 and 7, We perform static
2371 - cycle elimination on the constraint graph, as well
2372 + cycle elimination on the constraint graph, as well
2373 as off-line variable substitution.
2376 TODO: Adding offsets to pointer-to-structures can be handled (IE not punted
2377 on and turned into anything), but isn't. You can just see what offset
2378 inside the pointed-to struct it's going to access.
2381 TODO: Constant bounded arrays can be handled as if they were structs of the
2382 - same number of elements.
2383 + same number of elements.
2385 TODO: Modeling heap and incoming pointers becomes much better if we
2386 add fields to them as we discover them, which we could do.
2387 @@ -161,20 +163,29 @@
2388 TODO: We could handle unions, but to be honest, it's probably not
2389 worth the pain or slowdown. */
2391 -static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
2392 -htab_t heapvar_for_stmt;
2393 +static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map))) htab_t heapvar_for_stmt;
2395 /* One variable to represent all non-local accesses. */
2398 static bool use_field_sensitive = true;
2399 static int in_ipa_mode = 0;
2401 +/* Used for predecessor bitmaps. */
2402 static bitmap_obstack predbitmap_obstack;
2403 -static bitmap_obstack ptabitmap_obstack;
2405 +/* Used for points-to sets. */
2406 +static bitmap_obstack pta_obstack;
2408 +/* Used for oldsolution members of variables. */
2409 +static bitmap_obstack oldpta_obstack;
2411 +/* Used for per-solver-iteration bitmaps. */
2412 static bitmap_obstack iteration_obstack;
2414 static unsigned int create_variable_info_for (tree, const char *);
2415 -static void build_constraint_graph (void);
2416 +typedef struct constraint_graph *constraint_graph_t;
2417 +static void unify_nodes (constraint_graph_t, unsigned int, unsigned int, bool);
2419 DEF_VEC_P(constraint_t);
2420 DEF_VEC_ALLOC_P(constraint_t,heap);
2421 @@ -186,11 +197,13 @@
2422 static struct constraint_stats
2424 unsigned int total_vars;
2425 - unsigned int collapsed_vars;
2426 + unsigned int nonpointer_vars;
2427 unsigned int unified_vars_static;
2428 unsigned int unified_vars_dynamic;
2429 unsigned int iterations;
2430 unsigned int num_edges;
2431 + unsigned int num_implicit_edges;
2432 + unsigned int points_to_sets_created;
2435 struct variable_info
2439 /* Offset of this variable, in bits, from the base variable */
2440 - unsigned HOST_WIDE_INT offset;
2441 + unsigned HOST_WIDE_INT offset;
2443 /* Size of the variable, in bits. */
2444 unsigned HOST_WIDE_INT size;
2445 @@ -216,34 +229,21 @@
2446 /* A link to the variable for the next field in this structure. */
2447 struct variable_info *next;
2449 - /* Node in the graph that represents the constraints and points-to
2450 - solution for the variable. */
2451 - unsigned int node;
2453 - /* True if the address of this variable is taken. Needed for
2454 - variable substitution. */
2455 - unsigned int address_taken:1;
2457 - /* True if this variable is the target of a dereference. Needed for
2458 - variable substitution. */
2459 - unsigned int indirect_target:1;
2461 /* True if the variable is directly the target of a dereference.
2462 This is used to track which variables are *actually* dereferenced
2463 - so we can prune their points to listed. This is equivalent to the
2464 - indirect_target flag when no merging of variables happens. */
2465 + so we can prune their points to listed. */
2466 unsigned int directly_dereferenced:1;
2468 /* True if this is a variable created by the constraint analysis, such as
2469 heap variables and constraints we had to break up. */
2470 unsigned int is_artificial_var:1;
2473 /* True if this is a special variable whose solution set should not be
2475 unsigned int is_special_var:1;
2477 /* True for variables whose size is not known or variable. */
2478 - unsigned int is_unknown_size_var:1;
2479 + unsigned int is_unknown_size_var:1;
2481 /* True for variables that have unions somewhere in them. */
2482 unsigned int has_union:1;
2483 @@ -254,16 +254,15 @@
2484 /* Points-to set for this variable. */
2487 + /* Old points-to set for this variable. */
2488 + bitmap oldsolution;
2490 /* Variable ids represented by this node. */
2493 - /* Vector of complex constraints for this node. Complex
2494 - constraints are those involving dereferences. */
2495 - VEC(constraint_t,heap) *complex;
2497 - /* Variable id this was collapsed to due to type unsafety.
2498 - This should be unused completely after build_constraint_graph, or
2499 - something is broken. */
2500 + /* Variable id this was collapsed to due to type unsafety. This
2501 + should be unused completely after build_succ_graph, or something
2503 struct variable_info *collapsed_to;
2505 typedef struct variable_info *varinfo_t;
2508 DEF_VEC_ALLOC_P(varinfo_t, heap);
2510 -/* Table of variable info structures for constraint variables. Indexed directly
2511 - by variable info id. */
2512 +/* Table of variable info structures for constraint variables.
2513 + Indexed directly by variable info id. */
2514 static VEC(varinfo_t,heap) *varmap;
2516 /* Return the varmap element N */
2518 static inline varinfo_t
2519 get_varinfo (unsigned int n)
2521 - return VEC_index(varinfo_t, varmap, n);
2522 + return VEC_index (varinfo_t, varmap, n);
2525 /* Return the varmap element N, following the collapsed_to link. */
2527 static inline varinfo_t
2528 get_varinfo_fc (unsigned int n)
2530 - varinfo_t v = VEC_index(varinfo_t, varmap, n);
2531 + varinfo_t v = VEC_index (varinfo_t, varmap, n);
2533 if (v->collapsed_to)
2534 return v->collapsed_to;
2535 @@ -331,10 +330,9 @@
2536 /* Variable that represents non-local variables before we expand it to
2537 one for each type. */
2538 static unsigned int nonlocal_vars_id;
2540 /* Lookup a heap var for FROM, and return it if we find one. */
2544 heapvar_lookup (tree from)
2546 struct tree_map *h, in;
2547 @@ -367,25 +365,21 @@
2548 named NAME, and using constraint graph node NODE. */
2551 -new_var_info (tree t, unsigned int id, const char *name, unsigned int node)
2552 +new_var_info (tree t, unsigned int id, const char *name)
2554 varinfo_t ret = pool_alloc (variable_info_pool);
2560 - ret->address_taken = false;
2561 - ret->indirect_target = false;
2562 ret->directly_dereferenced = false;
2563 ret->is_artificial_var = false;
2564 ret->is_heap_var = false;
2565 ret->is_special_var = false;
2566 ret->is_unknown_size_var = false;
2567 ret->has_union = false;
2568 - ret->solution = BITMAP_ALLOC (&ptabitmap_obstack);
2569 - ret->variables = BITMAP_ALLOC (&ptabitmap_obstack);
2570 - ret->complex = NULL;
2571 + ret->solution = BITMAP_ALLOC (&pta_obstack);
2572 + ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack);
2574 ret->collapsed_to = NULL;
2578 /* An expression that appears in a constraint. */
2580 -struct constraint_expr
2581 +struct constraint_expr
2583 /* Constraint type. */
2584 constraint_expr_type type;
2586 static void do_deref (VEC (ce_s, heap) **);
2588 /* Our set constraints are made up of two constraint expressions, one
2592 As described in the introduction, our set constraints each represent an
2593 operation between set valued variables.
2594 @@ -434,63 +428,98 @@
2595 static VEC(constraint_t,heap) *constraints;
2596 static alloc_pool constraint_pool;
2598 -/* An edge in the weighted constraint graph. The edges are weighted,
2599 - with a bit set in weights meaning their is an edge with that
2601 - We don't keep the src in the edge, because we always know what it
2604 -struct constraint_edge
2606 +DEF_VEC_ALLOC_I(int, heap);
2608 +/* The constraint graph is represented as an array of bitmaps
2609 + containing successor nodes. */
2611 +struct constraint_graph
2613 - unsigned int dest;
2616 + /* Size of this graph, which may be different than the number of
2617 + nodes in the variable map. */
2618 + unsigned int size;
2620 -typedef struct constraint_edge *constraint_edge_t;
2621 -static alloc_pool constraint_edge_pool;
2622 + /* Explicit successors of each node. */
2625 -/* Return a new constraint edge from SRC to DEST. */
2626 + /* Implicit predecessors of each node (Used for variable
2628 + bitmap *implicit_preds;
2630 -static constraint_edge_t
2631 -new_constraint_edge (unsigned int dest)
2633 - constraint_edge_t ret = pool_alloc (constraint_edge_pool);
2635 - ret->weights = NULL;
2638 + /* Explicit predecessors of each node (Used for variable substitution). */
2641 -DEF_VEC_P(constraint_edge_t);
2642 -DEF_VEC_ALLOC_P(constraint_edge_t,heap);
2643 + /* Indirect cycle representatives, or -1 if the node has no indirect
2645 + int *indirect_cycles;
2647 + /* Representative node for a node. rep[a] == a unless the node has
2649 + unsigned int *rep;
2651 -/* The constraint graph is represented internally in two different
2652 - ways. The overwhelming majority of edges in the constraint graph
2653 - are zero weigh edges, and thus, using a vector of contrainst_edge_t
2654 - is a waste of time and memory, since they have no weights. We
2655 - simply use a bitmap to store the preds and succs for each node.
2656 - The weighted edges are stored as a set of adjacency vectors, one
2657 - per variable. succs[x] is the vector of successors for variable x,
2658 - and preds[x] is the vector of predecessors for variable x. IOW,
2659 - all edges are "forward" edges, which is not like our CFG. So
2660 - remember that preds[x]->src == x, and succs[x]->src == x. */
2661 + /* Equivalence class representative for a node. This is used for
2662 + variable substitution. */
2665 -struct constraint_graph
2667 - bitmap *zero_weight_succs;
2668 - bitmap *zero_weight_preds;
2669 - VEC(constraint_edge_t,heap) **succs;
2670 - VEC(constraint_edge_t,heap) **preds;
2671 + /* Label for each node, used during variable substitution. */
2672 + unsigned int *label;
2674 + /* Bitmap of nodes where the bit is set if the node is a direct
2675 + node. Used for variable substitution. */
2676 + sbitmap direct_nodes;
2678 + /* Vector of complex constraints for each graph node. Complex
2679 + constraints are those involving dereferences or offsets that are
2681 + VEC(constraint_t,heap) **complex;
2684 -typedef struct constraint_graph *constraint_graph_t;
2686 static constraint_graph_t graph;
2687 -static int graph_size;
2689 +/* During variable substitution and the offline version of indirect
2690 + cycle finding, we create nodes to represent dereferences and
2691 + address taken constraints. These represent where these start and
2693 +#define FIRST_REF_NODE (VEC_length (varinfo_t, varmap))
2694 +#define LAST_REF_NODE (FIRST_REF_NODE + (FIRST_REF_NODE - 1))
2695 +#define FIRST_ADDR_NODE (LAST_REF_NODE + 1)
2697 +/* Return the representative node for NODE, if NODE has been unioned
2698 + with another NODE.
2699 + This function performs path compression along the way to finding
2700 + the representative. */
2702 +static unsigned int
2703 +find (unsigned int node)
2705 + gcc_assert (node < graph->size);
2706 + if (graph->rep[node] != node)
2707 + return graph->rep[node] = find (graph->rep[node]);
2711 +/* Union the TO and FROM nodes to the TO nodes.
2712 + Note that at some point in the future, we may want to do
2713 + union-by-rank, in which case we are going to have to return the
2714 + node we unified to. */
2717 +unite (unsigned int to, unsigned int from)
2719 + gcc_assert (to < graph->size && from < graph->size);
2720 + if (to != from && graph->rep[from] != to)
2722 + graph->rep[from] = to;
2728 /* Create a new constraint consisting of LHS and RHS expressions. */
2730 -static constraint_t
2731 +static constraint_t
2732 new_constraint (const struct constraint_expr lhs,
2733 const struct constraint_expr rhs)
2736 if (c->lhs.type == ADDRESSOF)
2737 fprintf (file, "&");
2738 else if (c->lhs.type == DEREF)
2739 - fprintf (file, "*");
2740 + fprintf (file, "*");
2741 fprintf (file, "%s", get_varinfo_fc (c->lhs.var)->name);
2742 if (c->lhs.offset != 0)
2743 fprintf (file, " + " HOST_WIDE_INT_PRINT_DEC, c->lhs.offset);
2744 @@ -550,23 +579,24 @@
2745 dump_constraints (stderr);
2748 -/* SOLVER FUNCTIONS
2749 +/* SOLVER FUNCTIONS
2751 The solver is a simple worklist solver, that works on the following
2754 - sbitmap changed_nodes = all ones;
2755 - changed_count = number of nodes;
2756 - For each node that was already collapsed:
2759 + sbitmap changed_nodes = all zeroes;
2760 + changed_count = 0;
2761 + For each node that is not already collapsed:
2763 + set bit in changed nodes
2765 while (changed_count > 0)
2767 compute topological ordering for constraint graph
2770 find and collapse cycles in the constraint graph (updating
2771 changed if necessary)
2774 for each node (n) in the graph in topological order:
2777 @@ -619,11 +649,11 @@
2780 /* Return true if two constraints A and B are equal. */
2784 constraint_equal (struct constraint a, struct constraint b)
2786 - return constraint_expr_equal (a.lhs, b.lhs)
2787 + return constraint_expr_equal (a.lhs, b.lhs)
2788 && constraint_expr_equal (a.rhs, b.rhs);
2792 constraint_vec_find (VEC(constraint_t,heap) *vec,
2793 struct constraint lookfor)
2795 - unsigned int place;
2796 + unsigned int place;
2801 /* If this is a properly sized variable, only add offset if it's
2802 less than end. Otherwise, it is globbed to a single
2806 if ((get_varinfo (i)->offset + offset) < get_varinfo (i)->fullsize)
2808 unsigned HOST_WIDE_INT fieldoffset = get_varinfo (i)->offset + offset;
2809 @@ -693,15 +723,15 @@
2811 bitmap_set_bit (result, v->id);
2813 - else if (get_varinfo (i)->is_artificial_var
2814 + else if (get_varinfo (i)->is_artificial_var
2815 || get_varinfo (i)->has_union
2816 || get_varinfo (i)->is_unknown_size_var)
2818 bitmap_set_bit (result, i);
2822 - bitmap_copy (set, result);
2824 + bitmap_copy (set, result);
2825 BITMAP_FREE (result);
2828 @@ -727,397 +757,149 @@
2832 -/* Insert constraint C into the list of complex constraints for VAR. */
2833 +/* Insert constraint C into the list of complex constraints for graph
2837 -insert_into_complex (unsigned int var, constraint_t c)
2838 +insert_into_complex (constraint_graph_t graph,
2839 + unsigned int var, constraint_t c)
2841 - varinfo_t vi = get_varinfo (var);
2842 - unsigned int place = VEC_lower_bound (constraint_t, vi->complex, c,
2843 + VEC (constraint_t, heap) *complex = graph->complex[var];
2844 + unsigned int place = VEC_lower_bound (constraint_t, complex, c,
2846 - VEC_safe_insert (constraint_t, heap, vi->complex, place, c);
2850 -/* Compare two constraint edges A and B, return true if they are equal. */
2853 -constraint_edge_equal (struct constraint_edge a, struct constraint_edge b)
2855 - return a.dest == b.dest;
2856 + /* Only insert constraints that do not already exist. */
2857 + if (place >= VEC_length (constraint_t, complex)
2858 + || !constraint_equal (*c, *VEC_index (constraint_t, complex, place)))
2859 + VEC_safe_insert (constraint_t, heap, graph->complex[var], place, c);
2862 -/* Compare two constraint edges, return true if A is less than B */
2865 -constraint_edge_less (const constraint_edge_t a, const constraint_edge_t b)
2867 - if (a->dest < b->dest)
2872 -/* Find the constraint edge that matches LOOKFOR, in VEC.
2873 - Return the edge, if found, NULL otherwise. */
2875 -static constraint_edge_t
2876 -constraint_edge_vec_find (VEC(constraint_edge_t,heap) *vec,
2877 - struct constraint_edge lookfor)
2879 - unsigned int place;
2880 - constraint_edge_t edge = NULL;
2882 - place = VEC_lower_bound (constraint_edge_t, vec, &lookfor,
2883 - constraint_edge_less);
2884 - if (place >= VEC_length (constraint_edge_t, vec))
2886 - edge = VEC_index (constraint_edge_t, vec, place);
2887 - if (!constraint_edge_equal (*edge, lookfor))
2892 /* Condense two variable nodes into a single variable node, by moving
2893 all associated info from SRC to TO. */
2896 -condense_varmap_nodes (unsigned int to, unsigned int src)
2898 +merge_node_constraints (constraint_graph_t graph, unsigned int to,
2899 + unsigned int from)
2901 - varinfo_t tovi = get_varinfo (to);
2902 - varinfo_t srcvi = get_varinfo (src);
2905 - bitmap_iterator bi;
2907 - /* the src node, and all its variables, are now the to node. */
2909 - EXECUTE_IF_SET_IN_BITMAP (srcvi->variables, 0, i, bi)
2910 - get_varinfo (i)->node = to;
2912 - /* Merge the src node variables and the to node variables. */
2913 - bitmap_set_bit (tovi->variables, src);
2914 - bitmap_ior_into (tovi->variables, srcvi->variables);
2915 - bitmap_clear (srcvi->variables);
2918 + gcc_assert (find (from) == to);
2920 /* Move all complex constraints from src node into to node */
2921 - for (i = 0; VEC_iterate (constraint_t, srcvi->complex, i, c); i++)
2922 + for (i = 0; VEC_iterate (constraint_t, graph->complex[from], i, c); i++)
2924 /* In complex constraints for node src, we may have either
2925 - a = *src, and *src = a. */
2927 + a = *src, and *src = a, or an offseted constraint which are
2928 + always added to the rhs node's constraints. */
2930 if (c->rhs.type == DEREF)
2932 + else if (c->lhs.type == DEREF)
2938 - constraint_set_union (&tovi->complex, &srcvi->complex);
2939 - VEC_free (constraint_t, heap, srcvi->complex);
2940 - srcvi->complex = NULL;
2941 + constraint_set_union (&graph->complex[to], &graph->complex[from]);
2942 + VEC_free (constraint_t, heap, graph->complex[from]);
2943 + graph->complex[from] = NULL;
2946 -/* Erase an edge from SRC to SRC from GRAPH. This routine only
2947 - handles self-edges (e.g. an edge from a to a). */
2950 -erase_graph_self_edge (constraint_graph_t graph, unsigned int src)
2952 - VEC(constraint_edge_t,heap) *predvec = graph->preds[src];
2953 - VEC(constraint_edge_t,heap) *succvec = graph->succs[src];
2954 - struct constraint_edge edge;
2955 - unsigned int place;
2959 - /* Remove from the successors. */
2960 - place = VEC_lower_bound (constraint_edge_t, succvec, &edge,
2961 - constraint_edge_less);
2963 - /* Make sure we found the edge. */
2964 -#ifdef ENABLE_CHECKING
2966 - constraint_edge_t tmp = VEC_index (constraint_edge_t, succvec, place);
2967 - gcc_assert (constraint_edge_equal (*tmp, edge));
2970 - VEC_ordered_remove (constraint_edge_t, succvec, place);
2972 - /* Remove from the predecessors. */
2973 - place = VEC_lower_bound (constraint_edge_t, predvec, &edge,
2974 - constraint_edge_less);
2976 - /* Make sure we found the edge. */
2977 -#ifdef ENABLE_CHECKING
2979 - constraint_edge_t tmp = VEC_index (constraint_edge_t, predvec, place);
2980 - gcc_assert (constraint_edge_equal (*tmp, edge));
2983 - VEC_ordered_remove (constraint_edge_t, predvec, place);
2986 /* Remove edges involving NODE from GRAPH. */
2989 clear_edges_for_node (constraint_graph_t graph, unsigned int node)
2991 - VEC(constraint_edge_t,heap) *succvec = graph->succs[node];
2992 - VEC(constraint_edge_t,heap) *predvec = graph->preds[node];
2993 - bitmap_iterator bi;
2995 - constraint_edge_t c = NULL;
2998 - /* Walk the successors, erase the associated preds. */
3000 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_succs[node], 0, j, bi)
3002 - bitmap_clear_bit (graph->zero_weight_preds[j], node);
3004 - for (i = 0; VEC_iterate (constraint_edge_t, succvec, i, c); i++)
3005 - if (c->dest != node)
3007 - unsigned int place;
3008 - struct constraint_edge lookfor;
3009 - constraint_edge_t result;
3011 - lookfor.dest = node;
3012 - place = VEC_lower_bound (constraint_edge_t, graph->preds[c->dest],
3013 - &lookfor, constraint_edge_less);
3014 - result = VEC_ordered_remove (constraint_edge_t,
3015 - graph->preds[c->dest], place);
3016 - pool_free (constraint_edge_pool, result);
3019 - /* Walk the preds, erase the associated succs. */
3021 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_preds[node], 0, j, bi)
3023 - bitmap_clear_bit (graph->zero_weight_succs[j], node);
3025 - for (i =0; VEC_iterate (constraint_edge_t, predvec, i, c); i++)
3026 - if (c->dest != node)
3028 - unsigned int place;
3029 - struct constraint_edge lookfor;
3030 - constraint_edge_t result;
3032 - lookfor.dest = node;
3033 - place = VEC_lower_bound (constraint_edge_t, graph->succs[c->dest],
3034 - &lookfor, constraint_edge_less);
3035 - result = VEC_ordered_remove (constraint_edge_t,
3036 - graph->succs[c->dest], place);
3037 - pool_free (constraint_edge_pool, result);
3041 - if (graph->zero_weight_preds[node])
3043 - BITMAP_FREE (graph->zero_weight_preds[node]);
3044 - graph->zero_weight_preds[node] = NULL;
3047 - if (graph->zero_weight_succs[node])
3049 - BITMAP_FREE (graph->zero_weight_succs[node]);
3050 - graph->zero_weight_succs[node] = NULL;
3053 - VEC_free (constraint_edge_t, heap, graph->preds[node]);
3054 - VEC_free (constraint_edge_t, heap, graph->succs[node]);
3055 - graph->preds[node] = NULL;
3056 - graph->succs[node] = NULL;
3057 + if (graph->succs[node])
3058 + BITMAP_FREE (graph->succs[node]);
3061 -static bool edge_added = false;
3063 -/* Add edge (src, dest) to the graph. */
3066 -add_graph_edge (constraint_graph_t graph, unsigned int src, unsigned int dest)
3068 - unsigned int place;
3069 - VEC(constraint_edge_t,heap) *vec;
3070 - struct constraint_edge newe;
3073 - vec = graph->preds[src];
3074 - place = VEC_lower_bound (constraint_edge_t, vec, &newe,
3075 - constraint_edge_less);
3076 - if (place == VEC_length (constraint_edge_t, vec)
3077 - || VEC_index (constraint_edge_t, vec, place)->dest != dest)
3079 - constraint_edge_t edge = new_constraint_edge (dest);
3081 - VEC_safe_insert (constraint_edge_t, heap, graph->preds[src],
3083 - edge = new_constraint_edge (src);
3085 - place = VEC_lower_bound (constraint_edge_t, graph->succs[dest],
3086 - edge, constraint_edge_less);
3087 - VEC_safe_insert (constraint_edge_t, heap, graph->succs[dest],
3089 - edge_added = true;
3090 - stats.num_edges++;
3098 -/* Return the bitmap representing the weights of edge (SRC, DEST). */
3101 -get_graph_weights (constraint_graph_t graph, unsigned int src,
3102 - unsigned int dest)
3104 - constraint_edge_t edge;
3105 - VEC(constraint_edge_t,heap) *vec;
3106 - struct constraint_edge lookfor;
3108 - lookfor.dest = dest;
3110 - vec = graph->preds[src];
3111 - edge = constraint_edge_vec_find (vec, lookfor);
3112 - gcc_assert (edge != NULL);
3113 - return &edge->weights;
3116 -/* Allocate graph weight bitmap for the edges associated with SRC and
3117 - DEST in GRAPH. Both the pred and the succ edges share a single
3118 - bitmap, so we need to set both edges to that bitmap. */
3121 -allocate_graph_weights (constraint_graph_t graph, unsigned int src,
3122 - unsigned int dest)
3125 - constraint_edge_t edge;
3126 - VEC(constraint_edge_t,heap) *vec;
3127 - struct constraint_edge lookfor;
3129 - result = BITMAP_ALLOC (&ptabitmap_obstack);
3131 - /* Set the pred weight. */
3132 - lookfor.dest = dest;
3133 - vec = graph->preds[src];
3134 - edge = constraint_edge_vec_find (vec, lookfor);
3135 - gcc_assert (edge != NULL);
3136 - edge->weights = result;
3138 - /* Set the succ weight. */
3139 - lookfor.dest = src;
3140 - vec = graph->succs[dest];
3141 - edge = constraint_edge_vec_find (vec, lookfor);
3142 - gcc_assert (edge != NULL);
3143 - edge->weights = result;
3149 /* Merge GRAPH nodes FROM and TO into node TO. */
3152 -merge_graph_nodes (constraint_graph_t graph, unsigned int to,
3153 +merge_graph_nodes (constraint_graph_t graph, unsigned int to,
3156 - VEC(constraint_edge_t,heap) *succvec = graph->succs[from];
3157 - VEC(constraint_edge_t,heap) *predvec = graph->preds[from];
3159 - constraint_edge_t c;
3161 - bitmap_iterator bi;
3163 - /* Merge all the zero weighted predecessor edges. */
3164 - if (graph->zero_weight_preds[from])
3165 + if (graph->indirect_cycles[from] != -1)
3167 - if (!graph->zero_weight_preds[to])
3168 - graph->zero_weight_preds[to] = BITMAP_ALLOC (&predbitmap_obstack);
3170 - EXECUTE_IF_SET_IN_BITMAP (graph->zero_weight_preds[from], 0, j, bi)
3171 + /* If we have indirect cycles with the from node, and we have
3172 + none on the to node, the to node has indirect cycles from the
3173 + from node now that they are unified.
3174 + If indirect cycles exist on both, unify the nodes that they
3175 + are in a cycle with, since we know they are in a cycle with
3177 + if (graph->indirect_cycles[to] == -1)
3181 - bitmap_clear_bit (graph->zero_weight_succs[j], from);
3182 - bitmap_set_bit (graph->zero_weight_succs[j], to);
3184 + graph->indirect_cycles[to] = graph->indirect_cycles[from];
3186 - bitmap_ior_into (graph->zero_weight_preds[to],
3187 - graph->zero_weight_preds[from]);
3191 + unsigned int tonode = find (graph->indirect_cycles[to]);
3192 + unsigned int fromnode = find (graph->indirect_cycles[from]);
3194 - /* Merge all the zero weighted successor edges. */
3195 - if (graph->zero_weight_succs[from])
3197 - if (!graph->zero_weight_succs[to])
3198 - graph->zero_weight_succs[to] = BITMAP_ALLOC (&ptabitmap_obstack);
3199 - EXECUTE_IF_SET_IN_BITMAP (graph->zero_weight_succs[from], 0, j, bi)
3201 - bitmap_clear_bit (graph->zero_weight_preds[j], from);
3202 - bitmap_set_bit (graph->zero_weight_preds[j], to);
3203 + if (unite (tonode, fromnode))
3204 + unify_nodes (graph, tonode, fromnode, true);
3206 - bitmap_ior_into (graph->zero_weight_succs[to],
3207 - graph->zero_weight_succs[from]);
3210 - /* Merge all the nonzero weighted predecessor edges. */
3211 - for (i = 0; VEC_iterate (constraint_edge_t, predvec, i, c); i++)
3212 + /* Merge all the successor edges. */
3213 + if (graph->succs[from])
3215 - unsigned int d = c->dest;
3218 + if (!graph->succs[to])
3219 + graph->succs[to] = BITMAP_ALLOC (&pta_obstack);
3220 + bitmap_ior_into (graph->succs[to],
3221 + graph->succs[from]);
3224 - if (c->dest == from)
3226 + clear_edges_for_node (graph, from);
3229 - add_graph_edge (graph, to, d);
3231 - temp = *(get_graph_weights (graph, from, c->dest));
3234 - weights = get_graph_weights (graph, to, d);
3236 - *weights = allocate_graph_weights (graph, to, d);
3238 - bitmap_ior_into (*weights, temp);
3243 - /* Merge all the nonzero weighted successor edges. */
3244 - for (i = 0; VEC_iterate (constraint_edge_t, succvec, i, c); i++)
3246 - unsigned int d = c->dest;
3249 +/* Add an indirect graph edge to GRAPH, going from TO to FROM if
3250 + it doesn't exist in the graph already. */
3252 - if (c->dest == from)
3255 +add_implicit_graph_edge (constraint_graph_t graph, unsigned int to,
3256 + unsigned int from)
3261 - add_graph_edge (graph, d, to);
3262 + if (!graph->implicit_preds[to])
3263 + graph->implicit_preds[to] = BITMAP_ALLOC (&predbitmap_obstack);
3265 - temp = *(get_graph_weights (graph, c->dest, from));
3268 - weights = get_graph_weights (graph, d, to);
3270 - *weights = allocate_graph_weights (graph, d, to);
3271 - bitmap_ior_into (*weights, temp);
3273 + if (!bitmap_bit_p (graph->implicit_preds[to], from))
3275 + stats.num_implicit_edges++;
3276 + bitmap_set_bit (graph->implicit_preds[to], from);
3278 - clear_edges_for_node (graph, from);
3281 -/* Add a graph edge to GRAPH, going from TO to FROM, with WEIGHT, if
3282 +/* Add a predecessor graph edge to GRAPH, going from TO to FROM if
3283 it doesn't exist in the graph already.
3284 Return false if the edge already existed, true otherwise. */
3287 +add_pred_graph_edge (constraint_graph_t graph, unsigned int to,
3288 + unsigned int from)
3290 + if (!graph->preds[to])
3291 + graph->preds[to] = BITMAP_ALLOC (&predbitmap_obstack);
3292 + if (!bitmap_bit_p (graph->preds[to], from))
3293 + bitmap_set_bit (graph->preds[to], from);
3296 +/* Add a graph edge to GRAPH, going from FROM to TO if
3297 + it doesn't exist in the graph already.
3298 + Return false if the edge already existed, true otherwise. */
3301 -int_add_graph_edge (constraint_graph_t graph, unsigned int to,
3302 - unsigned int from, unsigned HOST_WIDE_INT weight)
3303 +add_graph_edge (constraint_graph_t graph, unsigned int to,
3304 + unsigned int from)
3306 - if (to == from && weight == 0)
3311 @@ -1125,41 +907,15 @@
3316 + if (!graph->succs[from])
3317 + graph->succs[from] = BITMAP_ALLOC (&pta_obstack);
3318 + if (!bitmap_bit_p (graph->succs[from], to))
3320 - if (!graph->zero_weight_preds[to])
3321 - graph->zero_weight_preds[to] = BITMAP_ALLOC (&predbitmap_obstack);
3322 - if (!graph->zero_weight_succs[from])
3323 - graph->zero_weight_succs[from] = BITMAP_ALLOC (&ptabitmap_obstack);
3324 - if (!bitmap_bit_p (graph->zero_weight_succs[from], to))
3326 - edge_added = true;
3328 - stats.num_edges++;
3329 - bitmap_set_bit (graph->zero_weight_preds[to], from);
3330 - bitmap_set_bit (graph->zero_weight_succs[from], to);
3333 + if (to < FIRST_REF_NODE && from < FIRST_REF_NODE)
3334 + stats.num_edges++;
3335 + bitmap_set_bit (graph->succs[from], to);
3341 - r = add_graph_edge (graph, to, from);
3342 - weights = get_graph_weights (graph, to, from);
3347 - *weights = allocate_graph_weights (graph, to, from);
3348 - bitmap_set_bit (*weights, weight);
3352 - r |= !bitmap_bit_p (*weights, weight);
3353 - bitmap_set_bit (*weights, weight);
3360 @@ -1168,46 +924,51 @@
3361 /* Return true if {DEST.SRC} is an existing graph edge in GRAPH. */
3364 -valid_graph_edge (constraint_graph_t graph, unsigned int src,
3365 +valid_graph_edge (constraint_graph_t graph, unsigned int src,
3368 - struct constraint_edge lookfor;
3369 - lookfor.dest = src;
3371 - return (graph->zero_weight_succs[dest]
3372 - && bitmap_bit_p (graph->zero_weight_succs[dest], src))
3373 - || constraint_edge_vec_find (graph->succs[dest], lookfor) != NULL;
3374 + return (graph->succs[dest]
3375 + && bitmap_bit_p (graph->succs[dest], src));
3378 -/* Return true if {DEST, SRC} is an existing weighted graph edge (IE has
3379 - a weight other than 0) in GRAPH. */
3381 -valid_weighted_graph_edge (constraint_graph_t graph, unsigned int src,
3382 - unsigned int dest)
3384 - struct constraint_edge lookfor;
3385 - lookfor.dest = src;
3387 - return graph->preds[src]
3388 - && constraint_edge_vec_find (graph->succs[dest], lookfor) != NULL;
3390 +/* Build the constraint graph, adding only predecessor edges right now. */
3393 -/* Build the constraint graph. */
3396 -build_constraint_graph (void)
3397 +build_pred_graph (void)
3404 graph = XNEW (struct constraint_graph);
3405 - graph_size = VEC_length (varinfo_t, varmap) + 1;
3406 - graph->succs = XCNEWVEC (VEC(constraint_edge_t,heap) *, graph_size);
3407 - graph->preds = XCNEWVEC (VEC(constraint_edge_t,heap) *, graph_size);
3408 - graph->zero_weight_succs = XCNEWVEC (bitmap, graph_size);
3409 - graph->zero_weight_preds = XCNEWVEC (bitmap, graph_size);
3410 + graph->size = (VEC_length (varinfo_t, varmap)) * 3;
3411 + graph->succs = XCNEWVEC (bitmap, graph->size);
3412 + graph->implicit_preds = XCNEWVEC (bitmap, graph->size);
3413 + graph->preds = XCNEWVEC (bitmap, graph->size);
3414 + graph->indirect_cycles = XNEWVEC (int, VEC_length (varinfo_t, varmap));
3415 + graph->label = XCNEWVEC (unsigned int, graph->size);
3416 + graph->rep = XNEWVEC (unsigned int, graph->size);
3417 + graph->eq_rep = XNEWVEC (int, graph->size);
3418 + graph->complex = XCNEWVEC (VEC(constraint_t, heap) *,
3419 + VEC_length (varinfo_t, varmap));
3420 + graph->direct_nodes = sbitmap_alloc (graph->size);
3421 + sbitmap_zero (graph->direct_nodes);
3423 + for (j = 0; j < FIRST_REF_NODE; j++)
3425 + if (!get_varinfo (j)->is_special_var)
3426 + SET_BIT (graph->direct_nodes, j);
3429 + for (j = 0; j < graph->size; j++)
3431 + graph->rep[j] = j;
3432 + graph->eq_rep[j] = -1;
3435 + for (j = 0; j < VEC_length (varinfo_t, varmap); j++)
3436 + graph->indirect_cycles[j] = -1;
3438 for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
3440 struct constraint_expr lhs = c->lhs;
3441 @@ -1217,31 +978,92 @@
3443 if (lhs.type == DEREF)
3445 - /* *x = y or *x = &y (complex) */
3446 - if (rhs.type == ADDRESSOF || rhsvar > anything_id)
3447 - insert_into_complex (lhsvar, c);
3449 + if (rhs.offset == 0 && lhs.offset == 0 && rhs.type == SCALAR)
3450 + add_pred_graph_edge (graph, FIRST_REF_NODE + lhsvar, rhsvar);
3451 + if (rhs.type == ADDRESSOF)
3452 + RESET_BIT (graph->direct_nodes, rhsvar);
3454 else if (rhs.type == DEREF)
3456 - /* !special var= *y */
3457 - if (!(get_varinfo (lhsvar)->is_special_var))
3458 - insert_into_complex (rhsvar, c);
3460 + if (rhs.offset == 0 && lhs.offset == 0 && lhs.type == SCALAR)
3461 + add_pred_graph_edge (graph, lhsvar, FIRST_REF_NODE + rhsvar);
3463 + RESET_BIT (graph->direct_nodes, lhsvar);
3465 else if (rhs.type == ADDRESSOF)
3468 + add_pred_graph_edge (graph, lhsvar, FIRST_ADDR_NODE + rhsvar);
3469 + /* Implicitly, *x = y */
3470 + add_implicit_graph_edge (graph, FIRST_REF_NODE + lhsvar, rhsvar);
3472 + RESET_BIT (graph->direct_nodes, rhsvar);
3474 + else if (lhsvar > anything_id
3475 + && lhsvar != rhsvar && lhs.offset == 0 && rhs.offset == 0)
3478 + add_pred_graph_edge (graph, lhsvar, rhsvar);
3479 + /* Implicitly, *x = *y */
3480 + add_implicit_graph_edge (graph, FIRST_REF_NODE + lhsvar,
3481 + FIRST_REF_NODE + rhsvar);
3483 + else if (lhs.offset != 0 || rhs.offset != 0)
3485 + if (rhs.offset != 0)
3486 + RESET_BIT (graph->direct_nodes, lhs.var);
3487 + if (lhs.offset != 0)
3488 + RESET_BIT (graph->direct_nodes, rhs.var);
3493 +/* Build the constraint graph, adding successor edges. */
3496 +build_succ_graph (void)
3501 + for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
3503 + struct constraint_expr lhs;
3504 + struct constraint_expr rhs;
3505 + unsigned int lhsvar;
3506 + unsigned int rhsvar;
3513 + lhsvar = find (get_varinfo_fc (lhs.var)->id);
3514 + rhsvar = find (get_varinfo_fc (rhs.var)->id);
3516 + if (lhs.type == DEREF)
3518 + if (rhs.offset == 0 && lhs.offset == 0 && rhs.type == SCALAR)
3519 + add_graph_edge (graph, FIRST_REF_NODE + lhsvar, rhsvar);
3521 + else if (rhs.type == DEREF)
3523 + if (rhs.offset == 0 && lhs.offset == 0 && lhs.type == SCALAR)
3524 + add_graph_edge (graph, lhsvar, FIRST_REF_NODE + rhsvar);
3526 + else if (rhs.type == ADDRESSOF)
3529 + gcc_assert (find (get_varinfo_fc (rhs.var)->id)
3530 + == get_varinfo_fc (rhs.var)->id);
3531 bitmap_set_bit (get_varinfo (lhsvar)->solution, rhsvar);
3533 - else if (lhsvar > anything_id)
3534 + else if (lhsvar > anything_id
3535 + && lhsvar != rhsvar && lhs.offset == 0 && rhs.offset == 0)
3537 - /* Ignore 0 weighted self edges, as they can't possibly contribute
3539 - if (lhsvar != rhsvar || rhs.offset != 0 || lhs.offset != 0)
3541 - /* x = y (simple) */
3542 - int_add_graph_edge (graph, lhs.var, rhs.var, rhs.offset);
3545 + add_graph_edge (graph, lhsvar, rhsvar);
3549 @@ -1260,20 +1082,20 @@
3553 - sbitmap in_component;
3555 + unsigned int *dfs;
3556 + unsigned int *node_mapping;
3558 - unsigned int *visited_index;
3559 VEC(unsigned,heap) *scc_stack;
3560 - VEC(unsigned,heap) *unification_queue;
3564 /* Recursive routine to find strongly connected components in GRAPH.
3565 SI is the SCC info to store the information in, and N is the id of current
3566 graph node we are processing.
3569 This is Tarjan's strongly connected component finding algorithm, as
3570 - modified by Nuutila to keep only non-root nodes on the stack.
3571 + modified by Nuutila to keep only non-root nodes on the stack.
3572 The algorithm can be found in "On finding the strongly connected
3573 connected components in a directed graph" by Esko Nuutila and Eljas
3574 Soisalon-Soininen, in Information Processing Letters volume 49,
3575 @@ -1284,188 +1106,144 @@
3579 + unsigned int my_dfs;
3581 - gcc_assert (get_varinfo (n)->node == n);
3582 SET_BIT (si->visited, n);
3583 - RESET_BIT (si->in_component, n);
3584 - si->visited_index[n] = si->current_index ++;
3586 + si->dfs[n] = si->current_index ++;
3587 + my_dfs = si->dfs[n];
3589 /* Visit all the successors. */
3590 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_succs[n], 0, i, bi)
3591 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[n], 0, i, bi)
3593 - unsigned int w = i;
3596 + if (i > LAST_REF_NODE)
3600 + if (TEST_BIT (si->roots, w))
3603 if (!TEST_BIT (si->visited, w))
3604 scc_visit (graph, si, w);
3605 - if (!TEST_BIT (si->in_component, w))
3607 - unsigned int t = get_varinfo (w)->node;
3608 - unsigned int nnode = get_varinfo (n)->node;
3609 - if (si->visited_index[t] < si->visited_index[nnode])
3610 - get_varinfo (n)->node = t;
3613 + unsigned int t = find (w);
3614 + unsigned int nnode = find (n);
3615 + gcc_assert (nnode == n);
3617 + if (si->dfs[t] < si->dfs[nnode])
3618 + si->dfs[n] = si->dfs[t];
3623 /* See if any components have been identified. */
3624 - if (get_varinfo (n)->node == n)
3625 + if (si->dfs[n] == my_dfs)
3627 - unsigned int t = si->visited_index[n];
3628 - SET_BIT (si->in_component, n);
3629 - while (VEC_length (unsigned, si->scc_stack) != 0
3630 - && t < si->visited_index[VEC_last (unsigned, si->scc_stack)])
3631 + if (VEC_length (unsigned, si->scc_stack) > 0
3632 + && si->dfs[VEC_last (unsigned, si->scc_stack)] >= my_dfs)
3634 - unsigned int w = VEC_pop (unsigned, si->scc_stack);
3635 - get_varinfo (w)->node = n;
3636 - SET_BIT (si->in_component, w);
3637 - /* Mark this node for collapsing. */
3638 - VEC_safe_push (unsigned, heap, si->unification_queue, w);
3642 - VEC_safe_push (unsigned, heap, si->scc_stack, n);
3644 + bitmap scc = BITMAP_ALLOC (NULL);
3645 + bool have_ref_node = n >= FIRST_REF_NODE;
3646 + unsigned int lowest_node;
3647 + bitmap_iterator bi;
3649 + bitmap_set_bit (scc, n);
3651 -/* Collapse two variables into one variable. */
3652 + while (VEC_length (unsigned, si->scc_stack) != 0
3653 + && si->dfs[VEC_last (unsigned, si->scc_stack)] >= my_dfs)
3655 + unsigned int w = VEC_pop (unsigned, si->scc_stack);
3658 -collapse_nodes (constraint_graph_t graph, unsigned int to, unsigned int from)
3660 - bitmap tosol, fromsol;
3661 + bitmap_set_bit (scc, w);
3662 + if (w >= FIRST_REF_NODE)
3663 + have_ref_node = true;
3666 - condense_varmap_nodes (to, from);
3667 - tosol = get_varinfo (to)->solution;
3668 - fromsol = get_varinfo (from)->solution;
3669 - bitmap_ior_into (tosol, fromsol);
3670 - merge_graph_nodes (graph, to, from);
3672 - if (valid_graph_edge (graph, to, to))
3674 - if (graph->zero_weight_preds[to])
3676 - bitmap_clear_bit (graph->zero_weight_preds[to], to);
3677 - bitmap_clear_bit (graph->zero_weight_succs[to], to);
3678 + lowest_node = bitmap_first_set_bit (scc);
3679 + gcc_assert (lowest_node < FIRST_REF_NODE);
3680 + EXECUTE_IF_SET_IN_BITMAP (scc, 0, i, bi)
3682 + if (i < FIRST_REF_NODE)
3684 + /* Mark this node for collapsing. */
3685 + if (unite (lowest_node, i))
3686 + unify_nodes (graph, lowest_node, i, false);
3690 + unite (lowest_node, i);
3691 + graph->indirect_cycles[i - FIRST_REF_NODE] = lowest_node;
3695 - if (valid_weighted_graph_edge (graph, to, to))
3697 - bitmap weights = *(get_graph_weights (graph, to, to));
3698 - if (!weights || bitmap_empty_p (weights))
3699 - erase_graph_self_edge (graph, to);
3701 + SET_BIT (si->roots, n);
3703 - BITMAP_FREE (fromsol);
3704 - get_varinfo (to)->address_taken |= get_varinfo (from)->address_taken;
3705 - get_varinfo (to)->indirect_target |= get_varinfo (from)->indirect_target;
3707 + VEC_safe_push (unsigned, heap, si->scc_stack, n);
3710 +/* Unify node FROM into node TO, updating the changed count if
3711 + necessary when UPDATE_CHANGED is true. */
3713 -/* Unify nodes in GRAPH that we have found to be part of a cycle.
3714 - SI is the Strongly Connected Components information structure that tells us
3715 - what components to unify.
3716 - UPDATE_CHANGED should be set to true if the changed sbitmap and changed
3717 - count should be updated to reflect the unification. */
3720 -process_unification_queue (constraint_graph_t graph, struct scc_info *si,
3721 - bool update_changed)
3722 +unify_nodes (constraint_graph_t graph, unsigned int to, unsigned int from,
3723 + bool update_changed)
3726 - bitmap tmp = BITMAP_ALLOC (update_changed ? &iteration_obstack : NULL);
3727 - bitmap_clear (tmp);
3729 - /* We proceed as follows:
3730 + gcc_assert (to != from && find (to) == to);
3731 + if (dump_file && (dump_flags & TDF_DETAILS))
3732 + fprintf (dump_file, "Unifying %s to %s\n",
3733 + get_varinfo (from)->name,
3734 + get_varinfo (to)->name);
3736 - For each component in the queue (components are delineated by
3737 - when current_queue_element->node != next_queue_element->node):
3738 + if (update_changed)
3739 + stats.unified_vars_dynamic++;
3741 + stats.unified_vars_static++;
3743 - rep = representative node for component
3744 + merge_graph_nodes (graph, to, from);
3745 + merge_node_constraints (graph, to, from);
3747 - For each node (tounify) to be unified in the component,
3748 - merge the solution for tounify into tmp bitmap
3750 - clear solution for tounify
3752 - merge edges from tounify into rep
3754 - merge complex constraints from tounify into rep
3756 - update changed count to note that tounify will never change
3759 - Merge tmp into solution for rep, marking rep changed if this
3760 - changed rep's solution.
3762 - Delete any 0 weighted self-edges we now have for rep. */
3763 - while (i != VEC_length (unsigned, si->unification_queue))
3764 + if (update_changed && TEST_BIT (changed, from))
3766 - unsigned int tounify = VEC_index (unsigned, si->unification_queue, i);
3767 - unsigned int n = get_varinfo (tounify)->node;
3769 - if (dump_file && (dump_flags & TDF_DETAILS))
3770 - fprintf (dump_file, "Unifying %s to %s\n",
3771 - get_varinfo (tounify)->name,
3772 - get_varinfo (n)->name);
3773 - if (update_changed)
3774 - stats.unified_vars_dynamic++;
3775 + RESET_BIT (changed, from);
3776 + if (!TEST_BIT (changed, to))
3777 + SET_BIT (changed, to);
3779 - stats.unified_vars_static++;
3780 - bitmap_ior_into (tmp, get_varinfo (tounify)->solution);
3781 - merge_graph_nodes (graph, n, tounify);
3782 - condense_varmap_nodes (n, tounify);
3784 - if (update_changed && TEST_BIT (changed, tounify))
3786 - RESET_BIT (changed, tounify);
3787 - if (!TEST_BIT (changed, n))
3788 - SET_BIT (changed, n);
3791 - gcc_assert (changed_count > 0);
3794 + gcc_assert (changed_count > 0);
3799 - bitmap_clear (get_varinfo (tounify)->solution);
3802 - /* If we've either finished processing the entire queue, or
3803 - finished processing all nodes for component n, update the solution for
3805 - if (i == VEC_length (unsigned, si->unification_queue)
3806 - || get_varinfo (VEC_index (unsigned, si->unification_queue, i))->node != n)
3807 + /* If the solution changes because of the merging, we need to mark
3808 + the variable as changed. */
3809 + if (bitmap_ior_into (get_varinfo (to)->solution,
3810 + get_varinfo (from)->solution))
3812 + if (update_changed && !TEST_BIT (changed, to))
3814 - /* If the solution changes because of the merging, we need to mark
3815 - the variable as changed. */
3816 - if (bitmap_ior_into (get_varinfo (n)->solution, tmp))
3818 - if (update_changed && !TEST_BIT (changed, n))
3820 - SET_BIT (changed, n);
3824 - bitmap_clear (tmp);
3826 - if (valid_graph_edge (graph, n, n))
3828 - if (graph->zero_weight_succs[n])
3830 - if (graph->zero_weight_preds[n])
3831 - bitmap_clear_bit (graph->zero_weight_preds[n], n);
3832 - bitmap_clear_bit (graph->zero_weight_succs[n], n);
3834 - if (valid_weighted_graph_edge (graph, n, n))
3836 - bitmap weights = *(get_graph_weights (graph, n, n));
3837 - if (!weights || bitmap_empty_p (weights))
3838 - erase_graph_self_edge (graph, n);
3841 + SET_BIT (changed, to);
3845 - BITMAP_FREE (tmp);
3847 + BITMAP_FREE (get_varinfo (from)->solution);
3848 + BITMAP_FREE (get_varinfo (from)->oldsolution);
3850 + if (stats.iterations > 0)
3852 + BITMAP_FREE (get_varinfo (to)->oldsolution);
3853 + get_varinfo (to)->oldsolution = BITMAP_ALLOC (&oldpta_obstack);
3856 + if (valid_graph_edge (graph, to, to))
3858 + if (graph->succs[to])
3859 + bitmap_clear_bit (graph->succs[to], to);
3864 /* Information needed to compute the topological ordering of a graph. */
3867 @@ -1509,37 +1287,24 @@
3868 topo_visit (constraint_graph_t graph, struct topo_info *ti,
3871 - VEC(constraint_edge_t,heap) *succs = graph->succs[n];
3874 - constraint_edge_t c;
3878 SET_BIT (ti->visited, n);
3879 - if (VEC_length (constraint_edge_t, succs) != 0)
3881 - temp = BITMAP_ALLOC (&iteration_obstack);
3882 - if (graph->zero_weight_succs[n])
3883 - bitmap_ior_into (temp, graph->zero_weight_succs[n]);
3884 - for (i = 0; VEC_iterate (constraint_edge_t, succs, i, c); i++)
3885 - bitmap_set_bit (temp, c->dest);
3888 - temp = graph->zero_weight_succs[n];
3891 - EXECUTE_IF_SET_IN_BITMAP (temp, 0, j, bi)
3892 + if (graph->succs[n])
3893 + EXECUTE_IF_SET_IN_BITMAP (graph->succs[n], 0, j, bi)
3895 if (!TEST_BIT (ti->visited, j))
3896 topo_visit (graph, ti, j);
3899 VEC_safe_push (unsigned, heap, ti->topo_order, n);
3902 /* Return true if variable N + OFFSET is a legal field of N. */
3906 type_safe (unsigned int n, unsigned HOST_WIDE_INT *offset)
3908 varinfo_t ninfo = get_varinfo (n);
3909 @@ -1582,10 +1347,10 @@
3910 v = first_vi_for_offset (get_varinfo (j), fieldoffset);
3915 sol = get_varinfo (t)->solution;
3916 if (!bitmap_bit_p (sol, rhs))
3919 bitmap_set_bit (sol, rhs);
3920 if (!TEST_BIT (changed, t))
3922 @@ -1596,7 +1361,7 @@
3924 else if (0 && dump_file && !(get_varinfo (j)->is_special_var))
3925 fprintf (dump_file, "Untypesafe usage in do_da_constraint.\n");
3931 @@ -1607,7 +1372,7 @@
3932 do_sd_constraint (constraint_graph_t graph, constraint_t c,
3935 - unsigned int lhs = get_varinfo (c->lhs.var)->node;
3936 + unsigned int lhs = find (c->lhs.var);
3938 bitmap sol = get_varinfo (lhs)->solution;
3940 @@ -1620,7 +1385,7 @@
3941 bitmap_set_bit (sol, anything_id);
3944 - /* For each variable j in delta (Sol(y)), add
3945 + /* For each variable j in delta (Sol(y)), add
3946 an edge in the graph from j to x, and union Sol(j) into Sol(x). */
3947 EXECUTE_IF_SET_IN_BITMAP (delta, 0, j, bi)
3949 @@ -1634,18 +1399,18 @@
3950 v = first_vi_for_offset (get_varinfo (j), fieldoffset);
3956 /* Adding edges from the special vars is pointless.
3957 They don't have sets that can change. */
3958 if (get_varinfo (t) ->is_special_var)
3959 flag |= bitmap_ior_into (sol, get_varinfo (t)->solution);
3960 - else if (int_add_graph_edge (graph, lhs, t, 0))
3961 + else if (add_graph_edge (graph, lhs, t))
3962 flag |= bitmap_ior_into (sol, get_varinfo (t)->solution);
3964 else if (0 && dump_file && !(get_varinfo (j)->is_special_var))
3965 fprintf (dump_file, "Untypesafe usage in do_sd_constraint\n");
3971 @@ -1658,15 +1423,15 @@
3972 SET_BIT (changed, lhs);
3979 /* Process a constraint C that represents *x = y. */
3982 -do_ds_constraint (constraint_graph_t graph, constraint_t c, bitmap delta)
3983 +do_ds_constraint (constraint_t c, bitmap delta)
3985 - unsigned int rhs = get_varinfo (c->rhs.var)->node;
3986 + unsigned int rhs = find (c->rhs.var);
3987 unsigned HOST_WIDE_INT roff = c->rhs.offset;
3988 bitmap sol = get_varinfo (rhs)->solution;
3990 @@ -1685,8 +1450,8 @@
3991 v = first_vi_for_offset (get_varinfo (j), fieldoffset);
3998 if (!bitmap_bit_p (get_varinfo (t)->solution, anything_id))
4000 bitmap_set_bit (get_varinfo (t)->solution, anything_id);
4001 @@ -1705,40 +1470,39 @@
4002 EXECUTE_IF_SET_IN_BITMAP (delta, 0, j, bi)
4004 unsigned HOST_WIDE_INT loff = c->lhs.offset;
4005 - if (type_safe (j, &loff) && !(get_varinfo(j)->is_special_var))
4006 + if (type_safe (j, &loff) && !(get_varinfo (j)->is_special_var))
4010 unsigned HOST_WIDE_INT fieldoffset = get_varinfo (j)->offset + loff;
4013 v = first_vi_for_offset (get_varinfo (j), fieldoffset);
4017 - if (int_add_graph_edge (graph, t, rhs, roff))
4019 + tmp = get_varinfo (t)->solution;
4021 + if (set_union_with_increment (tmp, sol, roff))
4023 - bitmap tmp = get_varinfo (t)->solution;
4024 - if (set_union_with_increment (tmp, sol, roff))
4025 + get_varinfo (t)->solution = tmp;
4027 + sol = get_varinfo (rhs)->solution;
4028 + if (!TEST_BIT (changed, t))
4030 - get_varinfo (t)->solution = tmp;
4032 - sol = get_varinfo (rhs)->solution;
4033 - if (!TEST_BIT (changed, t))
4035 - SET_BIT (changed, t);
4038 + SET_BIT (changed, t);
4044 else if (0 && dump_file && !(get_varinfo (j)->is_special_var))
4045 fprintf (dump_file, "Untypesafe usage in do_ds_constraint\n");
4049 -/* Handle a non-simple (simple meaning requires no iteration), non-copy
4050 - constraint (IE *x = &y, x = *y, and *x = y). */
4052 +/* Handle a non-simple (simple meaning requires no iteration),
4053 + constraint (IE *x = &y, x = *y, *x = y, and x = y with offsets involved). */
4056 do_complex_constraint (constraint_graph_t graph, constraint_t c, bitmap delta)
4058 @@ -1752,33 +1516,62 @@
4062 - do_ds_constraint (graph, c, delta);
4063 + do_ds_constraint (c, delta);
4067 + else if (c->rhs.type == DEREF)
4070 if (!(get_varinfo (c->lhs.var)->is_special_var))
4071 do_sd_constraint (graph, c, delta);
4077 + bool flag = false;
4080 + gcc_assert (c->rhs.type == SCALAR && c->lhs.type == SCALAR);
4081 + t = find (c->rhs.var);
4082 + solution = get_varinfo (t)->solution;
4083 + t = find (c->lhs.var);
4084 + tmp = get_varinfo (t)->solution;
4086 + flag = set_union_with_increment (tmp, solution, c->rhs.offset);
4090 + get_varinfo (t)->solution = tmp;
4091 + if (!TEST_BIT (changed, t))
4093 + SET_BIT (changed, t);
4100 /* Initialize and return a new SCC info structure. */
4102 static struct scc_info *
4103 -init_scc_info (void)
4104 +init_scc_info (size_t size)
4106 struct scc_info *si = XNEW (struct scc_info);
4107 - size_t size = VEC_length (varinfo_t, varmap);
4110 si->current_index = 0;
4111 si->visited = sbitmap_alloc (size);
4112 sbitmap_zero (si->visited);
4113 - si->in_component = sbitmap_alloc (size);
4114 - sbitmap_ones (si->in_component);
4115 - si->visited_index = XCNEWVEC (unsigned int, size + 1);
4116 + si->roots = sbitmap_alloc (size);
4117 + sbitmap_zero (si->roots);
4118 + si->node_mapping = XNEWVEC (unsigned int, size);
4119 + si->dfs = XCNEWVEC (unsigned int, size);
4121 + for (i = 0; i < size; i++)
4122 + si->node_mapping[i] = i;
4124 si->scc_stack = VEC_alloc (unsigned, heap, 1);
4125 - si->unification_queue = VEC_alloc (unsigned, heap, 1);
4129 @@ -1786,209 +1579,430 @@
4132 free_scc_info (struct scc_info *si)
4135 sbitmap_free (si->visited);
4136 - sbitmap_free (si->in_component);
4137 - free (si->visited_index);
4138 + sbitmap_free (si->roots);
4139 + free (si->node_mapping);
4141 VEC_free (unsigned, heap, si->scc_stack);
4142 - VEC_free (unsigned, heap, si->unification_queue);
4148 -/* Find cycles in GRAPH that occur, using strongly connected components, and
4149 - collapse the cycles into a single representative node. if UPDATE_CHANGED
4150 - is true, then update the changed sbitmap to note those nodes whose
4151 - solutions have changed as a result of collapsing. */
4152 +/* Find indirect cycles in GRAPH that occur, using strongly connected
4153 + components, and note them in the indirect cycles map.
4155 + This technique comes from Ben Hardekopf and Calvin Lin,
4156 + "It Pays to be Lazy: Fast and Accurate Pointer Analysis for Millions of
4157 + Lines of Code", submitted to PLDI 2007. */
4160 -find_and_collapse_graph_cycles (constraint_graph_t graph, bool update_changed)
4161 +find_indirect_cycles (constraint_graph_t graph)
4164 - unsigned int size = VEC_length (varinfo_t, varmap);
4165 - struct scc_info *si = init_scc_info ();
4166 + unsigned int size = graph->size;
4167 + struct scc_info *si = init_scc_info (size);
4169 - for (i = 0; i != size; ++i)
4170 - if (!TEST_BIT (si->visited, i) && get_varinfo (i)->node == i)
4171 + for (i = 0; i < MIN (LAST_REF_NODE, size); i ++ )
4172 + if (!TEST_BIT (si->visited, i) && find (i) == i)
4173 scc_visit (graph, si, i);
4175 - process_unification_queue (graph, si, update_changed);
4180 /* Compute a topological ordering for GRAPH, and store the result in the
4181 topo_info structure TI. */
4185 compute_topo_order (constraint_graph_t graph,
4186 struct topo_info *ti)
4189 unsigned int size = VEC_length (varinfo_t, varmap);
4192 for (i = 0; i != size; ++i)
4193 - if (!TEST_BIT (ti->visited, i) && get_varinfo (i)->node == i)
4194 + if (!TEST_BIT (ti->visited, i) && find (i) == i)
4195 topo_visit (graph, ti, i);
4198 -/* Return true if bitmap B is empty, or a bitmap other than bit 0 is set. */
4199 +/* Perform offline variable substitution.
4202 -bitmap_other_than_zero_bit_set (bitmap b)
4205 - bitmap_iterator bi;
4207 - if (bitmap_empty_p (b))
4209 - EXECUTE_IF_SET_IN_BITMAP (b, 1, i, bi)
4214 -/* Perform offline variable substitution.
4216 This is a linear time way of identifying variables that must have
4217 equivalent points-to sets, including those caused by static cycles,
4218 and single entry subgraphs, in the constraint graph.
4220 The technique is described in "Off-line variable substitution for
4221 scaling points-to analysis" by Atanas Rountev and Satish Chandra,
4222 - in "ACM SIGPLAN Notices" volume 35, number 5, pages 47-56. */
4223 + in "ACM SIGPLAN Notices" volume 35, number 5, pages 47-56.
4225 + There is an optimal way to do this involving hash based value
4226 + numbering, once the technique is published i will implement it
4229 + The general method of finding equivalence classes is as follows:
4230 + Add fake nodes (REF nodes) and edges for *a = b and a = *b constraints.
4231 + Add fake nodes (ADDRESS nodes) and edges for a = &b constraints.
4232 + Initialize all non-REF/ADDRESS nodes to be direct nodes
4233 + For each SCC in the predecessor graph:
4234 + for each member (x) of the SCC
4235 + if x is not a direct node:
4236 + set rootnode(SCC) to be not a direct node
4237 + collapse node x into rootnode(SCC).
4238 + if rootnode(SCC) is not a direct node:
4239 + label rootnode(SCC) with a new equivalence class
4241 + if all labeled predecessors of rootnode(SCC) have the same
4243 + label rootnode(SCC) with this label
4245 + label rootnode(SCC) with a new equivalence class
4247 + All direct nodes with the same equivalence class can be replaced
4248 + with a single representative node.
4249 + All unlabeled nodes (label == 0) are not pointers and all edges
4250 + involving them can be eliminated.
4251 + We perform these optimizations during move_complex_constraints.
4254 +static int equivalence_class;
4256 +/* Recursive routine to find strongly connected components in GRAPH,
4257 + and label it's nodes with equivalence classes.
4258 + This is used during variable substitution to find cycles involving
4259 + the regular or implicit predecessors, and label them as equivalent.
4260 + The SCC finding algorithm used is the same as that for scc_visit. */
4263 -perform_var_substitution (constraint_graph_t graph)
4264 +label_visit (constraint_graph_t graph, struct scc_info *si, unsigned int n)
4266 - struct topo_info *ti = init_topo_info ();
4268 - bitmap_obstack_initialize (&iteration_obstack);
4269 - /* Compute the topological ordering of the graph, then visit each
4270 - node in topological order. */
4271 - compute_topo_order (graph, ti);
4273 - while (VEC_length (unsigned, ti->topo_order) != 0)
4275 + bitmap_iterator bi;
4276 + unsigned int my_dfs;
4278 + gcc_assert (si->node_mapping[n] == n);
4279 + SET_BIT (si->visited, n);
4280 + si->dfs[n] = si->current_index ++;
4281 + my_dfs = si->dfs[n];
4283 + /* Visit all the successors. */
4284 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->preds[n], 0, i, bi)
4286 - unsigned int i = VEC_pop (unsigned, ti->topo_order);
4287 - unsigned int pred;
4288 - varinfo_t vi = get_varinfo (i);
4289 - bool okay_to_elim = false;
4290 - unsigned int root = VEC_length (varinfo_t, varmap);
4291 - VEC(constraint_edge_t,heap) *predvec = graph->preds[i];
4292 - constraint_edge_t ce = NULL;
4295 - bitmap_iterator bi;
4296 + unsigned int w = si->node_mapping[i];
4298 - /* We can't eliminate things whose address is taken, or which is
4299 - the target of a dereference. */
4300 - if (vi->address_taken || vi->indirect_target)
4301 + if (TEST_BIT (si->roots, w))
4304 - /* See if all predecessors of I are ripe for elimination */
4305 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_preds[i], 0, k, bi)
4308 - w = get_varinfo (k)->node;
4309 + if (!TEST_BIT (si->visited, w))
4310 + label_visit (graph, si, w);
4312 + unsigned int t = si->node_mapping[w];
4313 + unsigned int nnode = si->node_mapping[n];
4314 + gcc_assert (nnode == n);
4316 - /* We can't eliminate the node if one of the predecessors is
4317 - part of a different strongly connected component. */
4318 - if (!okay_to_elim)
4321 - okay_to_elim = true;
4323 - else if (w != root)
4325 - okay_to_elim = false;
4328 + if (si->dfs[t] < si->dfs[nnode])
4329 + si->dfs[n] = si->dfs[t];
4333 - /* Theorem 4 in Rountev and Chandra: If i is a direct node,
4334 - then Solution(i) is a subset of Solution (w), where w is a
4335 - predecessor in the graph.
4336 - Corollary: If all predecessors of i have the same
4337 - points-to set, then i has that same points-to set as
4338 - those predecessors. */
4339 - tmp = BITMAP_ALLOC (NULL);
4340 - bitmap_and_compl (tmp, get_varinfo (i)->solution,
4341 - get_varinfo (w)->solution);
4342 - if (!bitmap_empty_p (tmp))
4344 - okay_to_elim = false;
4345 - BITMAP_FREE (tmp);
4348 - BITMAP_FREE (tmp);
4350 + /* Visit all the implicit predecessors. */
4351 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->implicit_preds[n], 0, i, bi)
4353 + unsigned int w = si->node_mapping[i];
4357 - VEC_iterate (constraint_edge_t, predvec, pred, ce);
4362 - weight = *(get_graph_weights (graph, i, ce->dest));
4363 + if (TEST_BIT (si->roots, w))
4366 - /* We can't eliminate variables that have nonzero weighted
4367 - edges between them. */
4368 - if (weight && bitmap_other_than_zero_bit_set (weight))
4370 - okay_to_elim = false;
4373 - w = get_varinfo (ce->dest)->node;
4374 + if (!TEST_BIT (si->visited, w))
4375 + label_visit (graph, si, w);
4377 + unsigned int t = si->node_mapping[w];
4378 + unsigned int nnode = si->node_mapping[n];
4379 + gcc_assert (nnode == n);
4381 - /* We can't eliminate the node if one of the predecessors is
4382 - part of a different strongly connected component. */
4383 - if (!okay_to_elim)
4386 - okay_to_elim = true;
4388 - else if (w != root)
4390 - okay_to_elim = false;
4393 + if (si->dfs[t] < si->dfs[nnode])
4394 + si->dfs[n] = si->dfs[t];
4398 - /* Theorem 4 in Rountev and Chandra: If i is a direct node,
4399 - then Solution(i) is a subset of Solution (w), where w is a
4400 - predecessor in the graph.
4401 - Corollary: If all predecessors of i have the same
4402 - points-to set, then i has that same points-to set as
4403 - those predecessors. */
4404 - tmp = BITMAP_ALLOC (NULL);
4405 - bitmap_and_compl (tmp, get_varinfo (i)->solution,
4406 - get_varinfo (w)->solution);
4407 - if (!bitmap_empty_p (tmp))
4409 - okay_to_elim = false;
4410 - BITMAP_FREE (tmp);
4413 - BITMAP_FREE (tmp);
4415 + /* See if any components have been identified. */
4416 + if (si->dfs[n] == my_dfs)
4418 + while (VEC_length (unsigned, si->scc_stack) != 0
4419 + && si->dfs[VEC_last (unsigned, si->scc_stack)] >= my_dfs)
4421 + unsigned int w = VEC_pop (unsigned, si->scc_stack);
4422 + si->node_mapping[w] = n;
4424 - /* See if the root is different than the original node.
4425 - If so, we've found an equivalence. */
4426 - if (root != get_varinfo (i)->node && okay_to_elim)
4427 + if (!TEST_BIT (graph->direct_nodes, w))
4428 + RESET_BIT (graph->direct_nodes, n);
4430 + SET_BIT (si->roots, n);
4432 + if (!TEST_BIT (graph->direct_nodes, n))
4434 - /* Found an equivalence */
4435 - get_varinfo (i)->node = root;
4436 - collapse_nodes (graph, root, i);
4437 + graph->label[n] = equivalence_class++;
4441 + unsigned int size = 0;
4442 + unsigned int firstlabel = ~0;
4444 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->preds[n], 0, i, bi)
4446 + unsigned int j = si->node_mapping[i];
4448 + if (j == n || graph->label[j] == 0)
4451 + if (firstlabel == (unsigned int)~0)
4453 + firstlabel = graph->label[j];
4456 + else if (graph->label[j] != firstlabel)
4461 + graph->label[n] = 0;
4462 + else if (size == 1)
4463 + graph->label[n] = firstlabel;
4465 + graph->label[n] = equivalence_class++;
4469 + VEC_safe_push (unsigned, heap, si->scc_stack, n);
4472 +/* Perform offline variable substitution, discovering equivalence
4473 + classes, and eliminating non-pointer variables. */
4475 +static struct scc_info *
4476 +perform_var_substitution (constraint_graph_t graph)
4479 + unsigned int size = graph->size;
4480 + struct scc_info *si = init_scc_info (size);
4482 + bitmap_obstack_initialize (&iteration_obstack);
4483 + equivalence_class = 0;
4485 + /* We only need to visit the non-address nodes for labeling
4486 + purposes, as the address nodes will never have any predecessors,
4487 + because &x never appears on the LHS of a constraint. */
4488 + for (i = 0; i < LAST_REF_NODE; i++)
4489 + if (!TEST_BIT (si->visited, si->node_mapping[i]))
4490 + label_visit (graph, si, si->node_mapping[i]);
4492 + if (dump_file && (dump_flags & TDF_DETAILS))
4493 + for (i = 0; i < FIRST_REF_NODE; i++)
4495 + bool direct_node = TEST_BIT (graph->direct_nodes, i);
4496 + fprintf (dump_file,
4497 + "Equivalence class for %s node id %d:%s is %d\n",
4498 + direct_node ? "Direct node" : "Indirect node", i,
4499 + get_varinfo (i)->name,
4500 + graph->label[si->node_mapping[i]]);
4503 + /* Quickly eliminate our non-pointer variables. */
4505 + for (i = 0; i < FIRST_REF_NODE; i++)
4507 + unsigned int node = si->node_mapping[i];
4509 + if (graph->label[node] == 0 && TEST_BIT (graph->direct_nodes, node))
4511 if (dump_file && (dump_flags & TDF_DETAILS))
4512 - fprintf (dump_file, "Collapsing %s into %s\n",
4513 - get_varinfo (i)->name,
4514 - get_varinfo (root)->name);
4515 - stats.collapsed_vars++;
4516 + fprintf (dump_file,
4517 + "%s is a non-pointer variable, eliminating edges.\n",
4518 + get_varinfo (node)->name);
4519 + stats.nonpointer_vars++;
4520 + clear_edges_for_node (graph, node);
4526 +/* Free information that was only necessary for variable
4530 +free_var_substitution_info (struct scc_info *si)
4532 + free_scc_info (si);
4533 + free (graph->label);
4534 + free (graph->eq_rep);
4535 + sbitmap_free (graph->direct_nodes);
4536 bitmap_obstack_release (&iteration_obstack);
4537 - free_topo_info (ti);
4540 +/* Return an existing node that is equivalent to NODE, which has
4541 + equivalence class LABEL, if one exists. Return NODE otherwise. */
4543 +static unsigned int
4544 +find_equivalent_node (constraint_graph_t graph,
4545 + unsigned int node, unsigned int label)
4547 + /* If the address version of this variable is unused, we can
4548 + substitute it for anything else with the same label.
4549 + Otherwise, we know the pointers are equivalent, but not the
4552 + if (graph->label[FIRST_ADDR_NODE + node] == 0)
4554 + gcc_assert (label < graph->size);
4556 + if (graph->eq_rep[label] != -1)
4558 + /* Unify the two variables since we know they are equivalent. */
4559 + if (unite (graph->eq_rep[label], node))
4560 + unify_nodes (graph, graph->eq_rep[label], node, false);
4561 + return graph->eq_rep[label];
4565 + graph->eq_rep[label] = node;
4571 +/* Move complex constraints to the appropriate nodes, and collapse
4572 + variables we've discovered are equivalent during variable
4573 + substitution. SI is the SCC_INFO that is the result of
4574 + perform_variable_substitution. */
4577 +move_complex_constraints (constraint_graph_t graph,
4578 + struct scc_info *si)
4584 + for (j = 0; j < graph->size; j++)
4585 + gcc_assert (find (j) == j);
4587 + for (i = 0; VEC_iterate (constraint_t, constraints, i, c); i++)
4589 + struct constraint_expr lhs = c->lhs;
4590 + struct constraint_expr rhs = c->rhs;
4591 + unsigned int lhsvar = find (get_varinfo_fc (lhs.var)->id);
4592 + unsigned int rhsvar = find (get_varinfo_fc (rhs.var)->id);
4593 + unsigned int lhsnode, rhsnode;
4594 + unsigned int lhslabel, rhslabel;
4596 + lhsnode = si->node_mapping[lhsvar];
4597 + rhsnode = si->node_mapping[rhsvar];
4598 + lhslabel = graph->label[lhsnode];
4599 + rhslabel = graph->label[rhsnode];
4601 + /* See if it is really a non-pointer variable, and if so, ignore
4602 + the constraint. */
4603 + if (lhslabel == 0)
4605 + if (!TEST_BIT (graph->direct_nodes, lhsnode))
4606 + lhslabel = graph->label[lhsnode] = equivalence_class++;
4609 + if (dump_file && (dump_flags & TDF_DETAILS))
4612 + fprintf (dump_file, "%s is a non-pointer variable,"
4613 + "ignoring constraint:",
4614 + get_varinfo (lhs.var)->name);
4615 + dump_constraint (dump_file, c);
4617 + VEC_replace (constraint_t, constraints, i, NULL);
4622 + if (rhslabel == 0)
4624 + if (!TEST_BIT (graph->direct_nodes, rhsnode))
4625 + rhslabel = graph->label[rhsnode] = equivalence_class++;
4628 + if (dump_file && (dump_flags & TDF_DETAILS))
4631 + fprintf (dump_file, "%s is a non-pointer variable,"
4632 + "ignoring constraint:",
4633 + get_varinfo (rhs.var)->name);
4634 + dump_constraint (dump_file, c);
4636 + VEC_replace (constraint_t, constraints, i, NULL);
4641 + lhsvar = find_equivalent_node (graph, lhsvar, lhslabel);
4642 + rhsvar = find_equivalent_node (graph, rhsvar, rhslabel);
4643 + c->lhs.var = lhsvar;
4644 + c->rhs.var = rhsvar;
4646 + if (lhs.type == DEREF)
4648 + if (rhs.type == ADDRESSOF || rhsvar > anything_id)
4649 + insert_into_complex (graph, lhsvar, c);
4651 + else if (rhs.type == DEREF)
4653 + if (!(get_varinfo (lhsvar)->is_special_var))
4654 + insert_into_complex (graph, rhsvar, c);
4656 + else if (rhs.type != ADDRESSOF && lhsvar > anything_id
4657 + && (lhs.offset != 0 || rhs.offset != 0))
4659 + insert_into_complex (graph, rhsvar, c);
4665 +/* Eliminate indirect cycles involving NODE. Return true if NODE was
4666 + part of an SCC, false otherwise. */
4669 +eliminate_indirect_cycles (unsigned int node)
4671 + if (graph->indirect_cycles[node] != -1
4672 + && !bitmap_empty_p (get_varinfo (node)->solution))
4675 + VEC(unsigned,heap) *queue = NULL;
4677 + unsigned int to = find (graph->indirect_cycles[node]);
4678 + bitmap_iterator bi;
4680 + /* We can't touch the solution set and call unify_nodes
4681 + at the same time, because unify_nodes is going to do
4682 + bitmap unions into it. */
4684 + EXECUTE_IF_SET_IN_BITMAP (get_varinfo (node)->solution, 0, i, bi)
4686 + if (find (i) == i && i != to)
4688 + if (unite (to, i))
4689 + VEC_safe_push (unsigned, heap, queue, i);
4693 + for (queuepos = 0;
4694 + VEC_iterate (unsigned, queue, queuepos, i);
4697 + unify_nodes (graph, to, i, true);
4699 + VEC_free (unsigned, heap, queue);
4705 /* Solve the constraint graph GRAPH using our worklist solver.
4706 This is based on the PW* family of solvers from the "Efficient Field
4707 Sensitive Pointer Analysis for C" paper.
4708 @@ -2001,17 +2015,28 @@
4710 unsigned int size = VEC_length (varinfo_t, varmap);
4714 - changed_count = size;
4715 + changed_count = 0;
4716 changed = sbitmap_alloc (size);
4717 - sbitmap_ones (changed);
4719 - /* The already collapsed/unreachable nodes will never change, so we
4720 - need to account for them in changed_count. */
4721 + sbitmap_zero (changed);
4723 + /* Mark all initial non-collapsed nodes as changed. */
4724 for (i = 0; i < size; i++)
4725 - if (get_varinfo (i)->node != i)
4729 + varinfo_t ivi = get_varinfo (i);
4730 + if (find (i) == i && !bitmap_empty_p (ivi->solution)
4731 + && ((graph->succs[i] && !bitmap_empty_p (graph->succs[i]))
4732 + || VEC_length (constraint_t, graph->complex[i]) > 0))
4734 + SET_BIT (changed, i);
4739 + /* Allocate a bitmap to be used to store the changed bits. */
4740 + pts = BITMAP_ALLOC (&pta_obstack);
4742 while (changed_count > 0)
4745 @@ -2019,41 +2044,45 @@
4748 bitmap_obstack_initialize (&iteration_obstack);
4752 - /* We already did cycle elimination once, when we did
4753 - variable substitution, so we don't need it again for the
4754 - first iteration. */
4755 - if (stats.iterations > 1)
4756 - find_and_collapse_graph_cycles (graph, true);
4758 - edge_added = false;
4761 compute_topo_order (graph, ti);
4763 while (VEC_length (unsigned, ti->topo_order) != 0)
4766 i = VEC_pop (unsigned, ti->topo_order);
4767 - gcc_assert (get_varinfo (i)->node == i);
4769 + /* If this variable is not a representative, skip it. */
4770 + if (find (i) != i)
4773 + /* In certain indirect cycle cases, we may merge this
4774 + variable to another. */
4775 + if (eliminate_indirect_cycles (i) && find (i) != i)
4778 /* If the node has changed, we need to process the
4779 complex constraints and outgoing edges again. */
4780 if (TEST_BIT (changed, i))
4784 - constraint_edge_t e = NULL;
4786 - bitmap_iterator bi;
4787 - VEC(constraint_t,heap) *complex = get_varinfo (i)->complex;
4788 - VEC(constraint_edge_t,heap) *succs;
4789 + VEC(constraint_t,heap) *complex = graph->complex[i];
4790 bool solution_empty;
4792 RESET_BIT (changed, i);
4795 + /* Compute the changed set of solution bits. */
4796 + bitmap_and_compl (pts, get_varinfo (i)->solution,
4797 + get_varinfo (i)->oldsolution);
4799 + if (bitmap_empty_p (pts))
4802 + bitmap_ior_into (get_varinfo (i)->oldsolution, pts);
4804 solution = get_varinfo (i)->solution;
4805 solution_empty = bitmap_empty_p (solution);
4807 @@ -2065,52 +2094,38 @@
4808 is a constraint where the lhs side is receiving
4809 some set from elsewhere. */
4810 if (!solution_empty || c->lhs.type != DEREF)
4811 - do_complex_constraint (graph, c, solution);
4812 + do_complex_constraint (graph, c, pts);
4815 solution_empty = bitmap_empty_p (solution);
4817 if (!solution_empty)
4819 + bitmap_iterator bi;
4821 /* Propagate solution to all successors. */
4822 - succs = graph->succs[i];
4824 - EXECUTE_IF_IN_NONNULL_BITMAP (graph->zero_weight_succs[i],
4825 + EXECUTE_IF_IN_NONNULL_BITMAP (graph->succs[i],
4828 - bitmap tmp = get_varinfo (j)->solution;
4829 - bool flag = false;
4831 - flag = set_union_with_increment (tmp, solution, 0);
4835 - get_varinfo (j)->solution = tmp;
4836 - if (!TEST_BIT (changed, j))
4838 - SET_BIT (changed, j);
4843 - for (j = 0; VEC_iterate (constraint_edge_t, succs, j, e); j++)
4845 - bitmap tmp = get_varinfo (e->dest)->solution;
4846 - bool flag = false;
4848 - bitmap weights = e->weights;
4849 - bitmap_iterator bi;
4853 - gcc_assert (weights && !bitmap_empty_p (weights));
4854 - EXECUTE_IF_SET_IN_BITMAP (weights, 0, k, bi)
4855 - flag |= set_union_with_increment (tmp, solution, k);
4856 + unsigned int to = find (j);
4857 + tmp = get_varinfo (to)->solution;
4860 + /* Don't try to propagate to ourselves. */
4864 + flag = set_union_with_increment (tmp, pts, 0);
4868 - get_varinfo (e->dest)->solution = tmp;
4869 - if (!TEST_BIT (changed, e->dest))
4870 + get_varinfo (to)->solution = tmp;
4871 + if (!TEST_BIT (changed, to))
4873 - SET_BIT (changed, e->dest);
4874 + SET_BIT (changed, to);
4878 @@ -2122,74 +2137,37 @@
4879 bitmap_obstack_release (&iteration_obstack);
4882 + BITMAP_FREE (pts);
4883 sbitmap_free (changed);
4884 + bitmap_obstack_release (&oldpta_obstack);
4887 +/* Map from trees to variable infos. */
4888 +static struct pointer_map_t *vi_for_tree;
4890 -/* CONSTRAINT AND VARIABLE GENERATION FUNCTIONS */
4892 -/* Map from trees to variable ids. */
4893 -static htab_t id_for_tree;
4894 +/* Insert ID as the variable id for tree T in the vi_for_tree map. */
4896 -typedef struct tree_id
4898 +insert_vi_for_tree (tree t, varinfo_t vi)
4904 -/* Hash a tree id structure. */
4907 -tree_id_hash (const void *p)
4909 - const tree_id_t ta = (tree_id_t) p;
4910 - return htab_hash_pointer (ta->t);
4913 -/* Return true if the tree in P1 and the tree in P2 are the same. */
4916 -tree_id_eq (const void *p1, const void *p2)
4918 - const tree_id_t ta1 = (tree_id_t) p1;
4919 - const tree_id_t ta2 = (tree_id_t) p2;
4920 - return ta1->t == ta2->t;
4923 -/* Insert ID as the variable id for tree T in the hashtable. */
4926 -insert_id_for_tree (tree t, int id)
4929 - struct tree_id finder;
4930 - tree_id_t new_pair;
4933 - slot = htab_find_slot (id_for_tree, &finder, INSERT);
4934 + void **slot = pointer_map_insert (vi_for_tree, t);
4936 gcc_assert (*slot == NULL);
4937 - new_pair = XNEW (struct tree_id);
4939 - new_pair->id = id;
4940 - *slot = (void *)new_pair;
4944 -/* Find the variable id for tree T in ID_FOR_TREE. If T does not
4945 - exist in the hash table, return false, otherwise, return true and
4946 - set *ID to the id we found. */
4947 +/* Find the variable info for tree T in VI_FOR_TREE. If T does not
4948 + exist in the map, return NULL, otherwise, return the varinfo we found. */
4951 -lookup_id_for_tree (tree t, unsigned int *id)
4953 +lookup_vi_for_tree (tree t)
4956 - struct tree_id finder;
4957 + void **slot = pointer_map_contains (vi_for_tree, t);
4962 - pair = htab_find (id_for_tree, &finder);
4967 + return (varinfo_t) *slot;
4970 /* Return a printable name for DECL */
4971 @@ -2210,7 +2188,7 @@
4973 if (TREE_CODE (decl) == SSA_NAME)
4975 - num_printed = asprintf (&temp, "%s_%u",
4976 + num_printed = asprintf (&temp, "%s_%u",
4977 alias_get_name (SSA_NAME_VAR (decl)),
4978 SSA_NAME_VERSION (decl));
4980 @@ -2226,21 +2204,17 @@
4984 -/* Find the variable id for tree T in the hashtable.
4985 - If T doesn't exist in the hash table, create an entry for it. */
4986 +/* Find the variable id for tree T in the map.
4987 + If T doesn't exist in the map, create an entry for it and return it. */
4989 -static unsigned int
4990 -get_id_for_tree (tree t)
4992 +get_vi_for_tree (tree t)
4995 - struct tree_id finder;
4996 + void **slot = pointer_map_contains (vi_for_tree, t);
4998 + return get_varinfo (create_variable_info_for (t, alias_get_name (t)));
5001 - pair = htab_find (id_for_tree, &finder);
5003 - return create_variable_info_for (t, alias_get_name (t));
5006 + return (varinfo_t) *slot;
5009 /* Get a constraint expression from an SSA_VAR_P node. */
5010 @@ -2254,14 +2228,14 @@
5012 /* For parameters, get at the points-to set for the actual parm
5014 - if (TREE_CODE (t) == SSA_NAME
5015 - && TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
5016 + if (TREE_CODE (t) == SSA_NAME
5017 + && TREE_CODE (SSA_NAME_VAR (t)) == PARM_DECL
5018 && default_def (SSA_NAME_VAR (t)) == t)
5019 return get_constraint_exp_from_ssa_var (SSA_NAME_VAR (t));
5021 cexpr.type = SCALAR;
5023 - cexpr.var = get_id_for_tree (t);
5025 + cexpr.var = get_vi_for_tree (t)->id;
5026 /* If we determine the result is "anything", and we know this is readonly,
5027 say it points to readonly memory instead. */
5028 if (cexpr.var == anything_id && TREE_READONLY (t))
5029 @@ -2269,7 +2243,7 @@
5030 cexpr.type = ADDRESSOF;
5031 cexpr.var = readonly_id;
5038 @@ -2290,7 +2264,13 @@
5039 get_varinfo (lhs.var)->directly_dereferenced = true;
5040 if (rhs.type == DEREF)
5041 get_varinfo (rhs.var)->directly_dereferenced = true;
5044 + if (!use_field_sensitive)
5046 + t->rhs.offset = 0;
5047 + t->lhs.offset = 0;
5050 /* ANYTHING == ANYTHING is pointless. */
5051 if (lhs.var == anything_id && rhs.var == anything_id)
5053 @@ -2302,7 +2282,7 @@
5056 process_constraint (t);
5059 /* This can happen in our IR with things like n->a = *p */
5060 else if (rhs.type == DEREF && lhs.type == DEREF && rhs.var != anything_id)
5062 @@ -2312,33 +2292,19 @@
5063 tree pointedtotype = TREE_TYPE (pointertype);
5064 tree tmpvar = create_tmp_var_raw (pointedtotype, "doubledereftmp");
5065 struct constraint_expr tmplhs = get_constraint_exp_from_ssa_var (tmpvar);
5068 /* If this is an aggregate of known size, we should have passed
5069 this off to do_structure_copy, and it should have broken it
5071 - gcc_assert (!AGGREGATE_TYPE_P (pointedtotype)
5072 + gcc_assert (!AGGREGATE_TYPE_P (pointedtotype)
5073 || get_varinfo (rhs.var)->is_unknown_size_var);
5076 process_constraint (new_constraint (tmplhs, rhs));
5077 process_constraint (new_constraint (lhs, tmplhs));
5079 - else if (rhs.type == ADDRESSOF)
5082 - gcc_assert (rhs.offset == 0);
5084 - /* No need to mark address taken simply because of escaped vars
5086 - if (lhs.var != escaped_vars_id)
5087 - for (vi = get_varinfo (rhs.var); vi != NULL; vi = vi->next)
5088 - vi->address_taken = true;
5090 - VEC_safe_push (constraint_t, heap, constraints, t);
5094 - if (lhs.type != DEREF && rhs.type == DEREF)
5095 - get_varinfo (lhs.var)->indirect_target = true;
5096 + gcc_assert (rhs.type != ADDRESSOF || rhs.offset == 0);
5097 VEC_safe_push (constraint_t, heap, constraints, t);
5100 @@ -2350,10 +2316,12 @@
5101 could_have_pointers (tree t)
5103 tree type = TREE_TYPE (t);
5105 - if (POINTER_TYPE_P (type) || AGGREGATE_TYPE_P (type)
5107 + if (POINTER_TYPE_P (type)
5108 + || AGGREGATE_TYPE_P (type)
5109 || TREE_CODE (type) == COMPLEX_TYPE)
5115 @@ -2367,9 +2335,9 @@
5116 if (TREE_CODE (DECL_FIELD_OFFSET (fdecl)) != INTEGER_CST
5117 || TREE_CODE (DECL_FIELD_BIT_OFFSET (fdecl)) != INTEGER_CST)
5120 - return (tree_low_cst (DECL_FIELD_OFFSET (fdecl), 1) * 8)
5121 - + tree_low_cst (DECL_FIELD_BIT_OFFSET (fdecl), 1);
5123 + return (tree_low_cst (DECL_FIELD_OFFSET (fdecl), 1) * 8)
5124 + + tree_low_cst (DECL_FIELD_BIT_OFFSET (fdecl), 1);
5128 @@ -2388,7 +2356,7 @@
5130 if (accesspos < fieldpos && (accesspos + accesssize > fieldpos))
5137 @@ -2411,20 +2379,20 @@
5138 while (!SSA_VAR_P (forzero) && !CONSTANT_CLASS_P (forzero))
5139 forzero = TREE_OPERAND (forzero, 0);
5141 - if (CONSTANT_CLASS_P (forzero) && integer_zerop (forzero))
5142 + if (CONSTANT_CLASS_P (forzero) && integer_zerop (forzero))
5144 struct constraint_expr temp;
5148 temp.var = integer_id;
5150 VEC_safe_push (ce_s, heap, *results, &temp);
5155 t = get_ref_base_and_extent (t, &bitpos, &bitsize, &bitmaxsize);
5157 - /* String constants's are readonly, so there is nothing to really do
5158 + /* String constants are readonly, so there is nothing to really do
5160 if (TREE_CODE (t) == STRING_CST)
5162 @@ -2438,21 +2406,21 @@
5163 /* This can also happen due to weird offsetof type macros. */
5164 if (TREE_CODE (t) != ADDR_EXPR && result->type == ADDRESSOF)
5165 result->type = SCALAR;
5168 if (result->type == SCALAR)
5170 /* In languages like C, you can access one past the end of an
5171 array. You aren't allowed to dereference it, so we can
5172 ignore this constraint. When we handle pointer subtraction,
5173 we may have to do something cute here. */
5176 if (result->offset < get_varinfo (result->var)->fullsize
5179 /* It's also not true that the constraint will actually start at the
5180 right offset, it may start in some padding. We only care about
5181 setting the constraint to the first actual field it touches, so
5182 - walk to find it. */
5183 + walk to find it. */
5185 for (curr = get_varinfo (result->var); curr; curr = curr->next)
5187 @@ -2495,6 +2463,7 @@
5189 struct constraint_expr *c;
5192 for (i = 0; VEC_iterate (ce_s, *constraints, i, c); i++)
5194 if (c->type == SCALAR)
5195 @@ -2576,6 +2545,7 @@
5196 tree pttype = TREE_TYPE (TREE_TYPE (t));
5198 get_constraint_for (exp, results);
5200 /* Make sure we capture constraints to all elements
5202 if ((handled_component_p (exp)
5203 @@ -2588,7 +2558,7 @@
5205 if (VEC_length (ce_s, *results) == 0)
5209 gcc_assert (VEC_length (ce_s, *results) == 1);
5210 origrhs = VEC_last (ce_s, *results);
5212 @@ -2619,12 +2589,12 @@
5213 VEC_safe_push (ce_s, heap, *results, &tmp);
5218 for (i = 0; VEC_iterate (ce_s, *results, i, c); i++)
5220 if (c->type == DEREF)
5224 c->type = ADDRESSOF;
5227 @@ -2638,9 +2608,9 @@
5230 tree heapvar = heapvar_lookup (t);
5233 if (heapvar == NULL)
5236 heapvar = create_tmp_var_raw (ptr_type_node, "HEAP");
5237 DECL_EXTERNAL (heapvar) = 1;
5238 if (referenced_vars)
5239 @@ -2650,7 +2620,7 @@
5241 temp.var = create_variable_info_for (heapvar,
5242 alias_get_name (heapvar));
5245 vi = get_varinfo (temp.var);
5246 vi->is_artificial_var = 1;
5247 vi->is_heap_var = 1;
5248 @@ -2712,7 +2682,7 @@
5249 case NON_LVALUE_EXPR:
5251 tree op = TREE_OPERAND (t, 0);
5254 /* Cast from non-pointer to pointers are bad news for us.
5255 Anything else, we see through */
5256 if (!(POINTER_TYPE_P (TREE_TYPE (t))
5257 @@ -2738,7 +2708,7 @@
5259 switch (TREE_CODE (t))
5264 get_constraint_for (PHI_RESULT (t), results);
5266 @@ -2782,8 +2752,8 @@
5269 /* Handle the structure copy case where we have a simple structure copy
5270 - between LHS and RHS that is of SIZE (in bits)
5272 + between LHS and RHS that is of SIZE (in bits)
5274 For each field of the lhs variable (lhsfield)
5275 For each field of the rhs variable at lhsfield.offset (rhsfield)
5276 add the constraint lhsfield = rhsfield
5277 @@ -2808,7 +2778,7 @@
5278 struct constraint_expr temprhs = rhs;
5279 unsigned HOST_WIDE_INT fieldoffset;
5281 - templhs.var = p->id;
5282 + templhs.var = p->id;
5283 q = get_varinfo (temprhs.var);
5284 fieldoffset = p->offset - pstart;
5285 q = first_vi_for_offset (q, q->offset + fieldoffset);
5286 @@ -2823,8 +2793,8 @@
5288 /* Handle the structure copy case where we have a structure copy between a
5289 aggregate on the LHS and a dereference of a pointer on the RHS
5290 - that is of SIZE (in bits)
5292 + that is of SIZE (in bits)
5294 For each field of the lhs variable (lhsfield)
5295 rhs.offset = lhsfield->offset
5296 add the constraint lhsfield = rhs
5297 @@ -2849,12 +2819,12 @@
5300 if (templhs.type == SCALAR)
5301 - templhs.var = p->id;
5302 + templhs.var = p->id;
5304 templhs.offset = p->offset;
5307 q = get_varinfo (temprhs.var);
5308 - fieldoffset = p->offset - pstart;
5309 + fieldoffset = p->offset - pstart;
5310 temprhs.offset += fieldoffset;
5311 process_constraint (new_constraint (templhs, temprhs));
5313 @@ -2862,7 +2832,7 @@
5315 /* Handle the structure copy case where we have a structure copy
5316 between a aggregate on the RHS and a dereference of a pointer on
5317 - the LHS that is of SIZE (in bits)
5318 + the LHS that is of SIZE (in bits)
5320 For each field of the rhs variable (rhsfield)
5321 lhs.offset = rhsfield->offset
5322 @@ -2888,12 +2858,12 @@
5325 if (temprhs.type == SCALAR)
5326 - temprhs.var = p->id;
5327 + temprhs.var = p->id;
5329 temprhs.offset = p->offset;
5332 q = get_varinfo (templhs.var);
5333 - fieldoffset = p->offset - pstart;
5334 + fieldoffset = p->offset - pstart;
5335 templhs.offset += fieldoffset;
5336 process_constraint (new_constraint (templhs, temprhs));
5338 @@ -2901,7 +2871,7 @@
5340 /* Sometimes, frontends like to give us bad type information. This
5341 function will collapse all the fields from VAR to the end of VAR,
5342 - into VAR, so that we treat those fields as a single variable.
5343 + into VAR, so that we treat those fields as a single variable.
5344 We return the variable they were collapsed into. */
5347 @@ -2913,16 +2883,16 @@
5348 for (field = currvar->next; field; field = field->next)
5351 - fprintf (dump_file, "Type safety: Collapsing var %s into %s\n",
5352 + fprintf (dump_file, "Type safety: Collapsing var %s into %s\n",
5353 field->name, currvar->name);
5356 gcc_assert (!field->collapsed_to);
5357 field->collapsed_to = currvar;
5360 currvar->next = NULL;
5361 currvar->size = currvar->fullsize - currvar->offset;
5367 @@ -2944,7 +2914,7 @@
5368 gcc_assert (VEC_length (ce_s, rhsc) == 1);
5369 lhs = *(VEC_last (ce_s, lhsc));
5370 rhs = *(VEC_last (ce_s, rhsc));
5373 VEC_free (ce_s, heap, lhsc);
5374 VEC_free (ce_s, heap, rhsc);
5376 @@ -2955,7 +2925,7 @@
5382 /* This is fairly conservative for the RHS == ADDRESSOF case, in that it's
5383 possible it's something we could handle. However, most cases falling
5384 into this are dealing with transparent unions, which are slightly
5385 @@ -3021,11 +2991,11 @@
5387 lhssize = TREE_INT_CST_LOW (lhstypesize);
5390 - if (rhs.type == SCALAR && lhs.type == SCALAR)
5392 + if (rhs.type == SCALAR && lhs.type == SCALAR)
5394 if (!do_simple_structure_copy (lhs, rhs, MIN (lhssize, rhssize)))
5397 lhs.var = collapse_rest_of_var (lhs.var);
5398 rhs.var = collapse_rest_of_var (rhs.var);
5400 @@ -3042,7 +3012,7 @@
5403 tree pointedtotype = lhstype;
5407 gcc_assert (rhs.type == DEREF && lhs.type == DEREF);
5408 tmpvar = create_tmp_var_raw (pointedtotype, "structcopydereftmp");
5409 @@ -3052,6 +3022,7 @@
5414 /* Update related alias information kept in AI. This is used when
5415 building name tags, alias sets and deciding grouping heuristics.
5416 STMT is the statement to process. This function also updates
5417 @@ -3261,7 +3232,6 @@
5422 /* Handle pointer arithmetic EXPR when creating aliasing constraints.
5423 Expressions of the type PTR + CST can be handled in two ways:
5425 @@ -3307,6 +3277,7 @@
5430 for (i = 0; VEC_iterate (ce_s, lhsc, i, c); i++)
5431 for (j = 0; VEC_iterate (ce_s, temp, j, c2); j++)
5433 @@ -3360,12 +3331,12 @@
5439 /* For a phi node, assign all the arguments to
5441 get_constraint_for (PHI_RESULT (t), &lhsc);
5442 for (i = 0; i < PHI_NUM_ARGS (t); i++)
5446 tree strippedrhs = PHI_ARG_DEF (t, i);
5448 @@ -3401,7 +3372,6 @@
5452 - unsigned int varid;
5456 @@ -3423,17 +3393,16 @@
5457 we should still be able to handle. */
5460 - varid = get_id_for_tree (decl);
5461 + fi = get_vi_for_tree (decl);
5465 decl = TREE_OPERAND (rhsop, 0);
5466 - varid = get_id_for_tree (decl);
5467 + fi = get_vi_for_tree (decl);
5470 /* Assign all the passed arguments to the appropriate incoming
5471 parameters of the function. */
5472 - fi = get_varinfo (varid);
5473 arglist = TREE_OPERAND (rhsop, 1);
5475 for (;arglist; arglist = TREE_CHAIN (arglist))
5476 @@ -3463,13 +3432,14 @@
5481 /* If we are returning a value, assign it to the result. */
5484 struct constraint_expr rhs;
5485 struct constraint_expr *lhsp;
5489 get_constraint_for (lhsop, &lhsc);
5490 if (TREE_CODE (decl) != FUNCTION_DECL)
5492 @@ -3485,7 +3455,7 @@
5494 for (j = 0; VEC_iterate (ce_s, lhsc, j, lhsp); j++)
5495 process_constraint (new_constraint (*lhsp, rhs));
5499 /* Otherwise, just a regular assignment statement. */
5500 else if (TREE_CODE (t) == MODIFY_EXPR)
5501 @@ -3494,7 +3464,7 @@
5502 tree rhsop = TREE_OPERAND (t, 1);
5505 - if ((AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
5506 + if ((AGGREGATE_TYPE_P (TREE_TYPE (lhsop))
5507 || TREE_CODE (TREE_TYPE (lhsop)) == COMPLEX_TYPE)
5508 && (AGGREGATE_TYPE_P (TREE_TYPE (rhsop))
5509 || TREE_CODE (TREE_TYPE (lhsop)) == COMPLEX_TYPE))
5510 @@ -3513,7 +3483,7 @@
5512 /* RHS that consist of unary operations,
5513 exceptional types, or bare decls/constants, get
5514 - handled directly by get_constraint_for. */
5515 + handled directly by get_constraint_for. */
5517 case tcc_declaration:
5519 @@ -3528,7 +3498,7 @@
5521 struct constraint_expr *c2;
5525 for (k = 0; VEC_iterate (ce_s, rhsc, k, c2); k++)
5526 process_constraint (new_constraint (*c, *c2));
5528 @@ -3570,7 +3540,7 @@
5537 @@ -3578,7 +3548,7 @@
5538 /* After promoting variables and computing aliasing we will
5539 need to re-scan most statements. FIXME: Try to minimize the
5540 number of statements re-scanned. It's not really necessary to
5541 - re-scan *all* statements. */
5542 + re-scan *all* statements. */
5543 mark_stmt_modified (origt);
5544 VEC_free (ce_s, heap, rhsc);
5545 VEC_free (ce_s, heap, lhsc);
5546 @@ -3591,7 +3561,7 @@
5547 first field that overlaps with OFFSET.
5548 Return NULL if we can't find one. */
5552 first_vi_for_offset (varinfo_t start, unsigned HOST_WIDE_INT offset)
5554 varinfo_t curr = start;
5555 @@ -3617,7 +3587,7 @@
5557 varinfo_t prev = base;
5558 varinfo_t curr = base->next;
5564 @@ -3630,7 +3600,7 @@
5566 varinfo_t prev = base;
5567 varinfo_t curr = base->next;
5573 @@ -3652,13 +3622,13 @@
5575 /* qsort comparison function for two fieldoff's PA and PB */
5579 fieldoff_compare (const void *pa, const void *pb)
5581 const fieldoff_s *foa = (const fieldoff_s *)pa;
5582 const fieldoff_s *fob = (const fieldoff_s *)pb;
5583 HOST_WIDE_INT foasize, fobsize;
5586 if (foa->offset != fob->offset)
5587 return foa->offset - fob->offset;
5589 @@ -3671,8 +3641,8 @@
5591 sort_fieldstack (VEC(fieldoff_s,heap) *fieldstack)
5593 - qsort (VEC_address (fieldoff_s, fieldstack),
5594 - VEC_length (fieldoff_s, fieldstack),
5595 + qsort (VEC_address (fieldoff_s, fieldstack),
5596 + VEC_length (fieldoff_s, fieldstack),
5597 sizeof (fieldoff_s),
5600 @@ -3686,12 +3656,12 @@
5604 -push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
5605 +push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
5606 HOST_WIDE_INT offset, bool *has_union)
5612 if (TREE_CODE (type) == COMPLEX_TYPE)
5614 fieldoff_s *real_part, *img_part;
5615 @@ -3700,13 +3670,13 @@
5616 real_part->size = TYPE_SIZE (TREE_TYPE (type));
5617 real_part->offset = offset;
5618 real_part->decl = NULL_TREE;
5621 img_part = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
5622 img_part->type = TREE_TYPE (type);
5623 img_part->size = TYPE_SIZE (TREE_TYPE (type));
5624 img_part->offset = offset + TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (type)));
5625 img_part->decl = NULL_TREE;
5631 @@ -3733,12 +3703,12 @@
5639 && (TREE_CODE (TREE_TYPE (type)) == QUAL_UNION_TYPE
5640 || TREE_CODE (TREE_TYPE (type)) == UNION_TYPE))
5644 if (!AGGREGATE_TYPE_P (TREE_TYPE (type))) /* var_can_have_subvars */
5646 else if (!(pushed = push_fields_onto_fieldstack
5647 @@ -3772,12 +3742,12 @@
5655 && (TREE_CODE (TREE_TYPE (field)) == QUAL_UNION_TYPE
5656 || TREE_CODE (TREE_TYPE (field)) == UNION_TYPE))
5660 if (!var_can_have_subvars (field))
5662 else if (!(pushed = push_fields_onto_fieldstack
5663 @@ -3789,7 +3759,7 @@
5664 see if we didn't push any subfields and the size is
5665 nonzero, push the field onto the stack */
5672 @@ -3848,15 +3818,15 @@
5676 - for (t = TYPE_ARG_TYPES (TREE_TYPE (decl));
5677 + for (t = TYPE_ARG_TYPES (TREE_TYPE (decl));
5682 if (TREE_VALUE (t) == void_type_node)
5691 @@ -3870,19 +3840,19 @@
5693 unsigned int index = VEC_length (varinfo_t, varmap);
5698 bool is_varargs = false;
5700 /* Create the variable info. */
5702 - vi = new_var_info (decl, index, name, index);
5703 + vi = new_var_info (decl, index, name);
5708 vi->fullsize = count_num_arguments (decl, &is_varargs) + 1;
5709 - insert_id_for_tree (vi->decl, index);
5710 + insert_vi_for_tree (vi->decl, vi);
5711 VEC_safe_push (varinfo_t, heap, varmap, vi);
5714 @@ -3898,12 +3868,12 @@
5720 arg = DECL_ARGUMENTS (decl);
5722 /* Set up variables for each argument. */
5723 for (i = 1; i < vi->fullsize; i++)
5727 const char *newname;
5729 @@ -3912,13 +3882,13 @@
5735 newindex = VEC_length (varinfo_t, varmap);
5736 asprintf (&tempname, "%s.arg%d", name, i-1);
5737 newname = ggc_strdup (tempname);
5740 - argvi = new_var_info (argdecl, newindex,newname, newindex);
5741 + argvi = new_var_info (argdecl, newindex, newname);
5742 argvi->decl = argdecl;
5743 VEC_safe_push (varinfo_t, heap, varmap, argvi);
5745 @@ -3929,7 +3899,7 @@
5746 stats.total_vars ++;
5749 - insert_id_for_tree (arg, newindex);
5750 + insert_vi_for_tree (arg, argvi);
5751 arg = TREE_CHAIN (arg);
5754 @@ -3948,13 +3918,13 @@
5756 if (DECL_RESULT (decl))
5757 resultdecl = DECL_RESULT (decl);
5760 newindex = VEC_length (varinfo_t, varmap);
5761 asprintf (&tempname, "%s.result", name);
5762 newname = ggc_strdup (tempname);
5765 - resultvi = new_var_info (resultdecl, newindex, newname, newindex);
5766 + resultvi = new_var_info (resultdecl, newindex, newname);
5767 resultvi->decl = resultdecl;
5768 VEC_safe_push (varinfo_t, heap, varmap, resultvi);
5769 resultvi->offset = i;
5770 @@ -3964,13 +3934,13 @@
5771 insert_into_field_list_sorted (vi, resultvi);
5772 stats.total_vars ++;
5773 if (DECL_RESULT (decl))
5774 - insert_id_for_tree (DECL_RESULT (decl), newindex);
5775 + insert_vi_for_tree (DECL_RESULT (decl), resultvi);
5782 -/* Return true if FIELDSTACK contains fields that overlap.
5783 +/* Return true if FIELDSTACK contains fields that overlap.
5784 FIELDSTACK is assumed to be sorted by offset. */
5787 @@ -4057,12 +4027,12 @@
5789 bool is_global = DECL_P (decl) ? is_global_var (decl) : false;
5790 VEC (fieldoff_s,heap) *fieldstack = NULL;
5793 if (TREE_CODE (decl) == FUNCTION_DECL && in_ipa_mode)
5794 return create_function_info_for (decl, name);
5796 hasunion = TREE_CODE (decltype) == UNION_TYPE
5797 - || TREE_CODE (decltype) == QUAL_UNION_TYPE;
5798 + || TREE_CODE (decltype) == QUAL_UNION_TYPE;
5799 if (var_can_have_subvars (decl) && use_field_sensitive && !hasunion)
5801 push_fields_onto_fieldstack (decltype, &fieldstack, 0, &hasunion);
5802 @@ -4072,12 +4042,12 @@
5809 /* If the variable doesn't have subvars, we may end up needing to
5810 sort the field list and create fake variables for all the
5812 - vi = new_var_info (decl, index, name, index);
5813 + vi = new_var_info (decl, index, name);
5816 vi->has_union = hasunion;
5817 @@ -4095,8 +4065,8 @@
5818 vi->fullsize = TREE_INT_CST_LOW (declsize);
5819 vi->size = vi->fullsize;
5822 - insert_id_for_tree (vi->decl, index);
5824 + insert_vi_for_tree (vi->decl, vi);
5825 VEC_safe_push (varinfo_t, heap, varmap, vi);
5826 if (is_global && (!flag_whole_program || !in_ipa_mode))
5828 @@ -4122,9 +4092,9 @@
5832 - if (use_field_sensitive
5834 - && !vi->is_unknown_size_var
5835 + if (use_field_sensitive
5837 + && !vi->is_unknown_size_var
5838 && var_can_have_subvars (decl)
5839 && VEC_length (fieldoff_s, fieldstack) <= MAX_FIELDS_FOR_FIELD_SENSITIVE)
5841 @@ -4148,7 +4118,7 @@
5842 without creating varinfos for the fields anyway, so sorting them is a
5847 sort_fieldstack (fieldstack);
5848 /* Due to some C++ FE issues, like PR 22488, we might end up
5849 what appear to be overlapping fields even though they,
5850 @@ -4156,8 +4126,8 @@
5851 we will simply disable field-sensitivity for these cases. */
5852 notokay = check_for_overlaps (fieldstack);
5858 if (VEC_length (fieldoff_s, fieldstack) != 0)
5859 fo = VEC_index (fieldoff_s, fieldstack, 0);
5861 @@ -4169,11 +4139,11 @@
5862 VEC_free (fieldoff_s, heap, fieldstack);
5867 vi->size = TREE_INT_CST_LOW (fo->size);
5868 vi->offset = fo->offset;
5869 - for (i = VEC_length (fieldoff_s, fieldstack) - 1;
5870 - i >= 1 && VEC_iterate (fieldoff_s, fieldstack, i, fo);
5871 + for (i = VEC_length (fieldoff_s, fieldstack) - 1;
5872 + i >= 1 && VEC_iterate (fieldoff_s, fieldstack, i, fo);
5876 @@ -4184,15 +4154,15 @@
5880 - asprintf (&tempname, "%s.%s",
5881 + asprintf (&tempname, "%s.%s",
5882 vi->name, alias_get_name (fo->decl));
5884 - asprintf (&tempname, "%s." HOST_WIDE_INT_PRINT_DEC,
5885 + asprintf (&tempname, "%s." HOST_WIDE_INT_PRINT_DEC,
5886 vi->name, fo->offset);
5887 newname = ggc_strdup (tempname);
5890 - newvi = new_var_info (decl, newindex, newname, newindex);
5891 + newvi = new_var_info (decl, newindex, newname);
5892 newvi->offset = fo->offset;
5893 newvi->size = TREE_INT_CST_LOW (fo->size);
5894 newvi->fullsize = vi->fullsize;
5895 @@ -4228,14 +4198,22 @@
5897 varinfo_t vi = get_varinfo (var);
5899 - bitmap_iterator bi;
5901 - fprintf (file, "%s = { ", vi->name);
5902 - EXECUTE_IF_SET_IN_BITMAP (get_varinfo (vi->node)->solution, 0, i, bi)
5903 + bitmap_iterator bi;
5905 + if (find (var) != var)
5907 - fprintf (file, "%s ", get_varinfo (i)->name);
5908 + varinfo_t vipt = get_varinfo (find (var));
5909 + fprintf (file, "%s = same as %s\n", vi->name, vipt->name);
5911 - fprintf (file, "}\n");
5914 + fprintf (file, "%s = { ", vi->name);
5915 + EXECUTE_IF_SET_IN_BITMAP (vi->solution, 0, i, bi)
5917 + fprintf (file, "%s ", get_varinfo (i)->name);
5919 + fprintf (file, "}\n");
5923 /* Print the points-to solution for VAR to stdout. */
5924 @@ -4266,7 +4244,7 @@
5925 if (!could_have_pointers (t))
5928 - arg_id = get_id_for_tree (t);
5929 + arg_id = get_vi_for_tree (t)->id;
5931 /* With flag_argument_noalias greater than two means that the incoming
5932 argument cannot alias anything except for itself so create a HEAP
5933 @@ -4276,11 +4254,10 @@
5936 tree heapvar = heapvar_lookup (t);
5941 - lhs.var = get_id_for_tree (t);
5942 + lhs.var = get_vi_for_tree (t)->id;
5944 if (heapvar == NULL_TREE)
5946 @@ -4291,11 +4268,11 @@
5947 add_referenced_var (heapvar);
5948 heapvar_insert (t, heapvar);
5950 - id = get_id_for_tree (heapvar);
5951 - vi = get_varinfo (id);
5953 + vi = get_vi_for_tree (heapvar);
5954 vi->is_artificial_var = 1;
5955 vi->is_heap_var = 1;
5958 rhs.type = ADDRESSOF;
5960 for (p = get_varinfo (lhs.var); p; p = p->next)
5961 @@ -4409,8 +4386,8 @@
5963 find_what_p_points_to (tree p)
5965 - unsigned int id = 0;
5969 if (!have_alias_info)
5971 @@ -4422,10 +4399,10 @@
5972 && default_def (SSA_NAME_VAR (p)) == p)
5973 lookup_p = SSA_NAME_VAR (p);
5975 - if (lookup_id_for_tree (lookup_p, &id))
5976 + vi = lookup_vi_for_tree (lookup_p);
5979 - varinfo_t vi = get_varinfo (id);
5982 if (vi->is_artificial_var)
5985 @@ -4447,7 +4424,7 @@
5987 /* This variable may have been collapsed, let's get the real
5989 - vi = get_varinfo (vi->node);
5990 + vi = get_varinfo (find (vi->id));
5992 /* Translate artificial variables into SSA_NAME_PTR_INFO
5994 @@ -4506,13 +4483,16 @@
5996 fprintf (outfile, "Stats:\n");
5997 fprintf (outfile, "Total vars: %d\n", stats.total_vars);
5998 + fprintf (outfile, "Non-pointer vars: %d\n",
5999 + stats.nonpointer_vars);
6000 fprintf (outfile, "Statically unified vars: %d\n",
6001 stats.unified_vars_static);
6002 - fprintf (outfile, "Collapsed vars: %d\n", stats.collapsed_vars);
6003 fprintf (outfile, "Dynamically unified vars: %d\n",
6004 stats.unified_vars_dynamic);
6005 fprintf (outfile, "Iterations: %d\n", stats.iterations);
6006 fprintf (outfile, "Number of edges: %d\n", stats.num_edges);
6007 + fprintf (outfile, "Number of implicit edges: %d\n",
6008 + stats.num_implicit_edges);
6011 for (i = 0; i < VEC_length (varinfo_t, varmap); i++)
6012 @@ -4540,8 +4520,8 @@
6013 /* Create the NULL variable, used to represent that a variable points
6015 nothing_tree = create_tmp_var_raw (void_type_node, "NULL");
6016 - var_nothing = new_var_info (nothing_tree, 0, "NULL", 0);
6017 - insert_id_for_tree (nothing_tree, 0);
6018 + var_nothing = new_var_info (nothing_tree, 0, "NULL");
6019 + insert_vi_for_tree (nothing_tree, var_nothing);
6020 var_nothing->is_artificial_var = 1;
6021 var_nothing->offset = 0;
6022 var_nothing->size = ~0;
6023 @@ -4553,8 +4533,8 @@
6024 /* Create the ANYTHING variable, used to represent that a variable
6025 points to some unknown piece of memory. */
6026 anything_tree = create_tmp_var_raw (void_type_node, "ANYTHING");
6027 - var_anything = new_var_info (anything_tree, 1, "ANYTHING", 1);
6028 - insert_id_for_tree (anything_tree, 1);
6029 + var_anything = new_var_info (anything_tree, 1, "ANYTHING");
6030 + insert_vi_for_tree (anything_tree, var_anything);
6031 var_anything->is_artificial_var = 1;
6032 var_anything->size = ~0;
6033 var_anything->offset = 0;
6034 @@ -4573,7 +4553,6 @@
6035 rhs.type = ADDRESSOF;
6036 rhs.var = anything_id;
6038 - var_anything->address_taken = true;
6040 /* This specifically does not use process_constraint because
6041 process_constraint ignores all anything = anything constraints, since all
6042 @@ -4583,14 +4562,14 @@
6043 /* Create the READONLY variable, used to represent that a variable
6044 points to readonly memory. */
6045 readonly_tree = create_tmp_var_raw (void_type_node, "READONLY");
6046 - var_readonly = new_var_info (readonly_tree, 2, "READONLY", 2);
6047 + var_readonly = new_var_info (readonly_tree, 2, "READONLY");
6048 var_readonly->is_artificial_var = 1;
6049 var_readonly->offset = 0;
6050 var_readonly->size = ~0;
6051 var_readonly->fullsize = ~0;
6052 var_readonly->next = NULL;
6053 var_readonly->is_special_var = 1;
6054 - insert_id_for_tree (readonly_tree, 2);
6055 + insert_vi_for_tree (readonly_tree, var_readonly);
6057 VEC_safe_push (varinfo_t, heap, varmap, var_readonly);
6059 @@ -4610,8 +4589,8 @@
6060 /* Create the INTEGER variable, used to represent that a variable points
6062 integer_tree = create_tmp_var_raw (void_type_node, "INTEGER");
6063 - var_integer = new_var_info (integer_tree, 3, "INTEGER", 3);
6064 - insert_id_for_tree (integer_tree, 3);
6065 + var_integer = new_var_info (integer_tree, 3, "INTEGER");
6066 + insert_vi_for_tree (integer_tree, var_integer);
6067 var_integer->is_artificial_var = 1;
6068 var_integer->size = ~0;
6069 var_integer->fullsize = ~0;
6070 @@ -4634,8 +4613,8 @@
6071 /* Create the ESCAPED_VARS variable used to represent variables that
6072 escape this function. */
6073 escaped_vars_tree = create_tmp_var_raw (void_type_node, "ESCAPED_VARS");
6074 - var_escaped_vars = new_var_info (escaped_vars_tree, 4, "ESCAPED_VARS", 4);
6075 - insert_id_for_tree (escaped_vars_tree, 4);
6076 + var_escaped_vars = new_var_info (escaped_vars_tree, 4, "ESCAPED_VARS");
6077 + insert_vi_for_tree (escaped_vars_tree, var_escaped_vars);
6078 var_escaped_vars->is_artificial_var = 1;
6079 var_escaped_vars->size = ~0;
6080 var_escaped_vars->fullsize = ~0;
6081 @@ -4660,21 +4639,19 @@
6083 init_alias_vars (void)
6085 - bitmap_obstack_initialize (&ptabitmap_obstack);
6086 + bitmap_obstack_initialize (&pta_obstack);
6087 + bitmap_obstack_initialize (&oldpta_obstack);
6088 bitmap_obstack_initialize (&predbitmap_obstack);
6090 - constraint_pool = create_alloc_pool ("Constraint pool",
6091 + constraint_pool = create_alloc_pool ("Constraint pool",
6092 sizeof (struct constraint), 30);
6093 variable_info_pool = create_alloc_pool ("Variable info pool",
6094 sizeof (struct variable_info), 30);
6095 - constraint_edge_pool = create_alloc_pool ("Constraint edges",
6096 - sizeof (struct constraint_edge), 30);
6098 constraints = VEC_alloc (constraint_t, heap, 8);
6099 varmap = VEC_alloc (varinfo_t, heap, 8);
6100 - id_for_tree = htab_create (10, tree_id_hash, tree_id_eq, free);
6101 + vi_for_tree = pointer_map_create ();
6103 memset (&stats, 0, sizeof (stats));
6108 @@ -4777,6 +4754,43 @@
6109 VEC_free (ce_s, heap, rhsc);
6113 +/* Remove the REF and ADDRESS edges from GRAPH, as well as all the
6114 + predecessor edges. */
6117 +remove_preds_and_fake_succs (constraint_graph_t graph)
6121 + /* Clear the implicit ref and address nodes from the successor
6123 + for (i = 0; i < FIRST_REF_NODE; i++)
6125 + if (graph->succs[i])
6126 + bitmap_clear_range (graph->succs[i], FIRST_REF_NODE,
6127 + FIRST_REF_NODE * 2);
6130 + /* Free the successor list for the non-ref nodes. */
6131 + for (i = FIRST_REF_NODE; i < graph->size; i++)
6133 + if (graph->succs[i])
6134 + BITMAP_FREE (graph->succs[i]);
6137 + /* Now reallocate the size of the successor list as, and blow away
6138 + the predecessor bitmaps. */
6139 + graph->size = VEC_length (varinfo_t, varmap);
6140 + graph->succs = xrealloc (graph->succs, graph->size * sizeof (bitmap));
6142 + free (graph->implicit_preds);
6143 + graph->implicit_preds = NULL;
6144 + free (graph->preds);
6145 + graph->preds = NULL;
6146 + bitmap_obstack_release (&predbitmap_obstack);
6149 /* Create points-to sets for the current function. See the comments
6150 at the start of the file for an algorithmic overview. */
6152 @@ -4784,11 +4798,13 @@
6153 compute_points_to_sets (struct alias_info *ai)
6156 + struct scc_info *si;
6158 timevar_push (TV_TREE_PTA);
6162 + init_alias_heapvars ();
6164 intra_create_variable_infos ();
6166 /* Now walk all statements and derive aliases. */
6167 @@ -4824,36 +4840,42 @@
6171 - build_constraint_graph ();
6175 fprintf (dump_file, "Points-to analysis\n\nConstraints:\n\n");
6176 dump_constraints (dump_file);
6182 "\nCollapsing static cycles and doing variable "
6185 - find_and_collapse_graph_cycles (graph, false);
6186 - perform_var_substitution (graph);
6189 + build_pred_graph ();
6190 + si = perform_var_substitution (graph);
6191 + move_complex_constraints (graph, si);
6192 + free_var_substitution_info (si);
6194 + build_succ_graph ();
6195 + find_indirect_cycles (graph);
6197 + /* Implicit nodes and predecessors are no longer necessary at this
6199 + remove_preds_and_fake_succs (graph);
6202 fprintf (dump_file, "\nSolving graph:\n");
6205 solve_graph (graph);
6209 dump_sa_points_to_info (dump_file);
6211 have_alias_info = true;
6213 timevar_pop (TV_TREE_PTA);
6217 /* Delete created points-to sets. */
6220 @@ -4861,33 +4883,27 @@
6225 - htab_delete (id_for_tree);
6226 - bitmap_obstack_release (&ptabitmap_obstack);
6227 - bitmap_obstack_release (&predbitmap_obstack);
6229 + if (dump_file && (dump_flags & TDF_STATS))
6230 + fprintf (dump_file, "Points to sets created:%d\n",
6231 + stats.points_to_sets_created);
6233 + pointer_map_destroy (vi_for_tree);
6234 + bitmap_obstack_release (&pta_obstack);
6235 VEC_free (constraint_t, heap, constraints);
6238 for (i = 0; VEC_iterate (varinfo_t, varmap, i, v); i++)
6240 - /* Nonlocal vars may add more varinfos. */
6241 - if (i >= graph_size)
6243 + VEC_free (constraint_t, heap, graph->complex[i]);
6244 + free (graph->complex);
6246 - VEC_free (constraint_edge_t, heap, graph->succs[i]);
6247 - VEC_free (constraint_edge_t, heap, graph->preds[i]);
6248 - VEC_free (constraint_t, heap, v->complex);
6250 - free (graph->zero_weight_preds);
6251 - free (graph->zero_weight_succs);
6252 + free (graph->rep);
6253 free (graph->succs);
6254 - free (graph->preds);
6255 + free (graph->indirect_cycles);
6258 VEC_free (varinfo_t, heap, varmap);
6259 free_alloc_pool (variable_info_pool);
6260 - free_alloc_pool (constraint_pool);
6261 - free_alloc_pool (constraint_edge_pool);
6263 + free_alloc_pool (constraint_pool);
6264 have_alias_info = false;
6267 @@ -4905,6 +4921,7 @@
6269 ipa_pta_execute (void)
6272 struct cgraph_node *node;
6274 init_alias_heapvars ();
6275 @@ -4994,6 +5011,7 @@
6277 delete_alias_heapvars ();
6278 delete_points_to_sets ();
6283 @@ -5018,8 +5036,9 @@
6285 init_alias_heapvars (void)
6287 - heapvar_for_stmt = htab_create_ggc (11, tree_map_hash, tree_map_eq,
6289 + if (!heapvar_for_stmt)
6290 + heapvar_for_stmt = htab_create_ggc (11, tree_map_hash, tree_map_eq,
6292 nonlocal_all = NULL_TREE;
6295 @@ -5028,7 +5047,7 @@
6297 nonlocal_all = NULL_TREE;
6298 htab_delete (heapvar_for_stmt);
6299 + heapvar_for_stmt = NULL;
6303 #include "gt-tree-ssa-structalias.h"
6304 Index: gcc/config/i386/i386.md
6305 ===================================================================
6306 --- gcc/config/i386/i386.md (.../tags/gcc_4_2_0_release) (wersja 125589)
6307 +++ gcc/config/i386/i386.md (.../branches/gcc-4_2-branch) (wersja 125589)
6308 @@ -4749,7 +4749,7 @@
6309 (define_insn "*addti3_1"
6310 [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
6311 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0,0")
6312 - (match_operand:TI 2 "general_operand" "roiF,riF")))
6313 + (match_operand:TI 2 "x86_64_general_operand" "roe,re")))
6314 (clobber (reg:CC FLAGS_REG))]
6315 "TARGET_64BIT && ix86_binary_operator_ok (PLUS, TImode, operands)"
6317 @@ -4757,7 +4757,7 @@
6319 [(set (match_operand:TI 0 "nonimmediate_operand" "")
6320 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "")
6321 - (match_operand:TI 2 "general_operand" "")))
6322 + (match_operand:TI 2 "x86_64_general_operand" "")))
6323 (clobber (reg:CC FLAGS_REG))]
6324 "TARGET_64BIT && reload_completed"
6325 [(parallel [(set (reg:CC FLAGS_REG) (unspec:CC [(match_dup 1) (match_dup 2)]
6326 @@ -6483,7 +6483,7 @@
6327 (define_insn "*subti3_1"
6328 [(set (match_operand:TI 0 "nonimmediate_operand" "=r,o")
6329 (minus:TI (match_operand:TI 1 "nonimmediate_operand" "0,0")
6330 - (match_operand:TI 2 "general_operand" "roiF,riF")))
6331 + (match_operand:TI 2 "x86_64_general_operand" "roe,re")))
6332 (clobber (reg:CC FLAGS_REG))]
6333 "TARGET_64BIT && ix86_binary_operator_ok (MINUS, TImode, operands)"
6335 @@ -6491,7 +6491,7 @@
6337 [(set (match_operand:TI 0 "nonimmediate_operand" "")
6338 (minus:TI (match_operand:TI 1 "nonimmediate_operand" "")
6339 - (match_operand:TI 2 "general_operand" "")))
6340 + (match_operand:TI 2 "x86_64_general_operand" "")))
6341 (clobber (reg:CC FLAGS_REG))]
6342 "TARGET_64BIT && reload_completed"
6343 [(parallel [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2)))
6344 @@ -9326,7 +9326,7 @@
6346 (define_insn "*negti2_1"
6347 [(set (match_operand:TI 0 "nonimmediate_operand" "=ro")
6348 - (neg:TI (match_operand:TI 1 "general_operand" "0")))
6349 + (neg:TI (match_operand:TI 1 "nonimmediate_operand" "0")))
6350 (clobber (reg:CC FLAGS_REG))]
6352 && ix86_unary_operator_ok (NEG, TImode, operands)"
6353 @@ -9334,7 +9334,7 @@
6356 [(set (match_operand:TI 0 "nonimmediate_operand" "")
6357 - (neg:TI (match_operand:TI 1 "general_operand" "")))
6358 + (neg:TI (match_operand:TI 1 "nonimmediate_operand" "")))
6359 (clobber (reg:CC FLAGS_REG))]
6360 "TARGET_64BIT && reload_completed"
6362 Index: gcc/config/i386/sse.md
6363 ===================================================================
6364 --- gcc/config/i386/sse.md (.../tags/gcc_4_2_0_release) (wersja 125589)
6365 +++ gcc/config/i386/sse.md (.../branches/gcc-4_2-branch) (wersja 125589)
6366 @@ -2055,11 +2055,11 @@
6368 (parallel [(const_int 0)
6370 - "TARGET_SSE3 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
6371 + "TARGET_SSE3 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
6373 movddup\t{%1, %0|%0, %1}
6375 - [(set_attr "type" "sselog,ssemov")
6376 + [(set_attr "type" "sselog1,ssemov")
6377 (set_attr "mode" "V2DF")])
6380 @@ -3494,9 +3494,10 @@
6381 "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
6383 movhps\t{%1, %0|%0, %1}
6384 - psrldq\t{$4, %0|%0, 4}
6385 + psrldq\t{$8, %0|%0, 8}
6386 movq\t{%H1, %0|%0, %H1}"
6387 [(set_attr "type" "ssemov,sseishft,ssemov")
6388 + (set_attr "memory" "*,none,*")
6389 (set_attr "mode" "V2SF,TI,TI")])
6391 ;; Not sure this is ever used, but it doesn't hurt to have it. -aoliva
6392 Index: gcc/config/i386/i386.c
6393 ===================================================================
6394 --- gcc/config/i386/i386.c (.../tags/gcc_4_2_0_release) (wersja 125589)
6395 +++ gcc/config/i386/i386.c (.../branches/gcc-4_2-branch) (wersja 125589)
6396 @@ -15539,13 +15539,13 @@
6397 /* Access to the vec_extract patterns. */
6398 ftype = build_function_type_list (double_type_node, V2DF_type_node,
6399 integer_type_node, NULL_TREE);
6400 - def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v2df",
6401 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v2df",
6402 ftype, IX86_BUILTIN_VEC_EXT_V2DF);
6404 ftype = build_function_type_list (long_long_integer_type_node,
6405 V2DI_type_node, integer_type_node,
6407 - def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v2di",
6408 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v2di",
6409 ftype, IX86_BUILTIN_VEC_EXT_V2DI);
6411 ftype = build_function_type_list (float_type_node, V4SF_type_node,
6412 @@ -15555,12 +15555,12 @@
6414 ftype = build_function_type_list (intSI_type_node, V4SI_type_node,
6415 integer_type_node, NULL_TREE);
6416 - def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v4si",
6417 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v4si",
6418 ftype, IX86_BUILTIN_VEC_EXT_V4SI);
6420 ftype = build_function_type_list (intHI_type_node, V8HI_type_node,
6421 integer_type_node, NULL_TREE);
6422 - def_builtin (MASK_SSE, "__builtin_ia32_vec_ext_v8hi",
6423 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_ext_v8hi",
6424 ftype, IX86_BUILTIN_VEC_EXT_V8HI);
6426 ftype = build_function_type_list (intHI_type_node, V4HI_type_node,
6427 @@ -15577,7 +15577,7 @@
6428 ftype = build_function_type_list (V8HI_type_node, V8HI_type_node,
6430 integer_type_node, NULL_TREE);
6431 - def_builtin (MASK_SSE, "__builtin_ia32_vec_set_v8hi",
6432 + def_builtin (MASK_SSE2, "__builtin_ia32_vec_set_v8hi",
6433 ftype, IX86_BUILTIN_VEC_SET_V8HI);
6435 ftype = build_function_type_list (V4HI_type_node, V4HI_type_node,
6436 Index: gcc/config/sh/sh.c
6437 ===================================================================
6438 --- gcc/config/sh/sh.c (.../tags/gcc_4_2_0_release) (wersja 125589)
6439 +++ gcc/config/sh/sh.c (.../branches/gcc-4_2-branch) (wersja 125589)
6440 @@ -5295,7 +5295,13 @@
6441 temp = scavenge_reg (&temps);
6443 if (temp < 0 && live_regs_mask)
6444 - temp = scavenge_reg (live_regs_mask);
6446 + HARD_REG_SET temps;
6448 + COPY_HARD_REG_SET (temps, *live_regs_mask);
6449 + CLEAR_HARD_REG_BIT (temps, REGNO (reg));
6450 + temp = scavenge_reg (&temps);
6454 rtx adj_reg, tmp_reg, mem;
6455 @@ -5344,6 +5350,9 @@
6456 emit_move_insn (adj_reg, mem);
6457 mem = gen_tmp_stack_mem (Pmode, gen_rtx_POST_INC (Pmode, reg));
6458 emit_move_insn (tmp_reg, mem);
6459 + /* Tell flow the insns that pop r4/r5 aren't dead. */
6460 + emit_insn (gen_rtx_USE (VOIDmode, tmp_reg));
6461 + emit_insn (gen_rtx_USE (VOIDmode, adj_reg));
6464 const_reg = gen_rtx_REG (GET_MODE (reg), temp);
6465 @@ -8618,7 +8627,7 @@
6467 && get_attr_type (insn) == TYPE_DYN_SHIFT
6468 && get_attr_any_int_load (dep_insn) == ANY_INT_LOAD_YES
6469 - && reg_overlap_mentioned_p (SET_DEST (PATTERN (dep_insn)),
6470 + && reg_overlap_mentioned_p (SET_DEST (single_set (dep_insn)),
6471 XEXP (SET_SRC (single_set (insn)),
6474 Index: gcc/config/sh/sh.md
6475 ===================================================================
6476 --- gcc/config/sh/sh.md (.../tags/gcc_4_2_0_release) (wersja 125589)
6477 +++ gcc/config/sh/sh.md (.../branches/gcc-4_2-branch) (wersja 125589)
6478 @@ -413,10 +413,12 @@
6479 (eq_attr "type" "jump")
6480 (cond [(eq_attr "med_branch_p" "yes")
6482 - (and (eq (symbol_ref "GET_CODE (prev_nonnote_insn (insn))")
6483 - (symbol_ref "INSN"))
6484 - (eq (symbol_ref "INSN_CODE (prev_nonnote_insn (insn))")
6485 - (symbol_ref "code_for_indirect_jump_scratch")))
6486 + (and (ne (symbol_ref "prev_nonnote_insn (insn)")
6488 + (and (eq (symbol_ref "GET_CODE (prev_nonnote_insn (insn))")
6489 + (symbol_ref "INSN"))
6490 + (eq (symbol_ref "INSN_CODE (prev_nonnote_insn (insn))")
6491 + (symbol_ref "code_for_indirect_jump_scratch"))))
6492 (cond [(eq_attr "braf_branch_p" "yes")
6494 (eq (symbol_ref "flag_pic") (const_int 0))
6495 @@ -750,54 +752,6 @@
6496 (set_attr "type" "arith3")])
6498 (define_insn "cmpeqsi_media"
6499 - [(set (match_operand:DI 0 "register_operand" "=r")
6500 - (eq:DI (match_operand:SI 1 "logical_operand" "%r")
6501 - (match_operand:SI 2 "cmp_operand" "Nr")))]
6503 - "cmpeq %1, %N2, %0"
6504 - [(set_attr "type" "cmp_media")])
6506 -(define_insn "cmpeqdi_media"
6507 - [(set (match_operand:DI 0 "register_operand" "=r")
6508 - (eq:DI (match_operand:DI 1 "register_operand" "%r")
6509 - (match_operand:DI 2 "cmp_operand" "Nr")))]
6511 - "cmpeq %1, %N2, %0"
6512 - [(set_attr "type" "cmp_media")])
6514 -(define_insn "cmpgtsi_media"
6515 - [(set (match_operand:DI 0 "register_operand" "=r")
6516 - (gt:DI (match_operand:SI 1 "cmp_operand" "Nr")
6517 - (match_operand:SI 2 "cmp_operand" "rN")))]
6519 - "cmpgt %N1, %N2, %0"
6520 - [(set_attr "type" "cmp_media")])
6522 -(define_insn "cmpgtdi_media"
6523 - [(set (match_operand:DI 0 "register_operand" "=r")
6524 - (gt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr")
6525 - (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))]
6527 - "cmpgt %N1, %N2, %0"
6528 - [(set_attr "type" "cmp_media")])
6530 -(define_insn "cmpgtusi_media"
6531 - [(set (match_operand:DI 0 "register_operand" "=r")
6532 - (gtu:DI (match_operand:SI 1 "cmp_operand" "Nr")
6533 - (match_operand:SI 2 "cmp_operand" "rN")))]
6535 - "cmpgtu %N1, %N2, %0"
6536 - [(set_attr "type" "cmp_media")])
6538 -(define_insn "cmpgtudi_media"
6539 - [(set (match_operand:DI 0 "register_operand" "=r")
6540 - (gtu:DI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr")
6541 - (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))]
6543 - "cmpgtu %N1, %N2, %0"
6544 - [(set_attr "type" "cmp_media")])
6546 -(define_insn "cmpsieqsi_media"
6547 [(set (match_operand:SI 0 "register_operand" "=r")
6548 (eq:SI (match_operand:SI 1 "logical_operand" "%r")
6549 (match_operand:SI 2 "cmp_operand" "Nr")))]
6552 [(set_attr "type" "cmp_media")])
6554 -(define_insn "cmpsieqdi_media"
6555 +(define_insn "cmpeqdi_media"
6556 [(set (match_operand:SI 0 "register_operand" "=r")
6557 (eq:SI (match_operand:DI 1 "register_operand" "%r")
6558 (match_operand:DI 2 "cmp_operand" "Nr")))]
6561 [(set_attr "type" "cmp_media")])
6563 -(define_insn "cmpsigtsi_media"
6564 +(define_insn "cmpgtsi_media"
6565 [(set (match_operand:SI 0 "register_operand" "=r")
6566 (gt:SI (match_operand:SI 1 "cmp_operand" "Nr")
6567 (match_operand:SI 2 "cmp_operand" "rN")))]
6569 "cmpgt %N1, %N2, %0"
6570 [(set_attr "type" "cmp_media")])
6572 -(define_insn "cmpsigtdi_media"
6573 +(define_insn "cmpgtdi_media"
6574 [(set (match_operand:SI 0 "register_operand" "=r")
6575 (gt:SI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr")
6576 (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))]
6578 "cmpgt %N1, %N2, %0"
6579 [(set_attr "type" "cmp_media")])
6581 -(define_insn "cmpsigtusi_media"
6582 +(define_insn "cmpgtusi_media"
6583 [(set (match_operand:SI 0 "register_operand" "=r")
6584 (gtu:SI (match_operand:SI 1 "cmp_operand" "Nr")
6585 (match_operand:SI 2 "cmp_operand" "rN")))]
6587 "cmpgtu %N1, %N2, %0"
6588 [(set_attr "type" "cmp_media")])
6590 -(define_insn "cmpsigtudi_media"
6591 +(define_insn "cmpgtudi_media"
6592 [(set (match_operand:SI 0 "register_operand" "=r")
6593 (gtu:SI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr")
6594 (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))]
6595 @@ -846,13 +800,6 @@
6596 [(set_attr "type" "cmp_media")])
6598 ; These two patterns are for combine.
6599 -(define_insn "*cmpne0si_media"
6600 - [(set (match_operand:DI 0 "register_operand" "=r")
6601 - (ne:DI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 0)))]
6603 - "cmpgtu %1,r63,%0"
6604 - [(set_attr "type" "cmp_media")])
6606 (define_insn "*cmpne0sisi_media"
6607 [(set (match_operand:SI 0 "register_operand" "=r")
6608 (ne:SI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 0)))]
6609 @@ -1177,7 +1124,7 @@
6611 emit_insn (gen_movsicc_false (operands[0], operands[1], operands[2],
6613 - emit_insn (gen_cmpsigtusi_media (operands[5], operands[4], operands[0]));
6614 + emit_insn (gen_cmpgtusi_media (operands[5], operands[4], operands[0]));
6615 emit_insn (gen_movsicc_false (operands[0], operands[5], operands[4],
6618 @@ -7200,7 +7147,7 @@
6621 (define_expand "bunordered"
6622 - [(set (match_dup 1) (unordered:DI (match_dup 2) (match_dup 3)))
6623 + [(set (match_dup 1) (unordered:SI (match_dup 2) (match_dup 3)))
6625 (if_then_else (ne (match_dup 1) (const_int 0))
6626 (match_operand 0 "" "")
6627 @@ -7209,7 +7156,7 @@
6630 operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]);
6631 - operands[1] = gen_reg_rtx (DImode);
6632 + operands[1] = gen_reg_rtx (SImode);
6633 operands[2] = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
6634 operands[3] = force_reg (GET_MODE (sh_compare_op1), sh_compare_op1);
6636 @@ -8397,6 +8344,20 @@
6638 gen_rtx_REG (Pmode, PIC_REG)));
6640 + /* When stack protector inserts codes after the result is set to
6641 + R0, @(rX, r12) will cause a spill failure for R0. Don't schedule
6642 + insns to avoid combining (set A (plus rX r12)) and (set op0 (mem A))
6643 + when rX is a GOT address for the guard symbol. Ugly but doesn't
6644 + matter because this is a rare situation. */
6645 + if (!TARGET_SHMEDIA
6646 + && flag_stack_protect
6647 + && GET_CODE (operands[1]) == CONST
6648 + && GET_CODE (XEXP (operands[1], 0)) == UNSPEC
6649 + && GET_CODE (XVECEXP (XEXP (operands[1], 0), 0, 0)) == SYMBOL_REF
6650 + && strcmp (XSTR (XVECEXP (XEXP (operands[1], 0), 0, 0), 0),
6651 + \"__stack_chk_guard\") == 0)
6652 + emit_insn (gen_blockage ());
6654 /* N.B. This is not constant for a GOTPLT relocation. */
6655 mem = gen_rtx_MEM (Pmode, operands[3]);
6656 MEM_NOTRAP_P (mem) = 1;
6657 @@ -9112,6 +9073,8 @@
6663 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
6664 if (sh_compare_op1 != const0_rtx)
6665 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
6666 @@ -9126,26 +9089,26 @@
6667 switch (GET_MODE (sh_compare_op0))
6670 - emit_insn (gen_cmpsieqsi_media (operands[0],
6671 + emit_insn (gen_cmpeqsi_media (operands[0],
6672 sh_compare_op0, sh_compare_op1));
6676 - emit_insn (gen_cmpsieqdi_media (operands[0],
6677 + emit_insn (gen_cmpeqdi_media (operands[0],
6678 sh_compare_op0, sh_compare_op1));
6682 if (! TARGET_SHMEDIA_FPU)
6684 - emit_insn (gen_cmpsieqsf_media (operands[0],
6685 + emit_insn (gen_cmpeqsf_media (operands[0],
6686 sh_compare_op0, sh_compare_op1));
6690 if (! TARGET_SHMEDIA_FPU)
6692 - emit_insn (gen_cmpsieqdf_media (operands[0],
6693 + emit_insn (gen_cmpeqdf_media (operands[0],
6694 sh_compare_op0, sh_compare_op1));
6697 @@ -9155,38 +9118,44 @@
6701 - if (GET_MODE (operands[0]) != DImode)
6702 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
6703 + reg = operands[0];
6704 + if (GET_MODE (operands[0]) != SImode)
6705 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
6706 + : gen_reg_rtx (SImode);
6708 switch (GET_MODE (sh_compare_op0))
6711 - emit_insn (gen_cmpeqsi_media (operands[0],
6712 + emit_insn (gen_cmpeqsi_media (reg,
6713 sh_compare_op0, sh_compare_op1));
6717 - emit_insn (gen_cmpeqdi_media (operands[0],
6718 + emit_insn (gen_cmpeqdi_media (reg,
6719 sh_compare_op0, sh_compare_op1));
6723 if (! TARGET_SHMEDIA_FPU)
6725 - emit_insn (gen_cmpeqsf_media (operands[0],
6726 + emit_insn (gen_cmpeqsf_media (reg,
6727 sh_compare_op0, sh_compare_op1));
6731 if (! TARGET_SHMEDIA_FPU)
6733 - emit_insn (gen_cmpeqdf_media (operands[0],
6734 + emit_insn (gen_cmpeqdf_media (reg,
6735 sh_compare_op0, sh_compare_op1));
6742 + if (GET_MODE (operands[0]) == DImode)
6743 + emit_insn (gen_extendsidi2 (operands[0], reg));
6747 if (sh_expand_t_scc (EQ, operands[0]))
6748 @@ -9204,8 +9173,8 @@
6752 - if (GET_MODE (operands[0]) != DImode)
6753 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
6756 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
6757 if (sh_compare_op1 != const0_rtx)
6758 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
6759 @@ -9213,35 +9182,44 @@
6760 : GET_MODE (sh_compare_op1),
6763 + reg = operands[0];
6764 + if (GET_MODE (operands[0]) != SImode)
6765 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
6766 + : gen_reg_rtx (SImode);
6768 switch (GET_MODE (sh_compare_op0))
6771 - emit_insn (gen_cmpgtsi_media (operands[0],
6772 + emit_insn (gen_cmpgtsi_media (reg,
6773 sh_compare_op1, sh_compare_op0));
6777 - emit_insn (gen_cmpgtdi_media (operands[0],
6778 + emit_insn (gen_cmpgtdi_media (reg,
6779 sh_compare_op1, sh_compare_op0));
6783 if (! TARGET_SHMEDIA_FPU)
6785 - emit_insn (gen_cmpgtsf_media (operands[0],
6786 + emit_insn (gen_cmpgtsf_media (reg,
6787 sh_compare_op1, sh_compare_op0));
6791 if (! TARGET_SHMEDIA_FPU)
6793 - emit_insn (gen_cmpgtdf_media (operands[0],
6794 + emit_insn (gen_cmpgtdf_media (reg,
6795 sh_compare_op1, sh_compare_op0));
6802 + if (GET_MODE (operands[0]) == DImode)
6803 + emit_insn (gen_extendsidi2 (operands[0], reg));
6807 if (! currently_expanding_to_rtl)
6808 @@ -9258,8 +9236,8 @@
6812 - if (GET_MODE (operands[0]) != DImode)
6813 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
6816 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
6817 if (sh_compare_op1 != const0_rtx)
6818 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
6819 @@ -9267,45 +9245,54 @@
6820 : GET_MODE (sh_compare_op1),
6823 + reg = operands[0];
6824 + if (GET_MODE (operands[0]) != SImode)
6825 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
6826 + : gen_reg_rtx (SImode);
6828 switch (GET_MODE (sh_compare_op0))
6832 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
6833 + tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
6835 emit_insn (gen_cmpgtsi_media (tmp,
6836 sh_compare_op0, sh_compare_op1));
6837 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
6838 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
6844 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
6845 + tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
6847 emit_insn (gen_cmpgtdi_media (tmp,
6848 sh_compare_op0, sh_compare_op1));
6849 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
6850 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
6855 if (! TARGET_SHMEDIA_FPU)
6857 - emit_insn (gen_cmpgesf_media (operands[0],
6858 + emit_insn (gen_cmpgesf_media (reg,
6859 sh_compare_op1, sh_compare_op0));
6863 if (! TARGET_SHMEDIA_FPU)
6865 - emit_insn (gen_cmpgedf_media (operands[0],
6866 + emit_insn (gen_cmpgedf_media (reg,
6867 sh_compare_op1, sh_compare_op0));
6874 + if (GET_MODE (operands[0]) == DImode)
6875 + emit_insn (gen_extendsidi2 (operands[0], reg));
6880 @@ -9323,8 +9310,12 @@
6884 - if (GET_MODE (operands[0]) != DImode)
6885 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
6888 + reg = operands[0];
6889 + if (GET_MODE (operands[0]) != SImode)
6890 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
6891 + : gen_reg_rtx (SImode);
6892 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
6893 if (sh_compare_op1 != const0_rtx)
6894 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
6895 @@ -9335,32 +9326,36 @@
6896 switch (GET_MODE (sh_compare_op0))
6899 - emit_insn (gen_cmpgtsi_media (operands[0],
6900 + emit_insn (gen_cmpgtsi_media (reg,
6901 sh_compare_op0, sh_compare_op1));
6905 - emit_insn (gen_cmpgtdi_media (operands[0],
6906 + emit_insn (gen_cmpgtdi_media (reg,
6907 sh_compare_op0, sh_compare_op1));
6911 if (! TARGET_SHMEDIA_FPU)
6913 - emit_insn (gen_cmpgtsf_media (operands[0],
6914 + emit_insn (gen_cmpgtsf_media (reg,
6915 sh_compare_op0, sh_compare_op1));
6919 if (! TARGET_SHMEDIA_FPU)
6921 - emit_insn (gen_cmpgtdf_media (operands[0],
6922 + emit_insn (gen_cmpgtdf_media (reg,
6923 sh_compare_op0, sh_compare_op1));
6930 + if (GET_MODE (operands[0]) == DImode)
6931 + emit_insn (gen_extendsidi2 (operands[0], reg));
6935 if (! currently_expanding_to_rtl)
6936 @@ -9376,12 +9371,15 @@
6941 enum machine_mode mode = GET_MODE (sh_compare_op0);
6943 if ((mode) == VOIDmode)
6944 mode = GET_MODE (sh_compare_op1);
6945 - if (GET_MODE (operands[0]) != DImode)
6946 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
6947 + reg = operands[0];
6948 + if (GET_MODE (operands[0]) != SImode)
6949 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
6950 + : gen_reg_rtx (SImode);
6951 sh_compare_op0 = force_reg (mode, sh_compare_op0);
6952 if (sh_compare_op1 != const0_rtx)
6953 sh_compare_op1 = force_reg (mode, sh_compare_op1);
6954 @@ -9390,41 +9388,45 @@
6958 - rtx tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
6959 + rtx tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
6961 emit_insn (gen_cmpgtsi_media (tmp,
6962 sh_compare_op1, sh_compare_op0));
6963 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
6964 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
6970 - rtx tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
6971 + rtx tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
6973 emit_insn (gen_cmpgtdi_media (tmp,
6974 sh_compare_op1, sh_compare_op0));
6975 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
6976 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
6981 if (! TARGET_SHMEDIA_FPU)
6983 - emit_insn (gen_cmpgesf_media (operands[0],
6984 + emit_insn (gen_cmpgesf_media (reg,
6985 sh_compare_op0, sh_compare_op1));
6989 if (! TARGET_SHMEDIA_FPU)
6991 - emit_insn (gen_cmpgedf_media (operands[0],
6992 + emit_insn (gen_cmpgedf_media (reg,
6993 sh_compare_op0, sh_compare_op1));
7000 + if (GET_MODE (operands[0]) == DImode)
7001 + emit_insn (gen_extendsidi2 (operands[0], reg));
7006 @@ -9456,8 +9458,12 @@
7010 - if (GET_MODE (operands[0]) != DImode)
7011 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
7014 + reg = operands[0];
7015 + if (GET_MODE (operands[0]) == DImode)
7016 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
7017 + : gen_reg_rtx (SImode);
7018 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
7019 if (sh_compare_op1 != const0_rtx)
7020 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
7021 @@ -9465,8 +9471,11 @@
7022 : GET_MODE (sh_compare_op1),
7025 - emit_insn (gen_cmpgtudi_media (operands[0],
7026 + emit_insn (gen_cmpgtudi_media (reg,
7027 sh_compare_op0, sh_compare_op1));
7028 + if (GET_MODE (operands[0]) == DImode)
7029 + emit_insn (gen_extendsidi2 (operands[0], reg));
7033 if (! currently_expanding_to_rtl)
7034 @@ -9482,8 +9491,12 @@
7038 - if (GET_MODE (operands[0]) != DImode)
7039 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
7042 + reg = operands[0];
7043 + if (GET_MODE (operands[0]) == DImode)
7044 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
7045 + : gen_reg_rtx (SImode);
7046 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
7047 if (sh_compare_op1 != const0_rtx)
7048 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
7049 @@ -9491,8 +9504,11 @@
7050 : GET_MODE (sh_compare_op1),
7053 - emit_insn (gen_cmpgtudi_media (operands[0],
7054 + emit_insn (gen_cmpgtudi_media (reg,
7055 sh_compare_op1, sh_compare_op0));
7056 + if (GET_MODE (operands[0]) == DImode)
7057 + emit_insn (gen_extendsidi2 (operands[0], reg));
7061 if (! currently_expanding_to_rtl)
7062 @@ -9508,10 +9524,12 @@
7069 - if (GET_MODE (operands[0]) != DImode)
7070 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
7071 + reg = operands[0];
7072 + if (GET_MODE (operands[0]) != SImode)
7073 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
7074 + : gen_reg_rtx (SImode);
7075 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
7076 if (sh_compare_op1 != const0_rtx)
7077 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
7078 @@ -9519,10 +9537,12 @@
7079 : GET_MODE (sh_compare_op1),
7082 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
7083 + tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
7085 emit_insn (gen_cmpgtudi_media (tmp, sh_compare_op0, sh_compare_op1));
7086 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
7087 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
7088 + if (GET_MODE (operands[0]) == DImode)
7089 + emit_insn (gen_extendsidi2 (operands[0], reg));
7093 @@ -9539,10 +9559,12 @@
7100 - if (GET_MODE (operands[0]) != DImode)
7101 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
7102 + reg = operands[0];
7103 + if (GET_MODE (operands[0]) != SImode)
7104 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
7105 + : gen_reg_rtx (SImode);
7106 sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0);
7107 if (sh_compare_op1 != const0_rtx)
7108 sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode
7109 @@ -9550,10 +9572,12 @@
7110 : GET_MODE (sh_compare_op1),
7113 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
7114 + tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (SImode);
7116 emit_insn (gen_cmpgtudi_media (tmp, sh_compare_op1, sh_compare_op0));
7117 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
7118 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
7119 + if (GET_MODE (operands[0]) == DImode)
7120 + emit_insn (gen_extendsidi2 (operands[0], reg));
7124 @@ -9584,11 +9608,12 @@
7131 - if (GET_MODE (operands[0]) != DImode)
7132 - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0);
7134 + reg = operands[0];
7135 + if (GET_MODE (operands[0]) != SImode)
7136 + reg = no_new_pseudos ? gen_rtx_SUBREG (SImode, operands[0], 0)
7137 + : gen_reg_rtx (SImode);
7138 if (! TARGET_SHMEDIA_FPU
7139 && GET_MODE (sh_compare_op0) != DImode
7140 && GET_MODE (sh_compare_op0) != SImode)
7141 @@ -9601,10 +9626,12 @@
7142 : GET_MODE (sh_compare_op1),
7145 - tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode);
7146 + tmp = no_new_pseudos ? reg : gen_reg_rtx (SImode);
7148 emit_insn (gen_seq (tmp));
7149 - emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx));
7150 + emit_insn (gen_cmpeqdi_media (reg, tmp, const0_rtx));
7151 + if (GET_MODE (operands[0]) == DImode)
7152 + emit_insn (gen_extendsidi2 (operands[0], reg));
7156 @@ -9618,8 +9645,8 @@
7159 (define_expand "sunordered"
7160 - [(set (match_operand:DI 0 "arith_reg_operand" "")
7161 - (unordered:DI (match_dup 1) (match_dup 2)))]
7162 + [(set (match_operand:SI 0 "arith_reg_operand" "")
7163 + (unordered:SI (match_dup 1) (match_dup 2)))]
7164 "TARGET_SHMEDIA_FPU"
7167 @@ -10378,14 +10405,6 @@
7168 (set_attr "fp_mode" "single")])
7170 (define_insn "cmpeqsf_media"
7171 - [(set (match_operand:DI 0 "register_operand" "=r")
7172 - (eq:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")
7173 - (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
7174 - "TARGET_SHMEDIA_FPU"
7175 - "fcmpeq.s %1, %2, %0"
7176 - [(set_attr "type" "fcmp_media")])
7178 -(define_insn "cmpsieqsf_media"
7179 [(set (match_operand:SI 0 "register_operand" "=r")
7180 (eq:SI (match_operand:SF 1 "fp_arith_reg_operand" "f")
7181 (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
7182 @@ -10394,24 +10413,24 @@
7183 [(set_attr "type" "fcmp_media")])
7185 (define_insn "cmpgtsf_media"
7186 - [(set (match_operand:DI 0 "register_operand" "=r")
7187 - (gt:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")
7188 + [(set (match_operand:SI 0 "register_operand" "=r")
7189 + (gt:SI (match_operand:SF 1 "fp_arith_reg_operand" "f")
7190 (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
7191 "TARGET_SHMEDIA_FPU"
7192 "fcmpgt.s %1, %2, %0"
7193 [(set_attr "type" "fcmp_media")])
7195 (define_insn "cmpgesf_media"
7196 - [(set (match_operand:DI 0 "register_operand" "=r")
7197 - (ge:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")
7198 + [(set (match_operand:SI 0 "register_operand" "=r")
7199 + (ge:SI (match_operand:SF 1 "fp_arith_reg_operand" "f")
7200 (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
7201 "TARGET_SHMEDIA_FPU"
7202 "fcmpge.s %1, %2, %0"
7203 [(set_attr "type" "fcmp_media")])
7205 (define_insn "cmpunsf_media"
7206 - [(set (match_operand:DI 0 "register_operand" "=r")
7207 - (unordered:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")
7208 + [(set (match_operand:SI 0 "register_operand" "=r")
7209 + (unordered:SI (match_operand:SF 1 "fp_arith_reg_operand" "f")
7210 (match_operand:SF 2 "fp_arith_reg_operand" "f")))]
7211 "TARGET_SHMEDIA_FPU"
7212 "fcmpun.s %1, %2, %0"
7213 @@ -10884,14 +10903,6 @@
7214 (set_attr "fp_mode" "double")])
7216 (define_insn "cmpeqdf_media"
7217 - [(set (match_operand:DI 0 "register_operand" "=r")
7218 - (eq:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
7219 - (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
7220 - "TARGET_SHMEDIA_FPU"
7221 - "fcmpeq.d %1,%2,%0"
7222 - [(set_attr "type" "fcmp_media")])
7224 -(define_insn "cmpsieqdf_media"
7225 [(set (match_operand:SI 0 "register_operand" "=r")
7226 (eq:SI (match_operand:DF 1 "fp_arith_reg_operand" "f")
7227 (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
7228 @@ -10900,24 +10911,24 @@
7229 [(set_attr "type" "fcmp_media")])
7231 (define_insn "cmpgtdf_media"
7232 - [(set (match_operand:DI 0 "register_operand" "=r")
7233 - (gt:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
7234 + [(set (match_operand:SI 0 "register_operand" "=r")
7235 + (gt:SI (match_operand:DF 1 "fp_arith_reg_operand" "f")
7236 (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
7237 "TARGET_SHMEDIA_FPU"
7239 [(set_attr "type" "fcmp_media")])
7241 (define_insn "cmpgedf_media"
7242 - [(set (match_operand:DI 0 "register_operand" "=r")
7243 - (ge:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
7244 + [(set (match_operand:SI 0 "register_operand" "=r")
7245 + (ge:SI (match_operand:DF 1 "fp_arith_reg_operand" "f")
7246 (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
7247 "TARGET_SHMEDIA_FPU"
7249 [(set_attr "type" "fcmp_media")])
7251 (define_insn "cmpundf_media"
7252 - [(set (match_operand:DI 0 "register_operand" "=r")
7253 - (unordered:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")
7254 + [(set (match_operand:SI 0 "register_operand" "=r")
7255 + (unordered:SI (match_operand:DF 1 "fp_arith_reg_operand" "f")
7256 (match_operand:DF 2 "fp_arith_reg_operand" "f")))]
7257 "TARGET_SHMEDIA_FPU"
7259 Index: gcc/config/score/predicates.md
7260 ===================================================================
7261 --- gcc/config/score/predicates.md (.../tags/gcc_4_2_0_release) (wersja 125589)
7262 +++ gcc/config/score/predicates.md (.../branches/gcc-4_2-branch) (wersja 125589)
7264 return IMM_IN_RANGE (INTVAL (op), 15, 1);
7267 -(define_predicate "const_pow2"
7268 - (match_code "const_int")
7270 - return IMM_IS_POW_OF_2 ((unsigned HOST_WIDE_INT) INTVAL (op), 0, 31);
7273 -(define_predicate "const_npow2"
7274 - (match_code "const_int")
7276 - return IMM_IS_POW_OF_2 (~(unsigned HOST_WIDE_INT) INTVAL (op), 0, 31);
7278 Index: gcc/config/score/misc.md
7279 ===================================================================
7280 --- gcc/config/score/misc.md (.../tags/gcc_4_2_0_release) (wersja 125589)
7281 +++ gcc/config/score/misc.md (.../branches/gcc-4_2-branch) (wersja 125589)
7282 @@ -380,38 +380,3 @@
7283 [(set_attr "type" "arith")
7284 (set_attr "mode" "SI")])
7286 -(define_insn "bitclr_c"
7287 - [(set (match_operand:SI 0 "register_operand" "=e,d")
7288 - (and:SI (match_operand:SI 1 "register_operand" "0,d")
7289 - (match_operand:SI 2 "const_npow2")))
7290 - (clobber (reg:CC CC_REGNUM))]
7294 - bitclr.c %0, %1, %F2"
7295 - [(set_attr "type" "arith")
7296 - (set_attr "mode" "SI")])
7298 -(define_insn "bitset_c"
7299 - [(set (match_operand:SI 0 "register_operand" "=e,d")
7300 - (ior:SI (match_operand:SI 1 "register_operand" "0,d")
7301 - (match_operand:SI 2 "const_pow2")))
7302 - (clobber (reg:CC CC_REGNUM))]
7306 - bitset.c %0, %1, %E2"
7307 - [(set_attr "type" "arith")
7308 - (set_attr "mode" "SI")])
7310 -(define_insn "bittgl_c"
7311 - [(set (match_operand:SI 0 "register_operand" "=e,d")
7312 - (xor:SI (match_operand:SI 1 "register_operand" "0,d")
7313 - (match_operand:SI 2 "const_pow2")))
7314 - (clobber (reg:CC CC_REGNUM))]
7318 - bittgl.c %0, %1, %E2"
7319 - [(set_attr "type" "arith")
7320 - (set_attr "mode" "SI")])
7321 Index: gcc/config/score/score.c
7322 ===================================================================
7323 --- gcc/config/score/score.c (.../tags/gcc_4_2_0_release) (wersja 125589)
7324 +++ gcc/config/score/score.c (.../branches/gcc-4_2-branch) (wersja 125589)
7325 @@ -1168,7 +1168,7 @@
7327 gcc_assert (code == CONST_INT);
7328 fprintf (file, HOST_WIDE_INT_PRINT_HEX,
7329 - (unsigned HOST_WIDE_INT) INTVAL (op) >> 16);
7330 + (INTVAL (op) >> 16) & 0xffff);
7334 @@ -1176,7 +1176,7 @@
7336 rtx temp = gen_lowpart (SImode, op);
7337 gcc_assert (GET_MODE (op) == SFmode);
7338 - fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (temp));
7339 + fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (temp) & 0xffffffff);
7342 output_addr_const (file, op);
7343 Index: gcc/config/score/score.h
7344 ===================================================================
7345 --- gcc/config/score/score.h (.../tags/gcc_4_2_0_release) (wersja 125589)
7346 +++ gcc/config/score/score.h (.../branches/gcc-4_2-branch) (wersja 125589)
7348 output anything and let undefined symbol become external. However
7349 the assembler uses length information on externals to allocate in
7350 data/sdata bss/sbss, thereby saving exec time. */
7351 +#undef ASM_OUTPUT_EXTERNAL
7352 #define ASM_OUTPUT_EXTERNAL(STREAM, DECL, NAME) \
7353 score_output_external (STREAM, DECL, NAME)
7355 Index: gcc/config/pa/pa.md
7356 ===================================================================
7357 --- gcc/config/pa/pa.md (.../tags/gcc_4_2_0_release) (wersja 125589)
7358 +++ gcc/config/pa/pa.md (.../branches/gcc-4_2-branch) (wersja 125589)
7360 (UNSPEC_TLSLDBASE 7)
7363 + (UNSPEC_TLSGD_PIC 10)
7364 + (UNSPEC_TLSLDM_PIC 11)
7365 + (UNSPEC_TLSIE_PIC 12)
7369 @@ -9890,33 +9893,55 @@
7370 (define_insn "tgd_load"
7371 [(set (match_operand:SI 0 "register_operand" "=r")
7372 (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD))
7373 - (clobber (reg:SI 1))]
7374 + (clobber (reg:SI 1))
7375 + (use (reg:SI 27))]
7380 - return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
7382 - return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\";
7383 + return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\";
7385 [(set_attr "type" "multi")
7386 (set_attr "length" "8")])
7388 +(define_insn "tgd_load_pic"
7389 + [(set (match_operand:SI 0 "register_operand" "=r")
7390 + (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD_PIC))
7391 + (clobber (reg:SI 1))
7392 + (use (reg:SI 19))]
7396 + return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
7398 + [(set_attr "type" "multi")
7399 + (set_attr "length" "8")])
7401 (define_insn "tld_load"
7402 [(set (match_operand:SI 0 "register_operand" "=r")
7403 (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM))
7404 - (clobber (reg:SI 1))]
7405 + (clobber (reg:SI 1))
7406 + (use (reg:SI 27))]
7411 - return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\";
7413 - return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\";
7414 + return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\";
7416 [(set_attr "type" "multi")
7417 (set_attr "length" "8")])
7419 +(define_insn "tld_load_pic"
7420 + [(set (match_operand:SI 0 "register_operand" "=r")
7421 + (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM_PIC))
7422 + (clobber (reg:SI 1))
7423 + (use (reg:SI 19))]
7427 + return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\";
7429 + [(set_attr "type" "multi")
7430 + (set_attr "length" "8")])
7432 (define_insn "tld_offset_load"
7433 [(set (match_operand:SI 0 "register_operand" "=r")
7434 (plus:SI (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")]
7435 @@ -9942,18 +9967,29 @@
7436 (define_insn "tie_load"
7437 [(set (match_operand:SI 0 "register_operand" "=r")
7438 (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE))
7439 - (clobber (reg:SI 1))]
7440 + (clobber (reg:SI 1))
7441 + (use (reg:SI 27))]
7446 - return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\";
7448 - return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\";
7449 + return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\";
7451 [(set_attr "type" "multi")
7452 (set_attr "length" "8")])
7454 +(define_insn "tie_load_pic"
7455 + [(set (match_operand:SI 0 "register_operand" "=r")
7456 + (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE_PIC))
7457 + (clobber (reg:SI 1))
7458 + (use (reg:SI 19))]
7462 + return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\";
7464 + [(set_attr "type" "multi")
7465 + (set_attr "length" "8")])
7467 (define_insn "tle_load"
7468 [(set (match_operand:SI 0 "register_operand" "=r")
7469 (plus:SI (unspec:SI [(match_operand 1 "tle_symbolic_operand" "")]
7470 Index: gcc/config/pa/pa.c
7471 ===================================================================
7472 --- gcc/config/pa/pa.c (.../tags/gcc_4_2_0_release) (wersja 125589)
7473 +++ gcc/config/pa/pa.c (.../branches/gcc-4_2-branch) (wersja 125589)
7474 @@ -726,7 +726,10 @@
7476 case TLS_MODEL_GLOBAL_DYNAMIC:
7477 tmp = gen_reg_rtx (Pmode);
7478 - emit_insn (gen_tgd_load (tmp, addr));
7480 + emit_insn (gen_tgd_load_pic (tmp, addr));
7482 + emit_insn (gen_tgd_load (tmp, addr));
7483 ret = hppa_tls_call (tmp);
7486 @@ -734,7 +737,10 @@
7487 ret = gen_reg_rtx (Pmode);
7488 tmp = gen_reg_rtx (Pmode);
7490 - emit_insn (gen_tld_load (tmp, addr));
7492 + emit_insn (gen_tld_load_pic (tmp, addr));
7494 + emit_insn (gen_tld_load (tmp, addr));
7495 t1 = hppa_tls_call (tmp);
7496 insn = get_insns ();
7498 @@ -750,7 +756,10 @@
7499 tmp = gen_reg_rtx (Pmode);
7500 ret = gen_reg_rtx (Pmode);
7501 emit_insn (gen_tp_load (tp));
7502 - emit_insn (gen_tie_load (tmp, addr));
7504 + emit_insn (gen_tie_load_pic (tmp, addr));
7506 + emit_insn (gen_tie_load (tmp, addr));
7507 emit_move_insn (ret, gen_rtx_PLUS (Pmode, tp, tmp));
7510 Index: gcc/config/soft-fp/quad.h
7511 ===================================================================
7512 --- gcc/config/soft-fp/quad.h (.../tags/gcc_4_2_0_release) (wersja 125589)
7513 +++ gcc/config/soft-fp/quad.h (.../branches/gcc-4_2-branch) (wersja 125589)
7515 /* Software floating-point emulation.
7516 Definitions for IEEE Quad Precision.
7517 - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
7518 + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
7519 This file is part of the GNU C Library.
7520 Contributed by Richard Henderson (rth@cygnus.com),
7521 Jakub Jelinek (jj@ultra.linux.cz),
7522 @@ -176,15 +176,15 @@
7525 #if __BYTE_ORDER == __BIG_ENDIAN
7526 - unsigned sign : 1;
7527 - unsigned exp : _FP_EXPBITS_Q;
7528 - unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
7529 - unsigned long frac0 : _FP_W_TYPE_SIZE;
7530 + unsigned sign : 1;
7531 + unsigned exp : _FP_EXPBITS_Q;
7532 + _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
7533 + _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
7535 - unsigned long frac0 : _FP_W_TYPE_SIZE;
7536 - unsigned long frac1 : _FP_FRACBITS_Q-(_FP_IMPLBIT_Q != 0)-_FP_W_TYPE_SIZE;
7537 - unsigned exp : _FP_EXPBITS_Q;
7538 - unsigned sign : 1;
7539 + _FP_W_TYPE frac0 : _FP_W_TYPE_SIZE;
7540 + _FP_W_TYPE frac1 : _FP_FRACBITS_Q - (_FP_IMPLBIT_Q != 0) - _FP_W_TYPE_SIZE;
7541 + unsigned exp : _FP_EXPBITS_Q;
7542 + unsigned sign : 1;
7546 Index: gcc/config/soft-fp/floatunsidf.c
7547 ===================================================================
7548 --- gcc/config/soft-fp/floatunsidf.c (.../tags/gcc_4_2_0_release) (wersja 125589)
7549 +++ gcc/config/soft-fp/floatunsidf.c (.../branches/gcc-4_2-branch) (wersja 125589)
7551 /* Software floating-point emulation.
7552 Convert a 32bit unsigned integer to IEEE double
7553 - Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
7554 + Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
7555 This file is part of the GNU C Library.
7556 Contributed by Richard Henderson (rth@cygnus.com) and
7557 Jakub Jelinek (jj@ultra.linux.cz).
7559 #include "soft-fp.h"
7563 -__floatunsidf(USItype i)
7564 +DFtype __floatunsidf(USItype i)
7568 Index: gcc/config/soft-fp/floatundidf.c
7569 ===================================================================
7570 --- gcc/config/soft-fp/floatundidf.c (.../tags/gcc_4_2_0_release) (wersja 125589)
7571 +++ gcc/config/soft-fp/floatundidf.c (.../branches/gcc-4_2-branch) (wersja 125589)
7573 /* Software floating-point emulation.
7574 Convert a 64bit unsigned integer to IEEE double
7575 - Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
7576 + Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
7577 This file is part of the GNU C Library.
7578 Contributed by Richard Henderson (rth@cygnus.com) and
7579 Jakub Jelinek (jj@ultra.linux.cz).
7581 #include "soft-fp.h"
7585 -__floatundidf(UDItype i)
7586 +DFtype __floatundidf(UDItype i)
7590 Index: gcc/config/soft-fp/extended.h
7591 ===================================================================
7592 --- gcc/config/soft-fp/extended.h (.../tags/gcc_4_2_0_release) (wersja 125589)
7593 +++ gcc/config/soft-fp/extended.h (.../branches/gcc-4_2-branch) (wersja 125589)
7595 /* Software floating-point emulation.
7596 Definitions for IEEE Extended Precision.
7597 - Copyright (C) 1999,2006 Free Software Foundation, Inc.
7598 + Copyright (C) 1999,2006,2007 Free Software Foundation, Inc.
7599 This file is part of the GNU C Library.
7600 Contributed by Jakub Jelinek (jj@ultra.linux.cz).
7603 X##_f[1] = _flo.bits.frac1; \
7604 X##_e = _flo.bits.exp; \
7605 X##_s = _flo.bits.sign; \
7606 - if (!X##_e && (X##_f[1] || X##_f[0]) \
7607 - && !(X##_f[1] & _FP_IMPLBIT_E)) \
7610 - FP_SET_EXCEPTION(FP_EX_DENORM); \
7614 #define FP_UNPACK_RAW_EP(X, val) \
7615 @@ -112,12 +106,6 @@
7616 X##_f[1] = _flo->bits.frac1; \
7617 X##_e = _flo->bits.exp; \
7618 X##_s = _flo->bits.sign; \
7619 - if (!X##_e && (X##_f[1] || X##_f[0]) \
7620 - && !(X##_f[1] & _FP_IMPLBIT_E)) \
7623 - FP_SET_EXCEPTION(FP_EX_DENORM); \
7627 #define FP_PACK_RAW_E(val, X) \
7628 @@ -164,13 +152,13 @@
7630 #define FP_UNPACK_SEMIRAW_E(X,val) \
7632 - _FP_UNPACK_RAW_E(X,val); \
7633 + FP_UNPACK_RAW_E(X,val); \
7634 _FP_UNPACK_SEMIRAW(E,4,X); \
7637 #define FP_UNPACK_SEMIRAW_EP(X,val) \
7639 - _FP_UNPACK_RAW_EP(X,val); \
7640 + FP_UNPACK_RAW_EP(X,val); \
7641 _FP_UNPACK_SEMIRAW(E,4,X); \
7644 @@ -189,13 +177,13 @@
7645 #define FP_PACK_SEMIRAW_E(val,X) \
7647 _FP_PACK_SEMIRAW(E,4,X); \
7648 - _FP_PACK_RAW_E(val,X); \
7649 + FP_PACK_RAW_E(val,X); \
7652 #define FP_PACK_SEMIRAW_EP(val,X) \
7654 _FP_PACK_SEMIRAW(E,4,X); \
7655 - _FP_PACK_RAW_EP(val,X); \
7656 + FP_PACK_RAW_EP(val,X); \
7659 #define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,4,X)
7660 @@ -277,14 +265,14 @@
7663 #if __BYTE_ORDER == __BIG_ENDIAN
7664 - unsigned long pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
7665 - unsigned sign : 1;
7666 - unsigned exp : _FP_EXPBITS_E;
7667 - unsigned long frac : _FP_W_TYPE_SIZE;
7668 + _FP_W_TYPE pad : (_FP_W_TYPE_SIZE - 1 - _FP_EXPBITS_E);
7669 + unsigned sign : 1;
7670 + unsigned exp : _FP_EXPBITS_E;
7671 + _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
7673 - unsigned long frac : _FP_W_TYPE_SIZE;
7674 - unsigned exp : _FP_EXPBITS_E;
7675 - unsigned sign : 1;
7676 + _FP_W_TYPE frac : _FP_W_TYPE_SIZE;
7677 + unsigned exp : _FP_EXPBITS_E;
7678 + unsigned sign : 1;
7682 @@ -299,11 +287,6 @@
7684 X##_e = _flo.bits.exp; \
7685 X##_s = _flo.bits.sign; \
7686 - if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \
7689 - FP_SET_EXCEPTION(FP_EX_DENORM); \
7693 #define FP_UNPACK_RAW_EP(X, val) \
7694 @@ -315,11 +298,6 @@
7696 X##_e = _flo->bits.exp; \
7697 X##_s = _flo->bits.sign; \
7698 - if (!X##_e && X##_f0 && !(X##_f0 & _FP_IMPLBIT_E)) \
7701 - FP_SET_EXCEPTION(FP_EX_DENORM); \
7705 #define FP_PACK_RAW_E(val, X) \
7706 @@ -365,13 +343,13 @@
7708 #define FP_UNPACK_SEMIRAW_E(X,val) \
7710 - _FP_UNPACK_RAW_E(X,val); \
7711 + FP_UNPACK_RAW_E(X,val); \
7712 _FP_UNPACK_SEMIRAW(E,2,X); \
7715 #define FP_UNPACK_SEMIRAW_EP(X,val) \
7717 - _FP_UNPACK_RAW_EP(X,val); \
7718 + FP_UNPACK_RAW_EP(X,val); \
7719 _FP_UNPACK_SEMIRAW(E,2,X); \
7722 @@ -390,13 +368,13 @@
7723 #define FP_PACK_SEMIRAW_E(val,X) \
7725 _FP_PACK_SEMIRAW(E,2,X); \
7726 - _FP_PACK_RAW_E(val,X); \
7727 + FP_PACK_RAW_E(val,X); \
7730 #define FP_PACK_SEMIRAW_EP(val,X) \
7732 _FP_PACK_SEMIRAW(E,2,X); \
7733 - _FP_PACK_RAW_EP(val,X); \
7734 + FP_PACK_RAW_EP(val,X); \
7737 #define FP_ISSIGNAN_E(X) _FP_ISSIGNAN(E,2,X)
7738 Index: gcc/config/soft-fp/floatunsisf.c
7739 ===================================================================
7740 --- gcc/config/soft-fp/floatunsisf.c (.../tags/gcc_4_2_0_release) (wersja 125589)
7741 +++ gcc/config/soft-fp/floatunsisf.c (.../branches/gcc-4_2-branch) (wersja 125589)
7743 /* Software floating-point emulation.
7744 Convert a 32bit unsigned integer to IEEE single
7745 - Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
7746 + Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
7747 This file is part of the GNU C Library.
7748 Contributed by Richard Henderson (rth@cygnus.com) and
7749 Jakub Jelinek (jj@ultra.linux.cz).
7751 #include "soft-fp.h"
7755 -__floatunsisf(USItype i)
7756 +SFtype __floatunsisf(USItype i)
7760 Index: gcc/config/soft-fp/op-common.h
7761 ===================================================================
7762 --- gcc/config/soft-fp/op-common.h (.../tags/gcc_4_2_0_release) (wersja 125589)
7763 +++ gcc/config/soft-fp/op-common.h (.../branches/gcc-4_2-branch) (wersja 125589)
7764 @@ -1153,7 +1153,8 @@
7765 if (_FP_FRACBITS_##dfs < _FP_FRACBITS_##sfs \
7766 || (_FP_EXPMAX_##dfs - _FP_EXPBIAS_##dfs \
7767 < _FP_EXPMAX_##sfs - _FP_EXPBIAS_##sfs) \
7768 - || _FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1) \
7769 + || (_FP_EXPBIAS_##dfs < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1 \
7770 + && _FP_EXPBIAS_##dfs != _FP_EXPBIAS_##sfs)) \
7773 _FP_FRAC_COPY_##dwc##_##swc(D, S); \
7774 @@ -1168,6 +1169,14 @@
7776 if (_FP_FRAC_ZEROP_##swc(S)) \
7778 + else if (_FP_EXPBIAS_##dfs \
7779 + < _FP_EXPBIAS_##sfs + _FP_FRACBITS_##sfs - 1) \
7781 + FP_SET_EXCEPTION(FP_EX_DENORM); \
7782 + _FP_FRAC_SLL_##dwc(D, (_FP_FRACBITS_##dfs \
7783 + - _FP_FRACBITS_##sfs)); \
7789 @@ -1199,7 +1208,8 @@
7790 #define FP_TRUNC(dfs,sfs,dwc,swc,D,S) \
7792 if (_FP_FRACBITS_##sfs < _FP_FRACBITS_##dfs \
7793 - || _FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1) \
7794 + || (_FP_EXPBIAS_##sfs < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1 \
7795 + && _FP_EXPBIAS_##sfs != _FP_EXPBIAS_##dfs)) \
7798 if (_FP_EXP_NORMAL(sfs, swc, S)) \
7799 @@ -1211,8 +1221,11 @@
7803 - if (D##_e <= 1 - _FP_FRACBITS_##dfs) \
7804 - _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \
7805 + if (D##_e < 1 - _FP_FRACBITS_##dfs) \
7807 + _FP_FRAC_SET_##swc(S, _FP_ZEROFRAC_##swc); \
7808 + _FP_FRAC_LOW_##swc(S) |= 1; \
7812 _FP_FRAC_HIGH_##sfs(S) |= _FP_IMPLBIT_SH_##sfs; \
7813 @@ -1234,11 +1247,24 @@
7817 - _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
7818 - if (!_FP_FRAC_ZEROP_##swc(S)) \
7819 + if (_FP_FRAC_ZEROP_##swc(S)) \
7820 + _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
7823 FP_SET_EXCEPTION(FP_EX_DENORM); \
7824 - FP_SET_EXCEPTION(FP_EX_INEXACT); \
7825 + if (_FP_EXPBIAS_##sfs \
7826 + < _FP_EXPBIAS_##dfs + _FP_FRACBITS_##dfs - 1) \
7828 + _FP_FRAC_SRS_##swc(S, (_FP_WFRACBITS_##sfs \
7829 + - _FP_WFRACBITS_##dfs), \
7830 + _FP_WFRACBITS_##sfs); \
7831 + _FP_FRAC_COPY_##dwc##_##swc(D, S); \
7835 + _FP_FRAC_SET_##dwc(D, _FP_ZEROFRAC_##dwc); \
7836 + _FP_FRAC_LOW_##dwc(D) |= 1; \
7841 Index: gcc/config/soft-fp/floatundisf.c
7842 ===================================================================
7843 --- gcc/config/soft-fp/floatundisf.c (.../tags/gcc_4_2_0_release) (wersja 125589)
7844 +++ gcc/config/soft-fp/floatundisf.c (.../branches/gcc-4_2-branch) (wersja 125589)
7846 /* Software floating-point emulation.
7847 Convert a 64bit unsigned integer to IEEE single
7848 - Copyright (C) 1997,1999, 2006 Free Software Foundation, Inc.
7849 + Copyright (C) 1997, 1999, 2006, 2007 Free Software Foundation, Inc.
7850 This file is part of the GNU C Library.
7851 Contributed by Richard Henderson (rth@cygnus.com) and
7852 Jakub Jelinek (jj@ultra.linux.cz).
7854 #include "soft-fp.h"
7858 -__floatundisf(UDItype i)
7859 +SFtype __floatundisf(UDItype i)
7863 Index: gcc/config/soft-fp/op-2.h
7864 ===================================================================
7865 --- gcc/config/soft-fp/op-2.h (.../tags/gcc_4_2_0_release) (wersja 125589)
7866 +++ gcc/config/soft-fp/op-2.h (.../branches/gcc-4_2-branch) (wersja 125589)
7868 /* Software floating-point emulation.
7869 Basic two-word fraction declaration and manipulation.
7870 - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
7871 + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
7872 This file is part of the GNU C Library.
7873 Contributed by Richard Henderson (rth@cygnus.com),
7874 Jakub Jelinek (jj@ultra.linux.cz),
7876 #define _FP_FRAC_COPY_1_2(D, S) (D##_f = S##_f0)
7878 #define _FP_FRAC_COPY_2_1(D, S) ((D##_f0 = S##_f), (D##_f1 = 0))
7880 +#define _FP_FRAC_COPY_2_2(D,S) _FP_FRAC_COPY_2(D,S)
7881 Index: gcc/config/soft-fp/op-4.h
7882 ===================================================================
7883 --- gcc/config/soft-fp/op-4.h (.../tags/gcc_4_2_0_release) (wersja 125589)
7884 +++ gcc/config/soft-fp/op-4.h (.../branches/gcc-4_2-branch) (wersja 125589)
7886 /* Software floating-point emulation.
7887 Basic four-word fraction declaration and manipulation.
7888 - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
7889 + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
7890 This file is part of the GNU C Library.
7891 Contributed by Richard Henderson (rth@cygnus.com),
7892 Jakub Jelinek (jj@ultra.linux.cz),
7894 D##_f[1] = S##_f1; \
7895 D##_f[2] = D##_f[3] = 0; \
7898 +#define _FP_FRAC_COPY_4_4(D,S) _FP_FRAC_COPY_4(D,S)
7899 Index: gcc/config/soft-fp/double.h
7900 ===================================================================
7901 --- gcc/config/soft-fp/double.h (.../tags/gcc_4_2_0_release) (wersja 125589)
7902 +++ gcc/config/soft-fp/double.h (.../branches/gcc-4_2-branch) (wersja 125589)
7904 /* Software floating-point emulation.
7905 Definitions for IEEE Double Precision
7906 - Copyright (C) 1997,1998,1999,2006 Free Software Foundation, Inc.
7907 + Copyright (C) 1997,1998,1999,2006,2007 Free Software Foundation, Inc.
7908 This file is part of the GNU C Library.
7909 Contributed by Richard Henderson (rth@cygnus.com),
7910 Jakub Jelinek (jj@ultra.linux.cz),
7911 @@ -168,13 +168,13 @@
7914 #if __BYTE_ORDER == __BIG_ENDIAN
7915 - unsigned sign : 1;
7916 - unsigned exp : _FP_EXPBITS_D;
7917 - unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
7918 + unsigned sign : 1;
7919 + unsigned exp : _FP_EXPBITS_D;
7920 + _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
7922 - unsigned long frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
7923 - unsigned exp : _FP_EXPBITS_D;
7924 - unsigned sign : 1;
7925 + _FP_W_TYPE frac : _FP_FRACBITS_D - (_FP_IMPLBIT_D != 0);
7926 + unsigned exp : _FP_EXPBITS_D;
7927 + unsigned sign : 1;
7929 } bits __attribute__((packed));
7931 Index: libstdc++-v3/configure
7932 ===================================================================
7933 --- libstdc++-v3/configure (.../tags/gcc_4_2_0_release) (wersja 125589)
7934 +++ libstdc++-v3/configure (.../branches/gcc-4_2-branch) (wersja 125589)
7935 @@ -5764,8 +5764,6 @@
7939 - echo "$as_me:$LINENO: checking for C locale to use" >&5
7940 -echo $ECHO_N "checking for C locale to use... $ECHO_C" >&6
7941 # Check whether --enable-clocale or --disable-clocale was given.
7942 if test "${enable_clocale+set}" = set; then
7943 enableval="$enable_clocale"
7944 @@ -5782,32 +5780,53 @@
7948 - # If they didn't use this option switch, or if they specified --enable
7949 - # with no specific model, we'll have to look for one. If they
7950 - # specified --disable (???), do likewise.
7951 + # Deal with gettext issues. Default to not using it (=no) until we detect
7952 + # support for it later. Let the user turn it off via --e/d, but let that
7953 + # default to on for easier handling.
7955 + # Check whether --enable-nls or --disable-nls was given.
7956 +if test "${enable_nls+set}" = set; then
7957 + enableval="$enable_nls"
7963 + # Either a known packaage, or "auto"
7964 if test $enable_clocale = no || test $enable_clocale = yes; then
7968 - # Either a known package, or "auto"
7969 enable_clocale_flag=$enable_clocale
7971 - # Probe for locale support if no specific model is specified.
7972 + # Probe for locale model to use if none specified.
7973 # Default to "generic".
7974 if test $enable_clocale_flag = auto; then
7975 case ${target_os} in
7976 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
7977 - cat >conftest.$ac_ext <<_ACEOF
7978 + enable_clocale_flag=gnu
7980 + darwin* | freebsd*)
7981 + enable_clocale_flag=darwin
7984 + enable_clocale_flag=generic
7989 + # Sanity check model, and test for special functionality.
7990 + if test $enable_clocale_flag = gnu; then
7991 + cat >conftest.$ac_ext <<_ACEOF
7994 cat confdefs.h >>conftest.$ac_ext
7995 cat >>conftest.$ac_ext <<_ACEOF
7996 /* end confdefs.h. */
7998 - #include <features.h>
7999 - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
8002 + #include <features.h>
8003 + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
8008 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8009 @@ -5819,9 +5838,8 @@
8013 - # Test for bugs early in glibc-2.2.x series
8014 - if test $enable_clocale_flag = gnu; then
8015 - if test "$cross_compiling" = yes; then
8016 + # Test for bugs early in glibc-2.2.x series
8017 + if test "$cross_compiling" = yes; then
8018 enable_clocale_flag=generic
8020 cat >conftest.$ac_ext <<_ACEOF
8021 @@ -5831,28 +5849,28 @@
8022 cat >>conftest.$ac_ext <<_ACEOF
8023 /* end confdefs.h. */
8025 - #define _GNU_SOURCE 1
8026 - #include <locale.h>
8027 - #include <string.h>
8028 - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
8029 - extern __typeof(newlocale) __newlocale;
8030 - extern __typeof(duplocale) __duplocale;
8031 - extern __typeof(strcoll_l) __strcoll_l;
8035 - const char __one[] = "Äuglein Augmen";
8036 - const char __two[] = "Äuglein";
8040 - __locale_t loc_dup;
8041 - loc = __newlocale(1 << LC_ALL, "de_DE", 0);
8042 - loc_dup = __duplocale(loc);
8043 - i = __strcoll_l(__one, __two, loc);
8044 - j = __strcoll_l(__one, __two, loc_dup);
8047 + #define _GNU_SOURCE 1
8048 + #include <locale.h>
8049 + #include <string.h>
8050 + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
8051 + extern __typeof(newlocale) __newlocale;
8052 + extern __typeof(duplocale) __duplocale;
8053 + extern __typeof(strcoll_l) __strcoll_l;
8057 + const char __one[] = "Äuglein Augmen";
8058 + const char __two[] = "Äuglein";
8062 + __locale_t loc_dup;
8063 + loc = __newlocale(1 << LC_ALL, "de_DE", 0);
8064 + loc_dup = __duplocale(loc);
8065 + i = __strcoll_l(__one, __two, loc);
8066 + j = __strcoll_l(__one, __two, loc_dup);
8071 rm -f conftest$ac_exeext
8072 @@ -5877,32 +5895,176 @@
8074 rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8078 - # ... at some point put __strxfrm_l tests in as well.
8080 - darwin* | freebsd*)
8081 - enable_clocale_flag=darwin
8084 - enable_clocale_flag=generic
8087 + # Set it to scream when it hurts.
8088 + ac_save_CFLAGS="$CFLAGS"
8089 + CFLAGS="-Wimplicit-function-declaration -Werror"
8091 + # Use strxfrm_l if available.
8092 + cat >conftest.$ac_ext <<_ACEOF
8095 +cat confdefs.h >>conftest.$ac_ext
8096 +cat >>conftest.$ac_ext <<_ACEOF
8097 +/* end confdefs.h. */
8098 +#define _GNU_SOURCE 1
8099 + #include <string.h>
8100 + #include <locale.h>
8104 +char s[128]; __locale_t loc; strxfrm_l(s, "C", 5, loc);
8109 +rm -f conftest.$ac_objext
8110 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
8111 + (eval $ac_compile) 2>conftest.er1
8113 + grep -v '^ *+' conftest.er1 >conftest.err
8114 + rm -f conftest.er1
8115 + cat conftest.err >&5
8116 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8117 + (exit $ac_status); } &&
8118 + { ac_try='test -z "$ac_c_werror_flag"
8119 + || test ! -s conftest.err'
8120 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8121 + (eval $ac_try) 2>&5
8123 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8124 + (exit $ac_status); }; } &&
8125 + { ac_try='test -s conftest.$ac_objext'
8126 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8127 + (eval $ac_try) 2>&5
8129 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8130 + (exit $ac_status); }; }; then
8132 +cat >>confdefs.h <<\_ACEOF
8133 +#define HAVE_STRXFRM_L 1
8137 + echo "$as_me: failed program was:" >&5
8138 +sed 's/^/| /' conftest.$ac_ext >&5
8141 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
8143 + # Use strerror_l if available.
8144 + cat >conftest.$ac_ext <<_ACEOF
8147 +cat confdefs.h >>conftest.$ac_ext
8148 +cat >>conftest.$ac_ext <<_ACEOF
8149 +/* end confdefs.h. */
8150 +#define _GNU_SOURCE 1
8151 + #include <string.h>
8152 + #include <locale.h>
8156 +__locale_t loc; strerror_l(5, loc);
8161 +rm -f conftest.$ac_objext
8162 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
8163 + (eval $ac_compile) 2>conftest.er1
8165 + grep -v '^ *+' conftest.er1 >conftest.err
8166 + rm -f conftest.er1
8167 + cat conftest.err >&5
8168 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8169 + (exit $ac_status); } &&
8170 + { ac_try='test -z "$ac_c_werror_flag"
8171 + || test ! -s conftest.err'
8172 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8173 + (eval $ac_try) 2>&5
8175 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8176 + (exit $ac_status); }; } &&
8177 + { ac_try='test -s conftest.$ac_objext'
8178 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8179 + (eval $ac_try) 2>&5
8181 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8182 + (exit $ac_status); }; }; then
8184 +cat >>confdefs.h <<\_ACEOF
8185 +#define HAVE_STRERROR_L 1
8189 + echo "$as_me: failed program was:" >&5
8190 +sed 's/^/| /' conftest.$ac_ext >&5
8193 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
8195 + CFLAGS="$ac_save_CFLAGS"
8198 - # Deal with gettext issues. Default to not using it (=no) until we detect
8199 - # support for it later. Let the user turn it off via --e/d, but let that
8200 - # default to on for easier handling.
8202 - # Check whether --enable-nls or --disable-nls was given.
8203 -if test "${enable_nls+set}" = set; then
8204 - enableval="$enable_nls"
8205 + # Perhaps use strerror_r if available, and strerror_l isn't.
8206 + ac_save_CFLAGS="$CFLAGS"
8207 + CFLAGS="-Wimplicit-function-declaration -Werror"
8208 + cat >conftest.$ac_ext <<_ACEOF
8211 +cat confdefs.h >>conftest.$ac_ext
8212 +cat >>conftest.$ac_ext <<_ACEOF
8213 +/* end confdefs.h. */
8214 +#define _GNU_SOURCE 1
8215 + #include <string.h>
8216 + #include <locale.h>
8220 +char s[128]; strerror_r(5, s, 128);
8225 +rm -f conftest.$ac_objext
8226 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
8227 + (eval $ac_compile) 2>conftest.er1
8229 + grep -v '^ *+' conftest.er1 >conftest.err
8230 + rm -f conftest.er1
8231 + cat conftest.err >&5
8232 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8233 + (exit $ac_status); } &&
8234 + { ac_try='test -z "$ac_c_werror_flag"
8235 + || test ! -s conftest.err'
8236 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8237 + (eval $ac_try) 2>&5
8239 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8240 + (exit $ac_status); }; } &&
8241 + { ac_try='test -s conftest.$ac_objext'
8242 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8243 + (eval $ac_try) 2>&5
8245 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
8246 + (exit $ac_status); }; }; then
8248 +cat >>confdefs.h <<\_ACEOF
8249 +#define HAVE_STRERROR_R 1
8255 + echo "$as_me: failed program was:" >&5
8256 +sed 's/^/| /' conftest.$ac_ext >&5
8259 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
8260 + CFLAGS="$ac_save_CFLAGS"
8262 # Set configure bits for specified locale package
8263 + echo "$as_me:$LINENO: checking for C locale to use" >&5
8264 +echo $ECHO_N "checking for C locale to use... $ECHO_C" >&6
8265 case ${enable_clocale_flag} in
8267 echo "$as_me:$LINENO: result: generic" >&5
8268 @@ -8015,7 +8177,7 @@
8270 # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
8271 cat > conftest.$ac_ext << EOF
8272 -#line 8018 "configure"
8273 +#line 8180 "configure"
8276 // NB: _Atomic_word not necessarily int.
8277 @@ -8395,11 +8557,9 @@
8278 # NB: This flag only works reliably after 2.16.1. Configure tests
8279 # for this are difficult, so hard wire a value that should work.
8281 - # All these tests are for C++, but run with the "C" compiler driver.
8282 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8283 ac_test_CFLAGS="${CFLAGS+set}"
8284 ac_save_CFLAGS="$CFLAGS"
8285 - CFLAGS='-x c++ -Wl,--gc-sections'
8286 + CFLAGS='-Wl,--gc-sections'
8288 # Check for -Wl,--gc-sections
8289 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8290 @@ -54307,11 +54467,9 @@
8291 # NB: This flag only works reliably after 2.16.1. Configure tests
8292 # for this are difficult, so hard wire a value that should work.
8294 - # All these tests are for C++, but run with the "C" compiler driver.
8295 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8296 ac_test_CFLAGS="${CFLAGS+set}"
8297 ac_save_CFLAGS="$CFLAGS"
8298 - CFLAGS='-x c++ -Wl,--gc-sections'
8299 + CFLAGS='-Wl,--gc-sections'
8301 # Check for -Wl,--gc-sections
8302 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8303 @@ -75669,11 +75827,9 @@
8304 # NB: This flag only works reliably after 2.16.1. Configure tests
8305 # for this are difficult, so hard wire a value that should work.
8307 - # All these tests are for C++, but run with the "C" compiler driver.
8308 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8309 ac_test_CFLAGS="${CFLAGS+set}"
8310 ac_save_CFLAGS="$CFLAGS"
8311 - CFLAGS='-x c++ -Wl,--gc-sections'
8312 + CFLAGS='-Wl,--gc-sections'
8314 # Check for -Wl,--gc-sections
8315 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8316 @@ -77194,11 +77350,9 @@
8317 # NB: This flag only works reliably after 2.16.1. Configure tests
8318 # for this are difficult, so hard wire a value that should work.
8320 - # All these tests are for C++, but run with the "C" compiler driver.
8321 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8322 ac_test_CFLAGS="${CFLAGS+set}"
8323 ac_save_CFLAGS="$CFLAGS"
8324 - CFLAGS='-x c++ -Wl,--gc-sections'
8325 + CFLAGS='-Wl,--gc-sections'
8327 # Check for -Wl,--gc-sections
8328 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8329 @@ -78687,11 +78841,9 @@
8330 # NB: This flag only works reliably after 2.16.1. Configure tests
8331 # for this are difficult, so hard wire a value that should work.
8333 - # All these tests are for C++, but run with the "C" compiler driver.
8334 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8335 ac_test_CFLAGS="${CFLAGS+set}"
8336 ac_save_CFLAGS="$CFLAGS"
8337 - CFLAGS='-x c++ -Wl,--gc-sections'
8338 + CFLAGS='-Wl,--gc-sections'
8340 # Check for -Wl,--gc-sections
8341 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8342 @@ -100579,11 +100731,9 @@
8343 # NB: This flag only works reliably after 2.16.1. Configure tests
8344 # for this are difficult, so hard wire a value that should work.
8346 - # All these tests are for C++, but run with the "C" compiler driver.
8347 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8348 ac_test_CFLAGS="${CFLAGS+set}"
8349 ac_save_CFLAGS="$CFLAGS"
8350 - CFLAGS='-x c++ -Wl,--gc-sections'
8351 + CFLAGS='-Wl,--gc-sections'
8353 # Check for -Wl,--gc-sections
8354 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8355 @@ -101426,11 +101576,9 @@
8356 # NB: This flag only works reliably after 2.16.1. Configure tests
8357 # for this are difficult, so hard wire a value that should work.
8359 - # All these tests are for C++, but run with the "C" compiler driver.
8360 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8361 ac_test_CFLAGS="${CFLAGS+set}"
8362 ac_save_CFLAGS="$CFLAGS"
8363 - CFLAGS='-x c++ -Wl,--gc-sections'
8364 + CFLAGS='-Wl,--gc-sections'
8366 # Check for -Wl,--gc-sections
8367 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8368 @@ -102829,11 +102977,9 @@
8369 # NB: This flag only works reliably after 2.16.1. Configure tests
8370 # for this are difficult, so hard wire a value that should work.
8372 - # All these tests are for C++, but run with the "C" compiler driver.
8373 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8374 ac_test_CFLAGS="${CFLAGS+set}"
8375 ac_save_CFLAGS="$CFLAGS"
8376 - CFLAGS='-x c++ -Wl,--gc-sections'
8377 + CFLAGS='-Wl,--gc-sections'
8379 # Check for -Wl,--gc-sections
8380 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8381 @@ -104624,11 +104770,9 @@
8382 # NB: This flag only works reliably after 2.16.1. Configure tests
8383 # for this are difficult, so hard wire a value that should work.
8385 - # All these tests are for C++, but run with the "C" compiler driver.
8386 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8387 ac_test_CFLAGS="${CFLAGS+set}"
8388 ac_save_CFLAGS="$CFLAGS"
8389 - CFLAGS='-x c++ -Wl,--gc-sections'
8390 + CFLAGS='-Wl,--gc-sections'
8392 # Check for -Wl,--gc-sections
8393 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8394 @@ -105869,11 +106013,9 @@
8395 # NB: This flag only works reliably after 2.16.1. Configure tests
8396 # for this are difficult, so hard wire a value that should work.
8398 - # All these tests are for C++, but run with the "C" compiler driver.
8399 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8400 ac_test_CFLAGS="${CFLAGS+set}"
8401 ac_save_CFLAGS="$CFLAGS"
8402 - CFLAGS='-x c++ -Wl,--gc-sections'
8403 + CFLAGS='-Wl,--gc-sections'
8405 # Check for -Wl,--gc-sections
8406 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8407 @@ -106898,11 +107040,9 @@
8408 # NB: This flag only works reliably after 2.16.1. Configure tests
8409 # for this are difficult, so hard wire a value that should work.
8411 - # All these tests are for C++, but run with the "C" compiler driver.
8412 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8413 ac_test_CFLAGS="${CFLAGS+set}"
8414 ac_save_CFLAGS="$CFLAGS"
8415 - CFLAGS='-x c++ -Wl,--gc-sections'
8416 + CFLAGS='-Wl,--gc-sections'
8418 # Check for -Wl,--gc-sections
8419 echo "$as_me:$LINENO: checking for ld that supports -Wl,--gc-sections" >&5
8420 Index: libstdc++-v3/include/bits/ostream.tcc
8421 ===================================================================
8422 --- libstdc++-v3/include/bits/ostream.tcc (.../tags/gcc_4_2_0_release) (wersja 125589)
8423 +++ libstdc++-v3/include/bits/ostream.tcc (.../branches/gcc-4_2-branch) (wersja 125589)
8425 extern template ostream& operator<<(ostream&, const char*);
8426 extern template ostream& operator<<(ostream&, const unsigned char*);
8427 extern template ostream& operator<<(ostream&, const signed char*);
8428 - extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
8430 extern template ostream& ostream::_M_insert(long);
8431 extern template ostream& ostream::_M_insert(unsigned long);
8433 extern template wostream& operator<<(wostream&, char);
8434 extern template wostream& operator<<(wostream&, const wchar_t*);
8435 extern template wostream& operator<<(wostream&, const char*);
8436 - extern template wostream& __ostream_insert(wostream&, const wchar_t*,
8439 extern template wostream& wostream::_M_insert(long);
8440 extern template wostream& wostream::_M_insert(unsigned long);
8441 Index: libstdc++-v3/include/bits/ostream_insert.h
8442 ===================================================================
8443 --- libstdc++-v3/include/bits/ostream_insert.h (.../tags/gcc_4_2_0_release) (wersja 125589)
8444 +++ libstdc++-v3/include/bits/ostream_insert.h (.../branches/gcc-4_2-branch) (wersja 125589)
8445 @@ -109,6 +109,18 @@
8449 + // Inhibit implicit instantiations for required instantiations,
8450 + // which are defined via explicit instantiations elsewhere.
8451 + // NB: This syntax is a GNU extension.
8452 +#if _GLIBCXX_EXTERN_TEMPLATE
8453 + extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
8455 +#ifdef _GLIBCXX_USE_WCHAR_T
8456 + extern template wostream& __ostream_insert(wostream&, const wchar_t*,
8461 _GLIBCXX_END_NAMESPACE
8463 #endif /* _OSTREAM_INSERT_H */
8464 Index: libstdc++-v3/include/std/std_fstream.h
8465 ===================================================================
8466 --- libstdc++-v3/include/std/std_fstream.h (.../tags/gcc_4_2_0_release) (wersja 125589)
8467 +++ libstdc++-v3/include/std/std_fstream.h (.../branches/gcc-4_2-branch) (wersja 125589)
8469 // File based streams -*- C++ -*-
8471 -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
8472 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
8474 // Free Software Foundation, Inc.
8476 // This file is part of the GNU ISO C++ Library. This library is free
8477 @@ -257,9 +258,30 @@
8478 * Otherwise it tries to open the file named @a s using the flags
8481 - * [Table 92 gives the relation between openmode combinations and the
8482 - * equivalent fopen() flags, but the table has not been copied yet.]
8484 + * Table 92, adapted here, gives the relation between openmode
8485 + * combinations and the equivalent fopen() flags.
8486 + * (NB: lines in|out|app and binary|in|out|app per DR 596)
8487 + * +---------------------------------------------------------+
8488 + * | ios_base Flag combination stdio equivalent |
8489 + * |binary in out trunc app |
8490 + * +---------------------------------------------------------+
8498 + * +---------------------------------------------------------+
8504 + * | + + + + "w+b" |
8505 + * | + + + + "a+b" |
8506 + * +---------------------------------------------------------+
8509 open(const char* __s, ios_base::openmode __mode);
8511 Index: libstdc++-v3/ChangeLog
8512 ===================================================================
8513 --- libstdc++-v3/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
8514 +++ libstdc++-v3/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
8516 +2007-06-08 Paolo Carlini <pcarlini@suse.de>
8518 + * docs/html/install.html: Adjust consistently with libstdc++/31717.
8520 +2007-06-08 Francesco Palagi <palagi@arcetri.astro.it>
8522 + * include/std/std_fstream.h: Add Table 92 in comment.
8524 +2007-06-06 Benjamin Kosnik <bkoz@redhat.com>
8525 + Frank Mori Hess <frank.hess@nist.gov>
8527 + * docs/html/debug.html: Correct link.
8529 +2007-05-28 Benjamin Kosnik <bkoz@redhat.com>
8531 + PR libstdc++/31717
8532 + * acinclude.m4 (GLIBCXX_ENABLE_CLOCALE): Re-organize. Sanity check
8533 + gnu locale model requests to make sure it will work for the requested
8534 + target. Add checks for strxfrm_l, strerror_l when in gnu locale,
8535 + and strerror_r everywhere.
8536 + * aclocal.m4: Regenerated.
8537 + * configure: Regenerated.
8538 + * config.h.in: Regenerated.
8540 +2007-05-24 Paolo Carlini <pcarlini@suse.de>
8542 + * include/bits/ostream.tcc: Do not inhibit implicit instantiation
8543 + of __ostream_insert here...
8544 + * include/bits/ostream_insert.h: ... do it here.
8546 +2007-05-21 Paolo Carlini <pcarlini@suse.de>
8548 + PR libstdc++/31621
8549 + * acinclude.m4 ([GLIBCXX_CHECK_LINKER_FEATURES]): Use the C compiler.
8550 + * configure: Regenerate.
8552 2007-05-13 Release Manager
8554 * GCC 4.2.0 released.
8555 Index: libstdc++-v3/docs/html/debug.html
8556 ===================================================================
8557 --- libstdc++-v3/docs/html/debug.html (.../tags/gcc_4_2_0_release) (wersja 125589)
8558 +++ libstdc++-v3/docs/html/debug.html (.../branches/gcc-4_2-branch) (wersja 125589)
8562 <h3 class="left"><a name="verbterm">Tracking uncaught exceptions</a></h3>
8563 -<p>The <a href="19_diagnostics/howto.html#4">verbose termination handler</a>
8564 +<p>The <a href="18_support/howto.html#4">verbose termination handler</a>
8565 gives information about uncaught exceptions which are killing the
8566 program. It is described in the linked-to page.
8568 Index: libstdc++-v3/docs/html/install.html
8569 ===================================================================
8570 --- libstdc++-v3/docs/html/install.html (.../tags/gcc_4_2_0_release) (wersja 125589)
8571 +++ libstdc++-v3/docs/html/install.html (.../branches/gcc-4_2-branch) (wersja 125589)
8573 information must be installed.
8576 - The configure option --enable-clocale can be used force a
8577 - particular behavior.
8578 + Note that those sanity checks are also perfomed when an explicit
8579 + --enable-clocale=gnu configure option is used: this behavior is
8580 + new in gcc 4.2.1 and defends against misconfigurations.
8584 Index: libstdc++-v3/config.h.in
8585 ===================================================================
8586 --- libstdc++-v3/config.h.in (.../tags/gcc_4_2_0_release) (wersja 125589)
8587 +++ libstdc++-v3/config.h.in (.../branches/gcc-4_2-branch) (wersja 125589)
8588 @@ -298,6 +298,12 @@
8589 /* Define to 1 if you have the <stdlib.h> header file. */
8590 #undef HAVE_STDLIB_H
8592 +/* Define if strerror_l is available in <string.h>. */
8593 +#undef HAVE_STRERROR_L
8595 +/* Define if strerror_r is available in <string.h>. */
8596 +#undef HAVE_STRERROR_R
8598 /* Define to 1 if you have the <strings.h> header file. */
8599 #undef HAVE_STRINGS_H
8602 /* Define to 1 if you have the `strtold' function. */
8605 +/* Define if strxfrm_l is available in <string.h>. */
8606 +#undef HAVE_STRXFRM_L
8608 /* Define to 1 if you have the <sys/filio.h> header file. */
8609 #undef HAVE_SYS_FILIO_H
8611 Index: libstdc++-v3/acinclude.m4
8612 ===================================================================
8613 --- libstdc++-v3/acinclude.m4 (.../tags/gcc_4_2_0_release) (wersja 125589)
8614 +++ libstdc++-v3/acinclude.m4 (.../branches/gcc-4_2-branch) (wersja 125589)
8615 @@ -251,11 +251,9 @@
8616 # NB: This flag only works reliably after 2.16.1. Configure tests
8617 # for this are difficult, so hard wire a value that should work.
8619 - # All these tests are for C++, but run with the "C" compiler driver.
8620 - # Need to do this so that g++ won't try to link in libstdc++/libsupc++.
8621 ac_test_CFLAGS="${CFLAGS+set}"
8622 ac_save_CFLAGS="$CFLAGS"
8623 - CFLAGS='-x c++ -Wl,--gc-sections'
8624 + CFLAGS='-Wl,--gc-sections'
8626 # Check for -Wl,--gc-sections
8627 AC_MSG_CHECKING([for ld that supports -Wl,--gc-sections])
8628 @@ -1334,64 +1332,31 @@
8629 dnl Default is generic.
8631 AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
8632 - AC_MSG_CHECKING([for C locale to use])
8633 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
8634 [use MODEL for target locale package],
8635 [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
8637 + # Deal with gettext issues. Default to not using it (=no) until we detect
8638 + # support for it later. Let the user turn it off via --e/d, but let that
8639 + # default to on for easier handling.
8641 + AC_ARG_ENABLE(nls,
8642 + AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
8646 - # If they didn't use this option switch, or if they specified --enable
8647 - # with no specific model, we'll have to look for one. If they
8648 - # specified --disable (???), do likewise.
8649 + # Either a known packaage, or "auto"
8650 if test $enable_clocale = no || test $enable_clocale = yes; then
8654 - # Either a known package, or "auto"
8655 enable_clocale_flag=$enable_clocale
8657 - # Probe for locale support if no specific model is specified.
8658 + # Probe for locale model to use if none specified.
8659 # Default to "generic".
8660 if test $enable_clocale_flag = auto; then
8661 case ${target_os} in
8662 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
8663 - AC_EGREP_CPP([_GLIBCXX_ok], [
8664 - #include <features.h>
8665 - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
8668 - ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
8670 - # Test for bugs early in glibc-2.2.x series
8671 - if test $enable_clocale_flag = gnu; then
8673 - #define _GNU_SOURCE 1
8674 - #include <locale.h>
8675 - #include <string.h>
8676 - #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
8677 - extern __typeof(newlocale) __newlocale;
8678 - extern __typeof(duplocale) __duplocale;
8679 - extern __typeof(strcoll_l) __strcoll_l;
8683 - const char __one[] = "Äuglein Augmen";
8684 - const char __two[] = "Äuglein";
8688 - __locale_t loc_dup;
8689 - loc = __newlocale(1 << LC_ALL, "de_DE", 0);
8690 - loc_dup = __duplocale(loc);
8691 - i = __strcoll_l(__one, __two, loc);
8692 - j = __strcoll_l(__one, __two, loc_dup);
8696 - [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
8697 - [enable_clocale_flag=generic])
8700 - # ... at some point put __strxfrm_l tests in as well.
8701 + enable_clocale_flag=gnu
8704 enable_clocale_flag=darwin
8705 @@ -1402,16 +1367,79 @@
8709 - # Deal with gettext issues. Default to not using it (=no) until we detect
8710 - # support for it later. Let the user turn it off via --e/d, but let that
8711 - # default to on for easier handling.
8713 - AC_ARG_ENABLE(nls,
8714 - AC_HELP_STRING([--enable-nls],[use Native Language Support (default)]),
8717 + # Sanity check model, and test for special functionality.
8718 + if test $enable_clocale_flag = gnu; then
8719 + AC_EGREP_CPP([_GLIBCXX_ok], [
8720 + #include <features.h>
8721 + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
8724 + ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
8726 + # Test for bugs early in glibc-2.2.x series
8728 + #define _GNU_SOURCE 1
8729 + #include <locale.h>
8730 + #include <string.h>
8731 + #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
8732 + extern __typeof(newlocale) __newlocale;
8733 + extern __typeof(duplocale) __duplocale;
8734 + extern __typeof(strcoll_l) __strcoll_l;
8738 + const char __one[] = "Äuglein Augmen";
8739 + const char __two[] = "Äuglein";
8743 + __locale_t loc_dup;
8744 + loc = __newlocale(1 << LC_ALL, "de_DE", 0);
8745 + loc_dup = __duplocale(loc);
8746 + i = __strcoll_l(__one, __two, loc);
8747 + j = __strcoll_l(__one, __two, loc_dup);
8751 + [enable_clocale_flag=gnu],[enable_clocale_flag=generic],
8752 + [enable_clocale_flag=generic])
8754 + # Set it to scream when it hurts.
8755 + ac_save_CFLAGS="$CFLAGS"
8756 + CFLAGS="-Wimplicit-function-declaration -Werror"
8758 + # Use strxfrm_l if available.
8759 + AC_TRY_COMPILE([#define _GNU_SOURCE 1
8760 + #include <string.h>
8761 + #include <locale.h>],
8762 + [char s[128]; __locale_t loc; strxfrm_l(s, "C", 5, loc);],
8763 + AC_DEFINE(HAVE_STRXFRM_L, 1,
8764 + [Define if strxfrm_l is available in <string.h>.]),)
8766 + # Use strerror_l if available.
8767 + AC_TRY_COMPILE([#define _GNU_SOURCE 1
8768 + #include <string.h>
8769 + #include <locale.h>],
8770 + [__locale_t loc; strerror_l(5, loc);],
8771 + AC_DEFINE(HAVE_STRERROR_L, 1,
8772 + [Define if strerror_l is available in <string.h>.]),)
8774 + CFLAGS="$ac_save_CFLAGS"
8777 + # Perhaps use strerror_r if available, and strerror_l isn't.
8778 + ac_save_CFLAGS="$CFLAGS"
8779 + CFLAGS="-Wimplicit-function-declaration -Werror"
8780 + AC_TRY_COMPILE([#define _GNU_SOURCE 1
8781 + #include <string.h>
8782 + #include <locale.h>],
8783 + [char s[128]; strerror_r(5, s, 128);],
8784 + AC_DEFINE(HAVE_STRERROR_R, 1,
8785 + [Define if strerror_r is available in <string.h>.]),)
8786 + CFLAGS="$ac_save_CFLAGS"
8788 # Set configure bits for specified locale package
8789 + AC_MSG_CHECKING([for C locale to use])
8790 case ${enable_clocale_flag} in
8792 AC_MSG_RESULT(generic)
8793 Index: libgfortran/runtime/environ.c
8794 ===================================================================
8795 --- libgfortran/runtime/environ.c (.../tags/gcc_4_2_0_release) (wersja 125589)
8796 +++ libgfortran/runtime/environ.c (.../branches/gcc-4_2-branch) (wersja 125589)
8797 @@ -861,14 +861,13 @@
8812 /* Parse the string. First, let's look for a default. */
8821 @@ -939,6 +939,18 @@
8822 tok = next_token ();
8826 + if (next_token () != ':')
8828 + endian = CONVERT_NATIVE;
8832 + if (next_token () != ':')
8834 + endian = CONVERT_SWAP;
8838 if (next_token () != ':')
8840 Index: libgfortran/intrinsics/reshape_generic.c
8841 ===================================================================
8842 --- libgfortran/intrinsics/reshape_generic.c (.../tags/gcc_4_2_0_release) (wersja 125589)
8843 +++ libgfortran/intrinsics/reshape_generic.c (.../branches/gcc-4_2-branch) (wersja 125589)
8848 - sptr += sstride[n] * size;
8849 + src += sstride[n] * size;
8853 Index: libgfortran/intrinsics/ishftc.c
8854 ===================================================================
8855 --- libgfortran/intrinsics/ishftc.c (.../tags/gcc_4_2_0_release) (wersja 125589)
8856 +++ libgfortran/intrinsics/ishftc.c (.../branches/gcc-4_2-branch) (wersja 125589)
8859 ishftc4 (GFC_INTEGER_4 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
8861 - GFC_INTEGER_4 mask;
8862 - GFC_UINTEGER_4 bits;
8863 + GFC_UINTEGER_4 mask, bits;
8866 shift = shift + size;
8868 if (shift == 0 || shift == size)
8871 - mask = (~(GFC_INTEGER_4)0) << size;
8873 - return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask);
8874 + /* In C, the result of the shift operator is undefined if the right operand
8875 + is greater than or equal to the number of bits in the left operand. So we
8876 + have to special case it for fortran. */
8877 + mask = ~((size == 32) ? 0 : (~0 << size));
8881 + return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
8884 extern GFC_INTEGER_8 ishftc8 (GFC_INTEGER_8, GFC_INTEGER_4, GFC_INTEGER_4);
8887 ishftc8 (GFC_INTEGER_8 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
8889 - GFC_INTEGER_8 mask;
8890 - GFC_UINTEGER_8 bits;
8891 + GFC_UINTEGER_8 mask, bits;
8894 shift = shift + size;
8896 if (shift == 0 || shift == size)
8899 - mask = (~(GFC_INTEGER_8)0) << size;
8901 - return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask);
8902 + /* In C, the result of the shift operator is undefined if the right operand
8903 + is greater than or equal to the number of bits in the left operand. So we
8904 + have to special case it for fortran. */
8905 + mask = ~((size == 64) ? 0 : (~0 << size));
8909 + return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
8912 #ifdef HAVE_GFC_INTEGER_16
8915 ishftc16 (GFC_INTEGER_16 i, GFC_INTEGER_4 shift, GFC_INTEGER_4 size)
8917 - GFC_INTEGER_16 mask;
8918 - GFC_UINTEGER_16 bits;
8919 + GFC_UINTEGER_16 mask, bits;
8922 shift = shift + size;
8924 if (shift == 0 || shift == size)
8927 - mask = (~(GFC_INTEGER_16)0) << size;
8929 - return (i & mask) | (bits >> (size - shift)) | ((i << shift) & ~mask);
8930 + /* In C, the result of the shift operator is undefined if the right operand
8931 + is greater than or equal to the number of bits in the left operand. So we
8932 + have to special case it for fortran. */
8933 + mask = ~((size == 128) ? 0 : (~0 << size));
8937 + return (i & ~mask) | ((bits << shift) & mask) | (bits >> (size - shift));
8940 Index: libgfortran/ChangeLog
8941 ===================================================================
8942 --- libgfortran/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
8943 +++ libgfortran/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
8945 +2007-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
8947 + PR libfortran/31964
8948 + Backport from trunk.
8949 + * intrinsics/ishftc.c (ishftc4, ishftc8, ishftc16): Fix mask to handle
8950 + shift of bit-size number of bits.
8952 +2007-05-23 Tobias Burnus <burnus@net-b.de>
8955 + Backport from trunk.
8956 + * runtime/environ.c (mark_range): Fix setting default convert unit.
8958 +2007-05-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
8960 + PR libfortran/31051
8961 + Backport from trunk.
8962 + * io/transfer.c (formatted_transfer_scalar): Adjust position for pending
8963 + spaces when in writing mode. Clean up some formatting.
8965 +2007-05-22 Tobias Burnus <burnus@net-b.de>
8967 + PR libfortran/31915
8968 + Backport from trunk.
8969 + * io/transfer.c (unformatted_read): Use proper size for real(10).
8970 + (unformatted_write): Ditto.
8972 +2007-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
8974 + PR libfortran/31395
8975 + Backport from 4.3.
8976 + * io/format.c (parse_format_list): Fix parsing. Regression against g77.
8978 +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org>
8981 + Backport from trunk.
8982 + * io/transfer.c (read_block_direct): Instead of calling us_read,
8983 + set dtp->u.p.current_unit->current_record = 0 so that pre_position
8984 + will read the record marker.
8985 + (data_transfer_init): For different error conditions, call
8986 + generate_error, then return.
8988 +2007-05-20 Thomas Koenig <tkoenig@gcc.gnu.org>
8990 + PR libfortran/31196
8991 + Backport from trunk.
8992 + * intrinsics/reshape_generic.c (reshape_internal): Increment
8995 2007-05-13 Release Manager
8997 * GCC 4.2.0 released.
8998 Index: libgfortran/io/transfer.c
8999 ===================================================================
9000 --- libgfortran/io/transfer.c (.../tags/gcc_4_2_0_release) (wersja 125589)
9001 +++ libgfortran/io/transfer.c (.../branches/gcc-4_2-branch) (wersja 125589)
9002 @@ -493,11 +493,11 @@
9006 - /* Let's make sure the file position is correctly set for the
9007 - next read statement. */
9008 + /* Let's make sure the file position is correctly pre-positioned
9009 + for the next read statement. */
9011 + dtp->u.p.current_unit->current_record = 0;
9012 next_record_r_unf (dtp, 0);
9014 generate_error (&dtp->common, ERROR_SHORT_RECORD, NULL);
9017 @@ -722,7 +722,11 @@
9018 of the padding. If we hit a short record, then sz is
9019 adjusted accordingly, making later reads no-ops. */
9022 + if (type == BT_REAL || type == BT_COMPLEX)
9023 + sz = size_from_real_kind (kind);
9027 for (i=0; i<nelems; i++)
9029 read_block_direct (dtp, buffer, &sz);
9030 @@ -767,7 +771,11 @@
9031 read kind bytes. We don't care about the contents
9035 + if (type == BT_REAL || type == BT_COMPLEX)
9036 + sz = size_from_real_kind (kind);
9040 for (i=0; i<nelems; i++)
9042 reverse_memcpy(buffer, p, size);
9043 @@ -1144,7 +1152,7 @@
9044 /* Format codes that don't transfer data. */
9047 - consume_data_flag = 0 ;
9048 + consume_data_flag = 0;
9050 pos = bytes_used + f->u.n + dtp->u.p.skips;
9051 dtp->u.p.skips = f->u.n + dtp->u.p.skips;
9052 @@ -1160,6 +1168,7 @@
9053 write_x (dtp, dtp->u.p.skips, dtp->u.p.pending_spaces);
9054 dtp->u.p.skips = dtp->u.p.pending_spaces = 0;
9057 if (dtp->u.p.mode == READING)
9058 read_x (dtp, f->u.n);
9060 @@ -1167,6 +1176,8 @@
9064 + consume_data_flag = 0;
9066 if (f->format == FMT_TL)
9069 @@ -1185,8 +1196,10 @@
9073 - consume_data_flag = 0;
9075 + if (dtp->u.p.mode == READING)
9078 + pos = f->u.n - dtp->u.p.pending_spaces - 1;
9081 /* Standard 10.6.1.1: excessive left tabbing is reset to the
9082 @@ -1753,16 +1766,19 @@
9083 /* Check the action. */
9085 if (read_flag && dtp->u.p.current_unit->flags.action == ACTION_WRITE)
9086 - generate_error (&dtp->common, ERROR_BAD_ACTION,
9087 - "Cannot read from file opened for WRITE");
9089 + generate_error (&dtp->common, ERROR_BAD_ACTION,
9090 + "Cannot read from file opened for WRITE");
9094 if (!read_flag && dtp->u.p.current_unit->flags.action == ACTION_READ)
9095 - generate_error (&dtp->common, ERROR_BAD_ACTION,
9096 - "Cannot write to file opened for READ");
9098 + generate_error (&dtp->common, ERROR_BAD_ACTION,
9099 + "Cannot write to file opened for READ");
9103 - if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
9106 dtp->u.p.first_item = 1;
9108 /* Check the format. */
9109 @@ -1770,14 +1786,14 @@
9110 if ((cf & IOPARM_DT_HAS_FORMAT) != 0)
9113 - if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
9116 if (dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED
9117 && (cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT))
9119 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9120 - "Format present for UNFORMATTED data transfer");
9122 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9123 + "Format present for UNFORMATTED data transfer");
9127 if ((cf & IOPARM_DT_HAS_NAMELIST_NAME) != 0 && dtp->u.p.ionml != NULL)
9129 @@ -1787,13 +1803,19 @@
9131 else if (dtp->u.p.current_unit->flags.form == FORM_FORMATTED &&
9132 !(cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT)))
9133 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9134 - "Missing format for FORMATTED data transfer");
9136 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9137 + "Missing format for FORMATTED data transfer");
9140 if (is_internal_unit (dtp)
9141 && dtp->u.p.current_unit->flags.form == FORM_UNFORMATTED)
9142 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9143 - "Internal file cannot be accessed by UNFORMATTED data transfer");
9145 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9146 + "Internal file cannot be accessed by UNFORMATTED "
9151 /* Check the record or position number. */
9153 @@ -1823,49 +1845,71 @@
9154 if (dtp->u.p.advance_status != ADVANCE_UNSPECIFIED)
9156 if (dtp->u.p.current_unit->flags.access == ACCESS_DIRECT)
9157 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9158 - "ADVANCE specification conflicts with sequential access");
9160 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9161 + "ADVANCE specification conflicts with sequential access");
9165 if (is_internal_unit (dtp))
9166 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9167 - "ADVANCE specification conflicts with internal file");
9169 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9170 + "ADVANCE specification conflicts with internal file");
9174 if ((cf & (IOPARM_DT_HAS_FORMAT | IOPARM_DT_LIST_FORMAT))
9175 != IOPARM_DT_HAS_FORMAT)
9176 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9177 - "ADVANCE specification requires an explicit format");
9179 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9180 + "ADVANCE specification requires an explicit format");
9187 if ((cf & IOPARM_EOR) != 0 && dtp->u.p.advance_status != ADVANCE_NO)
9188 - generate_error (&dtp->common, ERROR_MISSING_OPTION,
9189 - "EOR specification requires an ADVANCE specification of NO");
9191 + generate_error (&dtp->common, ERROR_MISSING_OPTION,
9192 + "EOR specification requires an ADVANCE specification "
9197 if ((cf & IOPARM_DT_HAS_SIZE) != 0 && dtp->u.p.advance_status != ADVANCE_NO)
9198 - generate_error (&dtp->common, ERROR_MISSING_OPTION,
9199 - "SIZE specification requires an ADVANCE specification of NO");
9202 + generate_error (&dtp->common, ERROR_MISSING_OPTION,
9203 + "SIZE specification requires an ADVANCE specification of NO");
9208 { /* Write constraints. */
9209 if ((cf & IOPARM_END) != 0)
9210 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9211 - "END specification cannot appear in a write statement");
9213 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9214 + "END specification cannot appear in a write statement");
9218 if ((cf & IOPARM_EOR) != 0)
9219 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9220 - "EOR specification cannot appear in a write statement");
9222 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9223 + "EOR specification cannot appear in a write statement");
9227 if ((cf & IOPARM_DT_HAS_SIZE) != 0)
9228 - generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9229 - "SIZE specification cannot appear in a write statement");
9231 + generate_error (&dtp->common, ERROR_OPTION_CONFLICT,
9232 + "SIZE specification cannot appear in a write statement");
9237 if (dtp->u.p.advance_status == ADVANCE_UNSPECIFIED)
9238 dtp->u.p.advance_status = ADVANCE_YES;
9239 - if ((dtp->common.flags & IOPARM_LIBRETURN_MASK) != IOPARM_LIBRETURN_OK)
9242 /* Sanity checks on the record number. */
9243 if ((cf & IOPARM_DT_HAS_REC) != 0)
9244 Index: libgfortran/io/format.c
9245 ===================================================================
9246 --- libgfortran/io/format.c (.../tags/gcc_4_2_0_release) (wersja 125589)
9247 +++ libgfortran/io/format.c (.../branches/gcc-4_2-branch) (wersja 125589)
9248 @@ -860,10 +860,11 @@
9250 get_fnode (fmt, &head, &tail, FMT_SLASH);
9252 + goto optional_comma;
9254 - /* Fall Through */
9257 + get_fnode (fmt, &head, &tail, FMT_COLON);
9259 goto optional_comma;
9262 Index: boehm-gc/darwin_stop_world.c
9263 ===================================================================
9264 --- boehm-gc/darwin_stop_world.c (.../tags/gcc_4_2_0_release) (wersja 125589)
9265 +++ boehm-gc/darwin_stop_world.c (.../branches/gcc-4_2-branch) (wersja 125589)
9267 be allocated, is called the red zone. This area as shown in Figure 3-2 may
9268 be used for any purpose as long as a new stack frame does not need to be
9269 added to the stack."
9272 Page 50: "If a leaf procedure's red zone usage would exceed 224 bytes, then
9273 it must set up a stack frame just like routines that call other routines."
9276 # define PPC_RED_ZONE_SIZE 320
9279 -/* Try to work out the right way to access thread state structure members.
9280 - The structure has changed its definition in different Darwin versions. */
9281 -#if defined(__ppc__)
9282 -# define THREAD_STATE ppc_thread_state_t
9283 -# if defined (HAS_PPC_THREAD_STATE_R0)
9284 -# define THREAD_FLD(x) x
9285 -# elif defined (HAS_PPC_THREAD_STATE___R0)
9286 -# define THREAD_FLD(x) __ ## x
9288 -# error can not work out how to access fields of ppc_thread_state_t
9290 -#elif defined(__ppc64__)
9291 -# define THREAD_STATE ppc_thread_state64_t
9292 -# if defined (HAS_PPC_THREAD_STATE64_R0)
9293 -# define THREAD_FLD(x) x
9294 -# elif defined (HAS_PPC_THREAD_STATE64___R0)
9295 -# define THREAD_FLD(x) __ ## x
9297 -# error can not work out how to access fields of ppc_thread_state64_t
9299 -#elif defined(__i386__)
9300 -# define THREAD_STATE i386_thread_state_t
9301 -# if defined (HAS_I386_THREAD_STATE_EAX)
9302 -# define THREAD_FLD(x) x
9303 -# elif defined (HAS_I386_THREAD_STATE___EAX)
9304 -# define THREAD_FLD(x) __ ## x
9306 -# error can not work out how to access fields of i386_thread_state_t
9308 -#elif defined(__x86_64__)
9309 -# define THREAD_STATE i386_thread_state_t
9310 -# if defined (HAS_I386_THREAD_STATE_EAX)
9311 -# define THREAD_FLD(x) x
9312 -# elif defined (HAS_I386_THREAD_STATE___EAX)
9313 -# define THREAD_FLD(x) __ ## x
9315 -# error can not work out how to access fields of i386_thread_state_t
9318 -# error unknown architecture
9321 typedef struct StackFrame {
9322 unsigned long savedSP;
9323 unsigned long savedCR;
9328 - THREAD_STATE state;
9329 - mach_msg_type_number_t thread_state_count = MACHINE_THREAD_STATE_COUNT;
9330 + GC_THREAD_STATE_T state;
9331 + mach_msg_type_number_t thread_state_count = GC_MACH_THREAD_STATE_COUNT;
9333 me = pthread_self();
9334 if (!GC_thr_initialized) GC_thr_init();
9336 lo = GC_approx_sp();
9338 /* Get the thread state (registers, etc) */
9339 - r = thread_get_state(
9340 - p->stop_info.mach_thread,
9341 - MACHINE_THREAD_STATE,
9342 - (natural_t*)&state,
9343 - &thread_state_count);
9344 + r = thread_get_state(p->stop_info.mach_thread, GC_MACH_THREAD_STATE,
9345 + (natural_t*)&state, &thread_state_count);
9346 if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
9350 GC_push_one(state . THREAD_FLD (edx));
9351 GC_push_one(state . THREAD_FLD (edi));
9352 GC_push_one(state . THREAD_FLD (esi));
9353 - GC_push_one(state . THREAD_FLD (ebp));
9354 + GC_push_one(state . THREAD_FLD (ebp));
9356 +#elif defined(X86_64)
9357 + lo = (void*)state . THREAD_FLD (rsp);
9359 + GC_push_one(state . THREAD_FLD (rax));
9360 + GC_push_one(state . THREAD_FLD (rbx));
9361 + GC_push_one(state . THREAD_FLD (rcx));
9362 + GC_push_one(state . THREAD_FLD (rdx));
9363 + GC_push_one(state . THREAD_FLD (rdi));
9364 + GC_push_one(state . THREAD_FLD (rsi));
9365 + GC_push_one(state . THREAD_FLD (rbp));
9366 + GC_push_one(state . THREAD_FLD (rsp));
9367 + GC_push_one(state . THREAD_FLD (r8));
9368 + GC_push_one(state . THREAD_FLD (r9));
9369 + GC_push_one(state . THREAD_FLD (r10));
9370 + GC_push_one(state . THREAD_FLD (r11));
9371 + GC_push_one(state . THREAD_FLD (r12));
9372 + GC_push_one(state . THREAD_FLD (r13));
9373 + GC_push_one(state . THREAD_FLD (r14));
9374 + GC_push_one(state . THREAD_FLD (r15));
9375 + GC_push_one(state . THREAD_FLD (rip));
9376 + GC_push_one(state . THREAD_FLD (rflags));
9377 + GC_push_one(state . THREAD_FLD (cs));
9378 + GC_push_one(state . THREAD_FLD (fs));
9379 + GC_push_one(state . THREAD_FLD (gs));
9381 #elif defined(POWERPC)
9382 lo = (void*)(state . THREAD_FLD (r1) - PPC_RED_ZONE_SIZE);
9385 hi = (ptr_t)FindTopOfStack(0);
9387 # if defined(__ppc__) || defined(__ppc64__)
9388 - THREAD_STATE info;
9389 + GC_THREAD_STATE_T info;
9390 mach_msg_type_number_t outCount = THREAD_STATE_MAX;
9391 - r = thread_get_state(thread, MACHINE_THREAD_STATE,
9392 + r = thread_get_state(thread, GC_MACH_THREAD_STATE,
9393 (natural_t *)&info, &outCount);
9394 if(r != KERN_SUCCESS) ABORT("task_get_state failed");
9396 @@ -264,10 +245,10 @@
9398 /* FIXME: Remove after testing: */
9399 WARN("This is completely untested and likely will not work\n", 0);
9400 - THREAD_STATE info;
9401 + GC_THREAD_STATE_T info;
9402 mach_msg_type_number_t outCount = THREAD_STATE_MAX;
9403 - r = thread_get_state(thread, MACHINE_THREAD_STATE,
9404 - (natural_t *)&info, &outCount);
9405 + r = thread_get_state(thread, GC_MACH_THREAD_STATE, (natural_t *)&info,
9407 if(r != KERN_SUCCESS) ABORT("task_get_state failed");
9409 lo = (void*)info . THREAD_FLD (esp);
9410 Index: boehm-gc/Makefile.in
9411 ===================================================================
9412 --- boehm-gc/Makefile.in (.../tags/gcc_4_2_0_release) (wersja 125589)
9413 +++ boehm-gc/Makefile.in (.../branches/gcc-4_2-branch) (wersja 125589)
9415 build_vendor = @build_vendor@
9417 exec_prefix = @exec_prefix@
9418 +extra_ldflags_libgc = @extra_ldflags_libgc@
9420 host_alias = @host_alias@
9421 host_cpu = @host_cpu@
9423 # linuxthread semaphore functions get linked:
9424 libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS)
9425 libgcjgc_la_DEPENDENCIES = @addobjs@
9426 -libgcjgc_la_LDFLAGS = -version-info 1:2:0 -rpath $(toolexeclibdir)
9427 +libgcjgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 -rpath $(toolexeclibdir)
9428 libgcjgc_convenience_la_LIBADD = @addobjs@
9429 libgcjgc_convenience_la_DEPENDENCIES = @addobjs@
9430 AM_CXXFLAGS = @GC_CFLAGS@
9431 Index: boehm-gc/configure.ac
9432 ===================================================================
9433 --- boehm-gc/configure.ac (.../tags/gcc_4_2_0_release) (wersja 125589)
9434 +++ boehm-gc/configure.ac (.../branches/gcc-4_2-branch) (wersja 125589)
9435 @@ -248,33 +248,46 @@
9438 AC_CHECK_MEMBER(ppc_thread_state_t.r0,
9439 - AC_DEFINE(HAS_PPC_THREAD_STATE_R0,,[ppc_thread_state_t has field r0]),,
9440 + AC_DEFINE(HAS_PPC_THREAD_STATE_R0,1,
9441 + [ppc_thread_state_t has field r0]),,
9442 [#include <mach/thread_status.h>])
9443 AC_CHECK_MEMBER(ppc_thread_state_t.__r0,
9444 - AC_DEFINE(HAS_PPC_THREAD_STATE___R0,,dnl
9445 - [ppc_thread_state_t has field __r0]),,
9446 + AC_DEFINE(HAS_PPC_THREAD_STATE___R0,1,dnl
9447 + [ppc_thread_state_t has field __r0]),,
9448 [#include <mach/thread_status.h>])
9449 AC_CHECK_MEMBER(ppc_thread_state64_t.r0,
9450 - AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,,dnl
9451 - [ppc_thread_state64_t has field r0]),,
9452 + AC_DEFINE(HAS_PPC_THREAD_STATE64_R0,1,dnl
9453 + [ppc_thread_state64_t has field r0]),,
9454 [#include <mach/thread_status.h>])
9455 AC_CHECK_MEMBER(ppc_thread_state64_t.__r0,
9456 - AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,,dnl
9457 - [ppc_thread_state64_t has field __r0]),,
9458 + AC_DEFINE(HAS_PPC_THREAD_STATE64___R0,1,dnl
9459 + [ppc_thread_state64_t has field __r0]),,
9460 [#include <mach/thread_status.h>])
9463 - AC_CHECK_MEMBER(i386_thread_state_t.eax,
9464 - AC_DEFINE(HAS_I386_THREAD_STATE_EAX,,dnl
9465 - [i386_thread_state_t has field eax]),,
9466 + AC_CHECK_MEMBER(x86_thread_state32_t.eax,
9467 + AC_DEFINE(HAS_X86_THREAD_STATE32_EAX,1,dnl
9468 + [x86_thread_state32_t has field eax]),,
9469 [#include <sys/cdefs.h>
9470 -#include <mach/thread_status.h>])
9471 - AC_CHECK_MEMBER(i386_thread_state_t.__eax,
9472 - AC_DEFINE(HAS_I386_THREAD_STATE___EAX,,dnl
9473 - [i386_thread_state_t has field __eax]),,
9474 + #include <mach/thread_status.h>])
9475 + AC_CHECK_MEMBER(x86_thread_state32_t.__eax,
9476 + AC_DEFINE(HAS_X86_THREAD_STATE32___EAX,1,dnl
9477 + [x86_thread_state32_t has field __eax]),,
9478 [#include <sys/cdefs.h>
9479 -#include <mach/thread_status.h>])
9480 + #include <mach/thread_status.h>])
9483 + AC_CHECK_MEMBER(x86_thread_state64_t.rax,
9484 + AC_DEFINE(HAS_X86_THREAD_STATE64_RAX,1,dnl
9485 + [x86_thread_state64_t has field rax]),,
9486 + [#include <sys/cdefs.h>
9487 + #include <mach/thread_status.h>])
9488 + AC_CHECK_MEMBER(x86_thread_state64_t.__rax,
9489 + AC_DEFINE(HAS_X86_THREAD_STATE64___RAX,1,dnl
9490 + [x86_thread_state64_t has field __rax]),,
9491 + [#include <sys/cdefs.h>
9492 + #include <mach/thread_status.h>])
9497 @@ -287,6 +300,14 @@
9501 +# extra LD Flags which are required for targets
9504 + extra_ldflags_libgc=-Wl,-single_module
9507 +AC_SUBST(extra_ldflags_libgc)
9509 AC_SUBST(EXTRA_TEST_LIBS)
9511 target_all=libgcjgc.la
9512 Index: boehm-gc/include/Makefile.in
9513 ===================================================================
9514 --- boehm-gc/include/Makefile.in (.../tags/gcc_4_2_0_release) (wersja 125589)
9515 +++ boehm-gc/include/Makefile.in (.../branches/gcc-4_2-branch) (wersja 125589)
9517 build_vendor = @build_vendor@
9519 exec_prefix = @exec_prefix@
9520 +extra_ldflags_libgc = @extra_ldflags_libgc@
9522 host_alias = @host_alias@
9523 host_cpu = @host_cpu@
9524 Index: boehm-gc/include/gc_config.h.in
9525 ===================================================================
9526 --- boehm-gc/include/gc_config.h.in (.../tags/gcc_4_2_0_release) (wersja 125589)
9527 +++ boehm-gc/include/gc_config.h.in (.../branches/gcc-4_2-branch) (wersja 125589)
9529 /* support for win32 threads */
9530 #undef GC_WIN32_THREADS
9532 -/* i386_thread_state_t has field eax */
9533 -#undef HAS_I386_THREAD_STATE_EAX
9535 -/* i386_thread_state_t has field __eax */
9536 -#undef HAS_I386_THREAD_STATE___EAX
9538 /* ppc_thread_state64_t has field r0 */
9539 #undef HAS_PPC_THREAD_STATE64_R0
9542 /* ppc_thread_state_t has field __r0 */
9543 #undef HAS_PPC_THREAD_STATE___R0
9545 +/* x86_thread_state32_t has field eax */
9546 +#undef HAS_X86_THREAD_STATE32_EAX
9548 +/* x86_thread_state32_t has field __eax */
9549 +#undef HAS_X86_THREAD_STATE32___EAX
9551 +/* x86_thread_state64_t has field rax */
9552 +#undef HAS_X86_THREAD_STATE64_RAX
9554 +/* x86_thread_state64_t has field __rax */
9555 +#undef HAS_X86_THREAD_STATE64___RAX
9557 /* Define to 1 if you have the <inttypes.h> header file. */
9558 #undef HAVE_INTTYPES_H
9560 Index: boehm-gc/include/private/gc_priv.h
9561 ===================================================================
9562 --- boehm-gc/include/private/gc_priv.h (.../tags/gcc_4_2_0_release) (wersja 125589)
9563 +++ boehm-gc/include/private/gc_priv.h (.../branches/gcc-4_2-branch) (wersja 125589)
9564 @@ -286,6 +286,53 @@
9568 +#if defined(DARWIN)
9569 +# if defined(POWERPC)
9570 +# if CPP_WORDSZ == 32
9571 +# define GC_THREAD_STATE_T ppc_thread_state_t
9572 +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE
9573 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
9574 +# define GC_MACH_HEADER mach_header
9575 +# define GC_MACH_SECTION section
9577 +# define GC_THREAD_STATE_T ppc_thread_state64_t
9578 +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
9579 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
9580 +# define GC_MACH_HEADER mach_header_64
9581 +# define GC_MACH_SECTION section_64
9583 +# elif defined(I386) || defined(X86_64)
9584 +# if CPP_WORDSZ == 32
9585 +# define GC_THREAD_STATE_T x86_thread_state32_t
9586 +# define GC_MACH_THREAD_STATE x86_THREAD_STATE32
9587 +# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
9588 +# define GC_MACH_HEADER mach_header
9589 +# define GC_MACH_SECTION section
9591 +# define GC_THREAD_STATE_T x86_thread_state64_t
9592 +# define GC_MACH_THREAD_STATE x86_THREAD_STATE64
9593 +# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
9594 +# define GC_MACH_HEADER mach_header_64
9595 +# define GC_MACH_SECTION section_64
9598 +# error define GC_THREAD_STATE_T
9599 +# define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
9600 +# define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
9602 +/* Try to work out the right way to access thread state structure members.
9603 + The structure has changed its definition in different Darwin versions.
9604 + This now defaults to the (older) names without __, thus hopefully,
9605 + not breaking any existing Makefile.direct builds. */
9606 +# if defined (HAS_PPC_THREAD_STATE___R0) \
9607 + || defined (HAS_PPC_THREAD_STATE64___R0) \
9608 + || defined (HAS_X86_THREAD_STATE32___EAX) \
9609 + || defined (HAS_X86_THREAD_STATE64___RAX)
9610 +# define THREAD_FLD(x) __ ## x
9612 +# define THREAD_FLD(x) x
9615 /*********************************/
9617 /* OS interface routines */
9618 @@ -468,6 +515,53 @@
9619 # define GETENV(name) 0
9622 +#if defined(DARWIN)
9623 +# if defined(POWERPC)
9624 +# if CPP_WORDSZ == 32
9625 +# define GC_THREAD_STATE_T ppc_thread_state_t
9626 +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE
9627 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
9628 +# define GC_MACH_HEADER mach_header
9629 +# define GC_MACH_SECTION section
9631 +# define GC_THREAD_STATE_T ppc_thread_state64_t
9632 +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE64
9633 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT
9634 +# define GC_MACH_HEADER mach_header_64
9635 +# define GC_MACH_SECTION section_64
9637 +# elif defined(I386) || defined(X86_64)
9638 +# if CPP_WORDSZ == 32
9639 +# define GC_THREAD_STATE_T x86_thread_state32_t
9640 +# define GC_MACH_THREAD_STATE x86_THREAD_STATE32
9641 +# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE32_COUNT
9642 +# define GC_MACH_HEADER mach_header
9643 +# define GC_MACH_SECTION section
9645 +# define GC_THREAD_STATE_T x86_thread_state64_t
9646 +# define GC_MACH_THREAD_STATE x86_THREAD_STATE64
9647 +# define GC_MACH_THREAD_STATE_COUNT x86_THREAD_STATE64_COUNT
9648 +# define GC_MACH_HEADER mach_header_64
9649 +# define GC_MACH_SECTION section_64
9652 +# error define GC_THREAD_STATE_T
9653 +# define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE
9654 +# define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT
9656 +/* Try to work out the right way to access thread state structure members.
9657 + The structure has changed its definition in different Darwin versions.
9658 + This now defaults to the (older) names without __, thus hopefully,
9659 + not breaking any existing Makefile.direct builds. */
9660 +# if defined (HAS_PPC_THREAD_STATE___R0) \
9661 + || defined (HAS_PPC_THREAD_STATE64___R0) \
9662 + || defined (HAS_X86_THREAD_STATE32___EAX) \
9663 + || defined (HAS_X86_THREAD_STATE64___RAX)
9664 +# define THREAD_FLD(x) __ ## x
9666 +# define THREAD_FLD(x) x
9669 /*********************************/
9671 /* Word-size-dependent defines */
9672 Index: boehm-gc/include/private/gcconfig.h
9673 ===================================================================
9674 --- boehm-gc/include/private/gcconfig.h (.../tags/gcc_4_2_0_release) (wersja 125589)
9675 +++ boehm-gc/include/private/gcconfig.h (.../branches/gcc-4_2-branch) (wersja 125589)
9676 @@ -302,7 +302,10 @@
9677 # if defined(__ppc__) || defined(__ppc64__)
9679 # define mach_type_known
9680 -# elif defined(__i386__) || defined(__x86_64)
9681 +# elif defined(__x86_64__)
9683 +# define mach_type_known
9684 +# elif defined(__i386__)
9686 # define mach_type_known
9688 @@ -791,26 +794,29 @@
9689 # define DATAEND (_end)
9692 -# if defined(__ppc64__) || defined(__x86_64)
9693 +# define OS_TYPE "DARWIN"
9694 +# define DYNAMIC_LOADING
9695 +# if defined(__ppc64__)
9696 # define ALIGNMENT 8
9697 # define CPP_WORDSZ 64
9698 +# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
9699 +# define CACHE_LINE_SIZE 64
9701 +# define HBLKSIZE 4096
9704 # define ALIGNMENT 4
9705 +# define STACKBOTTOM ((ptr_t) 0xc0000000)
9707 -# define OS_TYPE "DARWIN"
9708 -# define DYNAMIC_LOADING
9709 /* XXX: see get_end(3), get_etext() and get_end() should not be used.
9710 - These aren't used when dyld support is enabled (it is by default) */
9711 + These aren't used when dyld support is enabled (it is by default) */
9712 # define DATASTART ((ptr_t) get_etext())
9713 # define DATAEND ((ptr_t) get_end())
9714 -# define STACKBOTTOM ((ptr_t) 0xc0000000)
9716 # define USE_MMAP_ANON
9717 # define USE_ASM_PUSH_REGS
9718 - /* This is potentially buggy. It needs more testing. See the comments in
9719 - os_dep.c. It relies on threads to track writes. */
9720 # ifdef GC_DARWIN_THREADS
9721 -/* # define MPROTECT_VDB -- diabled for now. May work for some apps. */
9722 +# define MPROTECT_VDB
9724 # include <unistd.h>
9725 # define GETPAGESIZE() getpagesize()
9727 __asm__ __volatile__ ("dcbtst 0,%0" : : "r" ((const void *) (x)))
9729 /* There seems to be some issues with trylock hanging on darwin. This
9730 - should be looked into some more */
9731 + should be looked into some more */
9732 # define NO_PTHREAD_TRYLOCK
9735 @@ -1317,23 +1323,21 @@
9736 # define DARWIN_DONT_PARSE_STACK
9737 # define DYNAMIC_LOADING
9738 /* XXX: see get_end(3), get_etext() and get_end() should not be used.
9739 - These aren't used when dyld support is enabled (it is by default) */
9740 + These aren't used when dyld support is enabled (it is by default) */
9741 # define DATASTART ((ptr_t) get_etext())
9742 # define DATAEND ((ptr_t) get_end())
9743 # define STACKBOTTOM ((ptr_t) 0xc0000000)
9745 # define USE_MMAP_ANON
9746 # define USE_ASM_PUSH_REGS
9747 - /* This is potentially buggy. It needs more testing. See the comments in
9748 - os_dep.c. It relies on threads to track writes. */
9749 # ifdef GC_DARWIN_THREADS
9750 -/* # define MPROTECT_VDB -- disabled for now. May work for some apps. */
9751 +# define MPROTECT_VDB
9753 # include <unistd.h>
9754 # define GETPAGESIZE() getpagesize()
9755 /* There seems to be some issues with trylock hanging on darwin. This
9756 - should be looked into some more */
9757 -# define NO_PTHREAD_TRYLOCK
9758 + should be looked into some more */
9759 +# define NO_PTHREAD_TRYLOCK
9760 # endif /* DARWIN */
9763 @@ -1986,6 +1990,26 @@
9764 # define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
9768 +# define OS_TYPE "DARWIN"
9769 +# define DARWIN_DONT_PARSE_STACK
9770 +# define DYNAMIC_LOADING
9771 + /* XXX: see get_end(3), get_etext() and get_end() should not be used.
9772 + These aren't used when dyld support is enabled (it is by default) */
9773 +# define DATASTART ((ptr_t) get_etext())
9774 +# define DATAEND ((ptr_t) get_end())
9775 +# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000)
9777 +# define USE_MMAP_ANON
9778 +# ifdef GC_DARWIN_THREADS
9779 +# define MPROTECT_VDB
9781 +# include <unistd.h>
9782 +# define GETPAGESIZE() getpagesize()
9783 + /* There seems to be some issues with trylock hanging on darwin. This
9784 + should be looked into some more */
9785 +# define NO_PTHREAD_TRYLOCK
9788 # define OS_TYPE "FREEBSD"
9789 # ifndef GC_FREEBSD_THREADS
9790 Index: boehm-gc/ChangeLog
9791 ===================================================================
9792 --- boehm-gc/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
9793 +++ boehm-gc/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
9795 +2007-05-22 Andreas Tobler <a.tobler@schweiz.org>
9797 + * Backport r124870 from main.
9799 + 2007-05-20 Andreas Tobler <a.tobler@schweiz.org>
9801 + * configure.ac: Introduce extra_ldflags_libgc. Use it for Darwin.
9802 + * configure: Regenerate.
9803 + * Makefile.am (libgc_la_LDFLAGS): Use extra_ldflags_libgc.
9804 + * Makefile.in: Regenerate.
9805 + * include/Makefile.in: Regenerate.
9806 + * include/private/gcconfig.h: Enable MPROTECT_VDB for all Darwin
9807 + targets. Remove comments. Prepare ppc64 support for Darwin.
9809 +2007-05-19 Andreas Tobler <a.tobler@schweiz.org>
9811 + * Backport r120684, 120801, 120853, 120874 and 120977 from main.
9813 + 2007-01-19 Andreas Tobler <a.tobler@schweiz.org>
9815 + * os_dep.c (defined(MPROTECT_VDB) && defined(DARWIN)): Moved recently
9816 + added defines to include/private/gc_priv.h
9817 + * darwin_stop_world.c: Removed the above defines.
9818 + (catch_exception_raise): Added THREAD_FLD in exc_state for POWERPC too.
9819 + * include/private/gc_priv.h: Moved definitions from darwin_stop_world.c
9820 + and os_dep.c to here. Fixed THREAD definition fixes for ppc64.
9822 + 2007-01-17 Mike Stump <mrs@apple.com>
9824 + * os_dep.c: Fix i686-apple-darwin9 builds.
9826 + 2007-01-17 Andreas Tobler <a.tobler@schweiz.org>
9828 + * include/gc_config.h.in: Regenerate.
9830 + 2007-01-15 Andreas Tobler <a.tobler@schweiz.org>
9832 + * os_dep.c (defined(MPROTECT_VDB) && defined(DARWIN)): Adjust mail
9834 + (catch_exception_raise): Fix typo in the I386 exc_state.
9836 + 2007-01-11 Andreas Tobler <a.tobler@schweiz.org>
9838 + * configure.ac: Replaced HAS_I386_THREAD_STATE_* with
9839 + HAS_X86_THREAD_STATE32_* and HAS_X86_THREAD_STATE64_* respectively.
9840 + * configure: Regenerated.
9841 + * include/private/gcconfig.h (DARWIN): Added X86_64 define for Darwin.
9842 + Added base definitions for the X86_64 Darwin port.
9843 + * include/private/gc_priv.h: Added definitions for Darwin MACH thread
9844 + operations. Moved existing THREAD_STATE info from darwin_stop_world.c.
9845 + * darwin_stop_world.c: Removed THREAD_STATE info. Added
9846 + HAS_X86_THREAD_STATE64___RAX. And replaced HAS_I386_THREAD_STATE___EAX
9847 + with HAS_X86_THREAD_STATE32___EAX.
9848 + (GC_push_all_stacks): Use GC_MACH_THREAD_STATE_COUNT. Add code for
9850 + * dyn_load.c (GC_dyld_name_for_hdr): Use GC_MACH_HEADER.
9851 + (GC_dyld_image_add): Use GC_MACH_HEADER and GC_MACH_SECTION.
9852 + Distinguish between getsectbynamefromheader_64 and
9853 + getsectbynamefromheader.
9854 + (GC_dyld_image_remove): Likewise.
9855 + * os_dep.c (GC_dirty_init): Use GC_MACH_THREAD_STATE.
9856 + (catch_exception_raise): Introduce exception information for I386 and
9857 + X86_64 Darwin. Add X86_64 for exc_state.faultvaddr.
9859 2007-05-13 Release Manager
9861 * GCC 4.2.0 released.
9862 Index: boehm-gc/configure
9863 ===================================================================
9864 --- boehm-gc/configure (.../tags/gcc_4_2_0_release) (wersja 125589)
9865 +++ boehm-gc/configure (.../branches/gcc-4_2-branch) (wersja 125589)
9867 # include <unistd.h>
9870 -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical mkinstalldirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CFLAGS CXXFLAGS CCAS CCASFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GC_CFLAGS LN_S LIBTOOL CXXCPP CPPFLAGS THREADLIBS POWERPC_DARWIN_TRUE POWERPC_DARWIN_FALSE EXTRA_TEST_LIBS target_all CPLUSPLUS_TRUE CPLUSPLUS_FALSE AM_CPPFLAGS addobjs addincludes addlibs addtests CPP EGREP MY_CFLAGS toolexecdir toolexeclibdir LIBOBJS LTLIBOBJS'
9871 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical mkinstalldirs INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CFLAGS CXXFLAGS CCAS CCASFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GC_CFLAGS LN_S LIBTOOL CXXCPP CPPFLAGS THREADLIBS POWERPC_DARWIN_TRUE POWERPC_DARWIN_FALSE extra_ldflags_libgc EXTRA_TEST_LIBS target_all CPLUSPLUS_TRUE CPLUSPLUS_FALSE AM_CPPFLAGS addobjs addincludes addlibs addtests CPP EGREP MY_CFLAGS toolexecdir toolexeclibdir LIBOBJS LTLIBOBJS'
9874 # Initialize some variables set by options.
9875 @@ -5741,7 +5741,7 @@
9876 if test $ac_cv_member_ppc_thread_state_t_r0 = yes; then
9878 cat >>confdefs.h <<\_ACEOF
9879 -#define HAS_PPC_THREAD_STATE_R0
9880 +#define HAS_PPC_THREAD_STATE_R0 1
9884 @@ -5852,7 +5852,7 @@
9885 if test $ac_cv_member_ppc_thread_state_t___r0 = yes; then
9887 cat >>confdefs.h <<\_ACEOF
9888 -#define HAS_PPC_THREAD_STATE___R0
9889 +#define HAS_PPC_THREAD_STATE___R0 1
9893 @@ -5963,7 +5963,7 @@
9894 if test $ac_cv_member_ppc_thread_state64_t_r0 = yes; then
9896 cat >>confdefs.h <<\_ACEOF
9897 -#define HAS_PPC_THREAD_STATE64_R0
9898 +#define HAS_PPC_THREAD_STATE64_R0 1
9902 @@ -6074,16 +6074,16 @@
9903 if test $ac_cv_member_ppc_thread_state64_t___r0 = yes; then
9905 cat >>confdefs.h <<\_ACEOF
9906 -#define HAS_PPC_THREAD_STATE64___R0
9907 +#define HAS_PPC_THREAD_STATE64___R0 1
9914 - echo "$as_me:$LINENO: checking for i386_thread_state_t.eax" >&5
9915 -echo $ECHO_N "checking for i386_thread_state_t.eax... $ECHO_C" >&6
9916 -if test "${ac_cv_member_i386_thread_state_t_eax+set}" = set; then
9917 + echo "$as_me:$LINENO: checking for x86_thread_state32_t.eax" >&5
9918 +echo $ECHO_N "checking for x86_thread_state32_t.eax... $ECHO_C" >&6
9919 +if test "${ac_cv_member_x86_thread_state32_t_eax+set}" = set; then
9920 echo $ECHO_N "(cached) $ECHO_C" >&6
9922 cat >conftest.$ac_ext <<_ACEOF
9923 @@ -6093,12 +6093,12 @@
9924 cat >>conftest.$ac_ext <<_ACEOF
9925 /* end confdefs.h. */
9926 #include <sys/cdefs.h>
9927 -#include <mach/thread_status.h>
9928 + #include <mach/thread_status.h>
9933 -static i386_thread_state_t ac_aggr;
9934 +static x86_thread_state32_t ac_aggr;
9938 @@ -6127,7 +6127,7 @@
9940 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9941 (exit $ac_status); }; }; then
9942 - ac_cv_member_i386_thread_state_t_eax=yes
9943 + ac_cv_member_x86_thread_state32_t_eax=yes
9945 echo "$as_me: failed program was:" >&5
9946 sed 's/^/| /' conftest.$ac_ext >&5
9947 @@ -6139,12 +6139,12 @@
9948 cat >>conftest.$ac_ext <<_ACEOF
9949 /* end confdefs.h. */
9950 #include <sys/cdefs.h>
9951 -#include <mach/thread_status.h>
9952 + #include <mach/thread_status.h>
9957 -static i386_thread_state_t ac_aggr;
9958 +static x86_thread_state32_t ac_aggr;
9959 if (sizeof ac_aggr.eax)
9962 @@ -6173,30 +6173,30 @@
9964 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9965 (exit $ac_status); }; }; then
9966 - ac_cv_member_i386_thread_state_t_eax=yes
9967 + ac_cv_member_x86_thread_state32_t_eax=yes
9969 echo "$as_me: failed program was:" >&5
9970 sed 's/^/| /' conftest.$ac_ext >&5
9972 -ac_cv_member_i386_thread_state_t_eax=no
9973 +ac_cv_member_x86_thread_state32_t_eax=no
9975 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9977 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9979 -echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t_eax" >&5
9980 -echo "${ECHO_T}$ac_cv_member_i386_thread_state_t_eax" >&6
9981 -if test $ac_cv_member_i386_thread_state_t_eax = yes; then
9982 +echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state32_t_eax" >&5
9983 +echo "${ECHO_T}$ac_cv_member_x86_thread_state32_t_eax" >&6
9984 +if test $ac_cv_member_x86_thread_state32_t_eax = yes; then
9986 cat >>confdefs.h <<\_ACEOF
9987 -#define HAS_I386_THREAD_STATE_EAX
9988 +#define HAS_X86_THREAD_STATE32_EAX 1
9993 - echo "$as_me:$LINENO: checking for i386_thread_state_t.__eax" >&5
9994 -echo $ECHO_N "checking for i386_thread_state_t.__eax... $ECHO_C" >&6
9995 -if test "${ac_cv_member_i386_thread_state_t___eax+set}" = set; then
9996 + echo "$as_me:$LINENO: checking for x86_thread_state32_t.__eax" >&5
9997 +echo $ECHO_N "checking for x86_thread_state32_t.__eax... $ECHO_C" >&6
9998 +if test "${ac_cv_member_x86_thread_state32_t___eax+set}" = set; then
9999 echo $ECHO_N "(cached) $ECHO_C" >&6
10001 cat >conftest.$ac_ext <<_ACEOF
10002 @@ -6206,12 +6206,12 @@
10003 cat >>conftest.$ac_ext <<_ACEOF
10004 /* end confdefs.h. */
10005 #include <sys/cdefs.h>
10006 -#include <mach/thread_status.h>
10007 + #include <mach/thread_status.h>
10012 -static i386_thread_state_t ac_aggr;
10013 +static x86_thread_state32_t ac_aggr;
10017 @@ -6240,7 +6240,7 @@
10019 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10020 (exit $ac_status); }; }; then
10021 - ac_cv_member_i386_thread_state_t___eax=yes
10022 + ac_cv_member_x86_thread_state32_t___eax=yes
10024 echo "$as_me: failed program was:" >&5
10025 sed 's/^/| /' conftest.$ac_ext >&5
10026 @@ -6252,12 +6252,12 @@
10027 cat >>conftest.$ac_ext <<_ACEOF
10028 /* end confdefs.h. */
10029 #include <sys/cdefs.h>
10030 -#include <mach/thread_status.h>
10031 + #include <mach/thread_status.h>
10036 -static i386_thread_state_t ac_aggr;
10037 +static x86_thread_state32_t ac_aggr;
10038 if (sizeof ac_aggr.__eax)
10041 @@ -6286,28 +6286,256 @@
10043 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10044 (exit $ac_status); }; }; then
10045 - ac_cv_member_i386_thread_state_t___eax=yes
10046 + ac_cv_member_x86_thread_state32_t___eax=yes
10048 echo "$as_me: failed program was:" >&5
10049 sed 's/^/| /' conftest.$ac_ext >&5
10051 -ac_cv_member_i386_thread_state_t___eax=no
10052 +ac_cv_member_x86_thread_state32_t___eax=no
10054 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10056 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10058 -echo "$as_me:$LINENO: result: $ac_cv_member_i386_thread_state_t___eax" >&5
10059 -echo "${ECHO_T}$ac_cv_member_i386_thread_state_t___eax" >&6
10060 -if test $ac_cv_member_i386_thread_state_t___eax = yes; then
10061 +echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state32_t___eax" >&5
10062 +echo "${ECHO_T}$ac_cv_member_x86_thread_state32_t___eax" >&6
10063 +if test $ac_cv_member_x86_thread_state32_t___eax = yes; then
10065 cat >>confdefs.h <<\_ACEOF
10066 -#define HAS_I386_THREAD_STATE___EAX
10067 +#define HAS_X86_THREAD_STATE32___EAX 1
10073 + x86_64-*-darwin*)
10074 + echo "$as_me:$LINENO: checking for x86_thread_state64_t.rax" >&5
10075 +echo $ECHO_N "checking for x86_thread_state64_t.rax... $ECHO_C" >&6
10076 +if test "${ac_cv_member_x86_thread_state64_t_rax+set}" = set; then
10077 + echo $ECHO_N "(cached) $ECHO_C" >&6
10079 + cat >conftest.$ac_ext <<_ACEOF
10082 +cat confdefs.h >>conftest.$ac_ext
10083 +cat >>conftest.$ac_ext <<_ACEOF
10084 +/* end confdefs.h. */
10085 +#include <sys/cdefs.h>
10086 + #include <mach/thread_status.h>
10091 +static x86_thread_state64_t ac_aggr;
10098 +rm -f conftest.$ac_objext
10099 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10100 + (eval $ac_compile) 2>conftest.er1
10102 + grep -v '^ *+' conftest.er1 >conftest.err
10103 + rm -f conftest.er1
10104 + cat conftest.err >&5
10105 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10106 + (exit $ac_status); } &&
10107 + { ac_try='test -z "$ac_c_werror_flag"
10108 + || test ! -s conftest.err'
10109 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10110 + (eval $ac_try) 2>&5
10112 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10113 + (exit $ac_status); }; } &&
10114 + { ac_try='test -s conftest.$ac_objext'
10115 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10116 + (eval $ac_try) 2>&5
10118 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10119 + (exit $ac_status); }; }; then
10120 + ac_cv_member_x86_thread_state64_t_rax=yes
10122 + echo "$as_me: failed program was:" >&5
10123 +sed 's/^/| /' conftest.$ac_ext >&5
10125 +cat >conftest.$ac_ext <<_ACEOF
10128 +cat confdefs.h >>conftest.$ac_ext
10129 +cat >>conftest.$ac_ext <<_ACEOF
10130 +/* end confdefs.h. */
10131 +#include <sys/cdefs.h>
10132 + #include <mach/thread_status.h>
10137 +static x86_thread_state64_t ac_aggr;
10138 +if (sizeof ac_aggr.rax)
10144 +rm -f conftest.$ac_objext
10145 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10146 + (eval $ac_compile) 2>conftest.er1
10148 + grep -v '^ *+' conftest.er1 >conftest.err
10149 + rm -f conftest.er1
10150 + cat conftest.err >&5
10151 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10152 + (exit $ac_status); } &&
10153 + { ac_try='test -z "$ac_c_werror_flag"
10154 + || test ! -s conftest.err'
10155 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10156 + (eval $ac_try) 2>&5
10158 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10159 + (exit $ac_status); }; } &&
10160 + { ac_try='test -s conftest.$ac_objext'
10161 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10162 + (eval $ac_try) 2>&5
10164 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10165 + (exit $ac_status); }; }; then
10166 + ac_cv_member_x86_thread_state64_t_rax=yes
10168 + echo "$as_me: failed program was:" >&5
10169 +sed 's/^/| /' conftest.$ac_ext >&5
10171 +ac_cv_member_x86_thread_state64_t_rax=no
10173 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10175 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10177 +echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state64_t_rax" >&5
10178 +echo "${ECHO_T}$ac_cv_member_x86_thread_state64_t_rax" >&6
10179 +if test $ac_cv_member_x86_thread_state64_t_rax = yes; then
10181 +cat >>confdefs.h <<\_ACEOF
10182 +#define HAS_X86_THREAD_STATE64_RAX 1
10187 + echo "$as_me:$LINENO: checking for x86_thread_state64_t.__rax" >&5
10188 +echo $ECHO_N "checking for x86_thread_state64_t.__rax... $ECHO_C" >&6
10189 +if test "${ac_cv_member_x86_thread_state64_t___rax+set}" = set; then
10190 + echo $ECHO_N "(cached) $ECHO_C" >&6
10192 + cat >conftest.$ac_ext <<_ACEOF
10195 +cat confdefs.h >>conftest.$ac_ext
10196 +cat >>conftest.$ac_ext <<_ACEOF
10197 +/* end confdefs.h. */
10198 +#include <sys/cdefs.h>
10199 + #include <mach/thread_status.h>
10204 +static x86_thread_state64_t ac_aggr;
10205 +if (ac_aggr.__rax)
10211 +rm -f conftest.$ac_objext
10212 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10213 + (eval $ac_compile) 2>conftest.er1
10215 + grep -v '^ *+' conftest.er1 >conftest.err
10216 + rm -f conftest.er1
10217 + cat conftest.err >&5
10218 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10219 + (exit $ac_status); } &&
10220 + { ac_try='test -z "$ac_c_werror_flag"
10221 + || test ! -s conftest.err'
10222 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10223 + (eval $ac_try) 2>&5
10225 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10226 + (exit $ac_status); }; } &&
10227 + { ac_try='test -s conftest.$ac_objext'
10228 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10229 + (eval $ac_try) 2>&5
10231 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10232 + (exit $ac_status); }; }; then
10233 + ac_cv_member_x86_thread_state64_t___rax=yes
10235 + echo "$as_me: failed program was:" >&5
10236 +sed 's/^/| /' conftest.$ac_ext >&5
10238 +cat >conftest.$ac_ext <<_ACEOF
10241 +cat confdefs.h >>conftest.$ac_ext
10242 +cat >>conftest.$ac_ext <<_ACEOF
10243 +/* end confdefs.h. */
10244 +#include <sys/cdefs.h>
10245 + #include <mach/thread_status.h>
10250 +static x86_thread_state64_t ac_aggr;
10251 +if (sizeof ac_aggr.__rax)
10257 +rm -f conftest.$ac_objext
10258 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10259 + (eval $ac_compile) 2>conftest.er1
10261 + grep -v '^ *+' conftest.er1 >conftest.err
10262 + rm -f conftest.er1
10263 + cat conftest.err >&5
10264 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10265 + (exit $ac_status); } &&
10266 + { ac_try='test -z "$ac_c_werror_flag"
10267 + || test ! -s conftest.err'
10268 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10269 + (eval $ac_try) 2>&5
10271 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10272 + (exit $ac_status); }; } &&
10273 + { ac_try='test -s conftest.$ac_objext'
10274 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10275 + (eval $ac_try) 2>&5
10277 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
10278 + (exit $ac_status); }; }; then
10279 + ac_cv_member_x86_thread_state64_t___rax=yes
10281 + echo "$as_me: failed program was:" >&5
10282 +sed 's/^/| /' conftest.$ac_ext >&5
10284 +ac_cv_member_x86_thread_state64_t___rax=no
10286 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10288 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10290 +echo "$as_me:$LINENO: result: $ac_cv_member_x86_thread_state64_t___rax" >&5
10291 +echo "${ECHO_T}$ac_cv_member_x86_thread_state64_t___rax" >&6
10292 +if test $ac_cv_member_x86_thread_state64_t___rax = yes; then
10294 +cat >>confdefs.h <<\_ACEOF
10295 +#define HAS_X86_THREAD_STATE64___RAX 1
10304 @@ -6392,8 +6620,16 @@
10308 +# extra LD Flags which are required for targets
10311 + extra_ldflags_libgc=-Wl,-single_module
10318 target_all=libgcjgc.la
10321 @@ -8246,6 +8482,7 @@
10322 s,@THREADLIBS@,$THREADLIBS,;t t
10323 s,@POWERPC_DARWIN_TRUE@,$POWERPC_DARWIN_TRUE,;t t
10324 s,@POWERPC_DARWIN_FALSE@,$POWERPC_DARWIN_FALSE,;t t
10325 +s,@extra_ldflags_libgc@,$extra_ldflags_libgc,;t t
10326 s,@EXTRA_TEST_LIBS@,$EXTRA_TEST_LIBS,;t t
10327 s,@target_all@,$target_all,;t t
10328 s,@CPLUSPLUS_TRUE@,$CPLUSPLUS_TRUE,;t t
10329 Index: boehm-gc/os_dep.c
10330 ===================================================================
10331 --- boehm-gc/os_dep.c (.../tags/gcc_4_2_0_release) (wersja 125589)
10332 +++ boehm-gc/os_dep.c (.../branches/gcc-4_2-branch) (wersja 125589)
10333 @@ -3371,7 +3371,7 @@
10334 1. Apple's mach/xnu documentation
10335 2. Timothy J. Wood's "Mach Exception Handlers 101" post to the
10336 omnigroup's macosx-dev list.
10337 - www.omnigroup.com/mailman/archive/macosx-dev/2000-June/002030.html
10338 + www.omnigroup.com/mailman/archive/macosx-dev/2000-June/014178.html
10339 3. macosx-nat.c from Apple's GDB source code.
10342 @@ -3683,7 +3683,7 @@
10344 GC_ports.exception,
10346 - MACHINE_THREAD_STATE
10347 + GC_MACH_THREAD_STATE
10349 if(r != KERN_SUCCESS) ABORT("task_set_exception_ports failed");
10351 @@ -3802,10 +3802,16 @@
10352 mach_msg_type_number_t exc_state_count = PPC_EXCEPTION_STATE64_COUNT;
10353 ppc_exception_state64_t exc_state;
10355 -# elif defined(I386)
10356 - thread_state_flavor_t flavor = i386_EXCEPTION_STATE;
10357 - mach_msg_type_number_t exc_state_count = i386_EXCEPTION_STATE_COUNT;
10358 - i386_exception_state_t exc_state;
10359 +# elif defined(I386) || defined(X86_64)
10360 +# if CPP_WORDSZ == 32
10361 + thread_state_flavor_t flavor = x86_EXCEPTION_STATE32;
10362 + mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE32_COUNT;
10363 + x86_exception_state32_t exc_state;
10365 + thread_state_flavor_t flavor = x86_EXCEPTION_STATE64;
10366 + mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE64_COUNT;
10367 + x86_exception_state64_t exc_state;
10370 # error FIXME for non-ppc darwin
10372 @@ -3838,9 +3844,9 @@
10374 /* This is the address that caused the fault */
10375 #if defined(POWERPC)
10376 - addr = (char*) exc_state.dar;
10377 -#elif defined (I386)
10378 - addr = (char*) exc_state.faultvaddr;
10379 + addr = (char*) exc_state. THREAD_FLD(dar);
10380 +#elif defined (I386) || defined (X86_64)
10381 + addr = (char*) exc_state. THREAD_FLD(faultvaddr);
10383 # error FIXME for non POWERPC/I386
10385 Index: boehm-gc/Makefile.am
10386 ===================================================================
10387 --- boehm-gc/Makefile.am (.../tags/gcc_4_2_0_release) (wersja 125589)
10388 +++ boehm-gc/Makefile.am (.../branches/gcc-4_2-branch) (wersja 125589)
10389 @@ -33,11 +33,13 @@
10390 rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
10391 sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
10393 +extra_ldflags_libgc = @extra_ldflags_libgc@
10395 # Include THREADLIBS here to ensure that the correct versions of
10396 # linuxthread semaphore functions get linked:
10397 libgcjgc_la_LIBADD = @addobjs@ $(THREADLIBS) $(UNWINDLIBS)
10398 libgcjgc_la_DEPENDENCIES = @addobjs@
10399 -libgcjgc_la_LDFLAGS = -version-info 1:2:0 -rpath $(toolexeclibdir)
10400 +libgcjgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 -rpath $(toolexeclibdir)
10402 libgcjgc_convenience_la_LIBADD = @addobjs@
10403 libgcjgc_convenience_la_DEPENDENCIES = @addobjs@
10404 Index: boehm-gc/dyn_load.c
10405 ===================================================================
10406 --- boehm-gc/dyn_load.c (.../tags/gcc_4_2_0_release) (wersja 125589)
10407 +++ boehm-gc/dyn_load.c (.../branches/gcc-4_2-branch) (wersja 125589)
10408 @@ -1152,7 +1152,7 @@
10411 #ifdef DARWIN_DEBUG
10412 -static const char *GC_dyld_name_for_hdr(struct mach_header *hdr) {
10413 +static const char *GC_dyld_name_for_hdr(const struct GC_MACH_HEADER *hdr) {
10415 c = _dyld_image_count();
10416 for(i=0;i<c;i++) if(_dyld_get_image_header(i) == hdr)
10417 @@ -1162,12 +1162,17 @@
10420 /* This should never be called by a thread holding the lock */
10421 -static void GC_dyld_image_add(struct mach_header* hdr, unsigned long slide) {
10422 +static void GC_dyld_image_add(const struct GC_MACH_HEADER *hdr, intptr_t slide)
10424 unsigned long start,end,i;
10425 - const struct section *sec;
10426 + const struct GC_MACH_SECTION *sec;
10427 if (GC_no_dls) return;
10428 for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
10429 - sec = getsectbynamefromheader(
10430 +# if defined (__LP64__)
10431 + sec = getsectbynamefromheader_64(
10433 + sec = getsectbynamefromheader(
10435 hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
10436 if(sec == NULL || sec->size == 0) continue;
10437 start = slide + sec->addr;
10438 @@ -1184,11 +1189,16 @@
10441 /* This should never be called by a thread holding the lock */
10442 -static void GC_dyld_image_remove(struct mach_header* hdr, unsigned long slide) {
10443 +static void GC_dyld_image_remove(const struct GC_MACH_HEADER *hdr,
10444 + intptr_t slide) {
10445 unsigned long start,end,i;
10446 - const struct section *sec;
10447 + const struct GC_MACH_SECTION *sec;
10448 for(i=0;i<sizeof(GC_dyld_sections)/sizeof(GC_dyld_sections[0]);i++) {
10449 - sec = getsectbynamefromheader(
10450 +# if defined (__LP64__)
10451 + sec = getsectbynamefromheader_64(
10453 + sec = getsectbynamefromheader(
10455 hdr,GC_dyld_sections[i].seg,GC_dyld_sections[i].sect);
10456 if(sec == NULL || sec->size == 0) continue;
10457 start = slide + sec->addr;
10458 Index: configure.in
10459 ===================================================================
10460 --- configure.in (.../tags/gcc_4_2_0_release) (wersja 125589)
10461 +++ configure.in (.../branches/gcc-4_2-branch) (wersja 125589)
10462 @@ -2419,7 +2419,13 @@
10463 # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
10464 CFLAGS="$CFLAGS -fkeep-inline-functions"
10465 AC_MSG_CHECKING([whether -fkeep-inline-functions is supported])
10466 - AC_TRY_COMPILE(,,
10468 +#if (__GNUC__ < 3) \
10469 + || (__GNUC__ == 3 && (__GNUC_MINOR__ < 3 \
10470 + || (__GNUC_MINOR__ == 3 && __GNUC_PATCHLEVEL__ < 1)))
10471 +#error http://gcc.gnu.org/PR29382
10474 [AC_MSG_RESULT([yes]); stage1_cflags="$stage1_cflags -fkeep-inline-functions"],
10475 [AC_MSG_RESULT([no])])
10478 ===================================================================
10479 --- ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
10480 +++ ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
10482 +2007-05-30 Jakub Jelinek <jakub@redhat.com>
10484 + PR bootstrap/29382
10485 + * configure.in: Don't use -fkeep-inline-functions for GCC < 3.3.1.
10486 + * configure: Rebuilt.
10488 2007-05-13 Release Manager
10490 * GCC 4.2.0 released.
10491 Index: libjava/java/lang/natClassLoader.cc
10492 ===================================================================
10493 --- libjava/java/lang/natClassLoader.cc (.../tags/gcc_4_2_0_release) (wersja 125589)
10494 +++ libjava/java/lang/natClassLoader.cc (.../branches/gcc-4_2-branch) (wersja 125589)
10495 @@ -235,6 +235,15 @@
10497 new_class->engine = &_Jv_soleIndirectCompiledEngine;
10499 + /* FIXME: Way back before the dawn of time, we overloaded the
10500 + SYNTHETIC class access modifier to mean INTERPRETED. This was a
10501 + Bad Thing, but it didn't matter then because classes were never
10502 + marked synthetic. However, it is possible to redeem the
10503 + situation: _Jv_NewClassFromInitializer is only called from
10504 + compiled classes, so we clear the INTERPRETED flag. This is a
10506 + new_class->accflags &= ~java::lang::reflect::Modifier::INTERPRETED;
10508 if (_Jv_CheckABIVersion ((unsigned long) new_class->next_or_version))
10509 (*_Jv_RegisterClassHook) (new_class);
10511 Index: libjava/ChangeLog
10512 ===================================================================
10513 --- libjava/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
10514 +++ libjava/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
10516 +2007-05-31 Andrew Haley <aph@redhat.com>
10518 + * java/lang/natClassLoader.cc (_Jv_NewClassFromInitializer): Clear
10519 + INTERPRETED access modifier.
10521 2007-05-13 Release Manager
10523 * GCC 4.2.0 released.
10524 Index: maintainer-scripts/ChangeLog
10525 ===================================================================
10526 --- maintainer-scripts/ChangeLog (.../tags/gcc_4_2_0_release) (wersja 125589)
10527 +++ maintainer-scripts/ChangeLog (.../branches/gcc-4_2-branch) (wersja 125589)
10529 +2007-05-28 Mark Mitchell <mark@codesourcery.com>
10531 + * gcc_release: Adjust placement of release candidates.
10533 2007-05-13 Release Manager
10535 * GCC 4.2.0 released.
10536 Index: maintainer-scripts/gcc_release
10537 ===================================================================
10538 --- maintainer-scripts/gcc_release (.../tags/gcc_4_2_0_release) (wersja 125589)
10539 +++ maintainer-scripts/gcc_release (.../branches/gcc-4_2-branch) (wersja 125589)
10540 @@ -699,10 +699,10 @@
10541 # and minor release numbers.
10542 SVNBRANCH="branches/gcc-${RELEASE_MAJOR}_${RELEASE_MINOR}-branch"
10544 - # If this is not a final release, set various parameters acordingly.
10545 + # If this is not a final release, set various parameters accordingly.
10546 if [ ${FINAL} -ne 1 ]; then
10547 - RELEASE="${RELEASE}-${DATE}"
10548 - FTP_PATH="${FTP_PATH}/prerelease-${RELEASE}/"
10549 + RELEASE="${RELEASE}-RC-${DATE}"
10550 + FTP_PATH="${SNAPSHOTS_DIR}/${RELEASE}"
10552 FTP_PATH="${FTP_PATH}/releases/gcc-${RELEASE}/"