]> git.pld-linux.org Git - packages/gcc.git/blob - gcc-branch.diff
- rel 3; branch diff updated
[packages/gcc.git] / gcc-branch.diff
1 Index: libgomp/configure.tgt
2 ===================================================================
3 --- libgomp/configure.tgt       (.../tags/gcc_4_5_2_release)    (wersja 169176)
4 +++ libgomp/configure.tgt       (.../branches/gcc-4_5-branch)   (wersja 169176)
5 @@ -125,6 +125,10 @@
6         config_path="bsd posix"
7         ;;
8  
9 +  mips-sgi-irix6*)
10 +       # Need to link with -lpthread so libgomp.so is self-contained.
11 +       XLDFLAGS="${XLDFLAGS} -lpthread"
12 +       ;;
13    *)
14         ;;
15  
16 Index: libgomp/ChangeLog
17 ===================================================================
18 --- libgomp/ChangeLog   (.../tags/gcc_4_5_2_release)    (wersja 169176)
19 +++ libgomp/ChangeLog   (.../branches/gcc-4_5-branch)   (wersja 169176)
20 @@ -1,3 +1,18 @@
21 +2011-01-16  Jakub Jelinek  <jakub@redhat.com>
22 +
23 +       Backport from mainline
24 +       2010-12-14  Jakub Jelinek  <jakub@redhat.com>
25 +
26 +       PR fortran/46874
27 +       * libgomp.fortran/allocatable6.f90: New test.
28 +
29 +2010-12-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
30 +
31 +       Backport from mainline:
32 +       2010-12-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
33 +
34 +       * configure.tgt (mips-sgi-irix6*): Add -lpthread to XLDFLAGS.
35 +
36  2010-12-16  Release Manager
37  
38         * GCC 4.5.2 released.
39 Index: libgomp/testsuite/libgomp.fortran/allocatable6.f90
40 ===================================================================
41 --- libgomp/testsuite/libgomp.fortran/allocatable6.f90  (.../tags/gcc_4_5_2_release)    (wersja 0)
42 +++ libgomp/testsuite/libgomp.fortran/allocatable6.f90  (.../branches/gcc-4_5-branch)   (wersja 169176)
43 @@ -0,0 +1,45 @@
44 +! PR fortran/46874
45 +! { dg-do run }
46 +
47 +  interface
48 +    subroutine sub (a, b, c, d, n)
49 +      integer :: n
50 +      integer, allocatable :: a(:), b(:), c(:), d(:)
51 +    end subroutine
52 +  end interface
53 +
54 +  integer, allocatable :: a(:), b(:), c(:), d(:)
55 +  integer :: i, j
56 +  allocate (a(50), b(50), c(50), d(50))
57 +  do i = 1, 50
58 +    a(i) = 2 + modulo (i, 7)
59 +    b(i) = 179 - modulo (i, 11)
60 +  end do
61 +  c = 0
62 +  d = 2147483647
63 +  call sub (a, b, c, d, 50)
64 +  do i = 1, 50
65 +    j = 0
66 +    if (i .eq. 3) then
67 +      j = 8
68 +    else if (i .gt. 1 .and. i .lt. 9) then
69 +      j = 7
70 +    end if
71 +    if (c(i) .ne. j) call abort
72 +    j = 179 - modulo (i, 11)
73 +    if (i .gt. 1 .and. i .lt. 9) j = i
74 +    if (d(i) .ne. j) call abort
75 +  end do
76 +  deallocate (a, b, c, d)
77 +end
78 +
79 +subroutine sub (a, b, c, d, n)
80 +  integer :: n
81 +  integer, allocatable :: a(:), b(:), c(:), d(:)
82 +!$omp parallel do shared(a, b) reduction(+:c) reduction(min:d)
83 +  do i = 1, n
84 +    c(a(i)) = c(a(i)) + 1
85 +    d(i) = min(d(i), b(i))
86 +    d(a(i)) = min(d(a(i)), a(i))
87 +  end do
88 +end
89 Index: gcc/tree-ssa-loop-im.c
90 ===================================================================
91 --- gcc/tree-ssa-loop-im.c      (.../tags/gcc_4_5_2_release)    (wersja 169176)
92 +++ gcc/tree-ssa-loop-im.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
93 @@ -2139,7 +2139,7 @@
94    edge ex;
95  
96    for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
97 -    if (ex->flags & EDGE_ABNORMAL)
98 +    if (ex->flags & (EDGE_ABNORMAL | EDGE_EH))
99        return false;
100  
101    return true;
102 Index: gcc/tree-loop-distribution.c
103 ===================================================================
104 --- gcc/tree-loop-distribution.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
105 +++ gcc/tree-loop-distribution.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
106 @@ -251,7 +251,7 @@
107  
108  /* Generate a call to memset.  Return true when the operation succeeded.  */
109  
110 -static bool
111 +static void
112  generate_memset_zero (gimple stmt, tree op0, tree nb_iter,
113                       gimple_stmt_iterator bsi)
114  {
115 @@ -265,45 +265,27 @@
116  
117    DR_STMT (dr) = stmt;
118    DR_REF (dr) = op0;
119 -  if (!dr_analyze_innermost (dr))
120 -    goto end;
121 +  res = dr_analyze_innermost (dr);
122 +  gcc_assert (res && stride_of_unit_type_p (DR_STEP (dr), TREE_TYPE (op0)));
123  
124 -  /* Test for a positive stride, iterating over every element.  */
125 -  if (integer_zerop (size_binop (MINUS_EXPR,
126 -                                fold_convert (sizetype, DR_STEP (dr)),
127 -                                TYPE_SIZE_UNIT (TREE_TYPE (op0)))))
128 -    {
129 -      addr_base = fold_convert_loc (loc, sizetype,
130 -                                   size_binop_loc (loc, PLUS_EXPR,
131 -                                                   DR_OFFSET (dr),
132 -                                                   DR_INIT (dr)));
133 -      addr_base = fold_build2_loc (loc, POINTER_PLUS_EXPR,
134 -                                  TREE_TYPE (DR_BASE_ADDRESS (dr)),
135 -                                  DR_BASE_ADDRESS (dr), addr_base);
136 +  nb_bytes = build_size_arg_loc (loc, nb_iter, op0, &stmt_list);
137 +  addr_base = size_binop_loc (loc, PLUS_EXPR, DR_OFFSET (dr), DR_INIT (dr));
138 +  addr_base = fold_convert_loc (loc, sizetype, addr_base);
139  
140 -      nb_bytes = build_size_arg_loc (loc, nb_iter, op0, &stmt_list);
141 -    }
142 -
143    /* Test for a negative stride, iterating over every element.  */
144 -  else if (integer_zerop (size_binop (PLUS_EXPR,
145 -                                     TYPE_SIZE_UNIT (TREE_TYPE (op0)),
146 -                                     fold_convert (sizetype, DR_STEP (dr)))))
147 +  if (integer_zerop (size_binop (PLUS_EXPR,
148 +                                TYPE_SIZE_UNIT (TREE_TYPE (op0)),
149 +                                fold_convert (sizetype, DR_STEP (dr)))))
150      {
151 -      nb_bytes = build_size_arg_loc (loc, nb_iter, op0, &stmt_list);
152 -
153 -      addr_base = size_binop_loc (loc, PLUS_EXPR, DR_OFFSET (dr), DR_INIT (dr));
154 -      addr_base = fold_convert_loc (loc, sizetype, addr_base);
155        addr_base = size_binop_loc (loc, MINUS_EXPR, addr_base,
156                                   fold_convert_loc (loc, sizetype, nb_bytes));
157        addr_base = size_binop_loc (loc, PLUS_EXPR, addr_base,
158                                   TYPE_SIZE_UNIT (TREE_TYPE (op0)));
159 -      addr_base = fold_build2_loc (loc, POINTER_PLUS_EXPR,
160 -                                  TREE_TYPE (DR_BASE_ADDRESS (dr)),
161 -                                  DR_BASE_ADDRESS (dr), addr_base);
162      }
163 -  else
164 -    goto end;
165  
166 +  addr_base = fold_build2_loc (loc, POINTER_PLUS_EXPR,
167 +                              TREE_TYPE (DR_BASE_ADDRESS (dr)),
168 +                              DR_BASE_ADDRESS (dr), addr_base);
169    mem = force_gimple_operand (addr_base, &stmts, true, NULL);
170    gimple_seq_add_seq (&stmt_list, stmts);
171  
172 @@ -311,14 +293,11 @@
173    fn_call = gimple_build_call (fn, 3, mem, integer_zero_node, nb_bytes);
174    gimple_seq_add_stmt (&stmt_list, fn_call);
175    gsi_insert_seq_after (&bsi, stmt_list, GSI_CONTINUE_LINKING);
176 -  res = true;
177  
178    if (dump_file && (dump_flags & TDF_DETAILS))
179      fprintf (dump_file, "generated memset zero\n");
180  
181 - end:
182    free_data_ref (dr);
183 -  return res;
184  }
185  
186  /* Tries to generate a builtin function for the instructions of LOOP
187 @@ -332,7 +311,6 @@
188    unsigned i, x = 0;
189    basic_block *bbs;
190    gimple write = NULL;
191 -  tree op0, op1;
192    gimple_stmt_iterator bsi;
193    tree nb_iter = number_of_exit_cond_executions (loop);
194  
195 @@ -368,26 +346,17 @@
196         }
197      }
198  
199 -  if (!write)
200 +  if (!stmt_with_adjacent_zero_store_dr_p (write))
201      goto end;
202  
203 -  op0 = gimple_assign_lhs (write);
204 -  op1 = gimple_assign_rhs1 (write);
205 -
206 -  if (!(TREE_CODE (op0) == ARRAY_REF
207 -       || TREE_CODE (op0) == INDIRECT_REF))
208 -    goto end;
209 -
210    /* The new statements will be placed before LOOP.  */
211    bsi = gsi_last_bb (loop_preheader_edge (loop)->src);
212 +  generate_memset_zero (write, gimple_assign_lhs (write), nb_iter, bsi);
213 +  res = true;
214  
215 -  if (gimple_assign_rhs_code (write) == INTEGER_CST
216 -      && (integer_zerop (op1) || real_zerop (op1)))
217 -    res = generate_memset_zero (write, op0, nb_iter, bsi);
218 -
219    /* If this is the last partition for which we generate code, we have
220       to destroy the loop.  */
221 -  if (res && !copy_p)
222 +  if (!copy_p)
223      {
224        unsigned nbbs = loop->num_nodes;
225        edge exit = single_exit (loop);
226 @@ -531,24 +500,6 @@
227  static void rdg_flag_vertex_and_dependent (struct graph *, int, bitmap, bitmap,
228                                            bitmap, bool *);
229  
230 -/* Flag all the uses of U.  */
231 -
232 -static void
233 -rdg_flag_all_uses (struct graph *rdg, int u, bitmap partition, bitmap loops,
234 -                  bitmap processed, bool *part_has_writes)
235 -{
236 -  struct graph_edge *e;
237 -
238 -  for (e = rdg->vertices[u].succ; e; e = e->succ_next)
239 -    if (!bitmap_bit_p (processed, e->dest))
240 -      {
241 -       rdg_flag_vertex_and_dependent (rdg, e->dest, partition, loops,
242 -                                      processed, part_has_writes);
243 -       rdg_flag_all_uses (rdg, e->dest, partition, loops, processed,
244 -                          part_has_writes);
245 -      }
246 -}
247 -
248  /* Flag the uses of U stopping following the information from
249     upstream_mem_writes.  */
250  
251 @@ -720,68 +671,13 @@
252      }
253  }
254  
255 -/* Flag all the nodes of RDG containing memory accesses that could
256 -   potentially belong to arrays already accessed in the current
257 -   PARTITION.  */
258 -
259 -static void
260 -rdg_flag_similar_memory_accesses (struct graph *rdg, bitmap partition,
261 -                                 bitmap loops, bitmap processed,
262 -                                 VEC (int, heap) **other_stores)
263 -{
264 -  bool foo;
265 -  unsigned i, n;
266 -  int j, k, kk;
267 -  bitmap_iterator ii;
268 -  struct graph_edge *e;
269 -
270 -  EXECUTE_IF_SET_IN_BITMAP (partition, 0, i, ii)
271 -    if (RDG_MEM_WRITE_STMT (rdg, i)
272 -       || RDG_MEM_READS_STMT (rdg, i))
273 -      {
274 -       for (j = 0; j < rdg->n_vertices; j++)
275 -         if (!bitmap_bit_p (processed, j)
276 -             && (RDG_MEM_WRITE_STMT (rdg, j)
277 -                 || RDG_MEM_READS_STMT (rdg, j))
278 -             && rdg_has_similar_memory_accesses (rdg, i, j))
279 -           {
280 -             /* Flag first the node J itself, and all the nodes that
281 -                are needed to compute J.  */
282 -             rdg_flag_vertex_and_dependent (rdg, j, partition, loops,
283 -                                            processed, &foo);
284 -
285 -             /* When J is a read, we want to coalesce in the same
286 -                PARTITION all the nodes that are using J: this is
287 -                needed for better cache locality.  */
288 -             rdg_flag_all_uses (rdg, j, partition, loops, processed, &foo);
289 -
290 -             /* Remove from OTHER_STORES the vertex that we flagged.  */
291 -             if (RDG_MEM_WRITE_STMT (rdg, j))
292 -               for (k = 0; VEC_iterate (int, *other_stores, k, kk); k++)
293 -                 if (kk == j)
294 -                   {
295 -                     VEC_unordered_remove (int, *other_stores, k);
296 -                     break;
297 -                   }
298 -           }
299 -
300 -       /* If the node I has two uses, then keep these together in the
301 -          same PARTITION.  */
302 -       for (n = 0, e = rdg->vertices[i].succ; e; e = e->succ_next, n++);
303 -
304 -       if (n > 1)
305 -         rdg_flag_all_uses (rdg, i, partition, loops, processed, &foo);
306 -      }
307 -}
308 -
309  /* Returns a bitmap in which all the statements needed for computing
310     the strongly connected component C of the RDG are flagged, also
311     including the loop exit conditions.  */
312  
313  static bitmap
314  build_rdg_partition_for_component (struct graph *rdg, rdgc c,
315 -                                  bool *part_has_writes,
316 -                                  VEC (int, heap) **other_stores)
317 +                                  bool *part_has_writes)
318  {
319    int i, v;
320    bitmap partition = BITMAP_ALLOC (NULL);
321 @@ -793,13 +689,6 @@
322        rdg_flag_vertex_and_dependent (rdg, v, partition, loops, processed,
323                                      part_has_writes);
324  
325 -  /* Also iterate on the array of stores not in the starting vertices,
326 -     and determine those vertices that have some memory affinity with
327 -     the current nodes in the component: these are stores to the same
328 -     arrays, i.e. we're taking care of cache locality.  */
329 -  rdg_flag_similar_memory_accesses (rdg, partition, loops, processed,
330 -                                   other_stores);
331 -
332    rdg_flag_loop_exits (rdg, loops, partition, processed, part_has_writes);
333  
334    BITMAP_FREE (processed);
335 @@ -863,6 +752,79 @@
336    BITMAP_FREE (saved_components);
337  }
338  
339 +/* Returns true when it is possible to generate a builtin pattern for
340 +   the PARTITION of RDG.  For the moment we detect only the memset
341 +   zero pattern.  */
342 +
343 +static bool
344 +can_generate_builtin (struct graph *rdg, bitmap partition)
345 +{
346 +  unsigned i;
347 +  bitmap_iterator bi;
348 +  int nb_reads = 0;
349 +  int nb_writes = 0;
350 +  int stores_zero = 0;
351 +
352 +  EXECUTE_IF_SET_IN_BITMAP (partition, 0, i, bi)
353 +    if (RDG_MEM_READS_STMT (rdg, i))
354 +      nb_reads++;
355 +    else if (RDG_MEM_WRITE_STMT (rdg, i))
356 +      {
357 +       nb_writes++;
358 +       if (stmt_with_adjacent_zero_store_dr_p (RDG_STMT (rdg, i)))
359 +         stores_zero++;
360 +      }
361 +
362 +  return stores_zero == 1 && nb_writes == 1 && nb_reads == 0;
363 +}
364 +
365 +/* Returns true when PARTITION1 and PARTITION2 have similar memory
366 +   accesses in RDG.  */
367 +
368 +static bool
369 +similar_memory_accesses (struct graph *rdg, bitmap partition1,
370 +                        bitmap partition2)
371 +{
372 +  unsigned i, j;
373 +  bitmap_iterator bi, bj;
374 +
375 +  EXECUTE_IF_SET_IN_BITMAP (partition1, 0, i, bi)
376 +    if (RDG_MEM_WRITE_STMT (rdg, i)
377 +       || RDG_MEM_READS_STMT (rdg, i))
378 +      EXECUTE_IF_SET_IN_BITMAP (partition2, 0, j, bj)
379 +       if (RDG_MEM_WRITE_STMT (rdg, j)
380 +           || RDG_MEM_READS_STMT (rdg, j))
381 +         if (rdg_has_similar_memory_accesses (rdg, i, j))
382 +           return true;
383 +
384 +  return false;
385 +}
386 +
387 +/* Fuse all the partitions from PARTITIONS that contain similar memory
388 +   references, i.e., we're taking care of cache locality.  This
389 +   function does not fuse those partitions that contain patterns that
390 +   can be code generated with builtins.  */
391 +
392 +static void
393 +fuse_partitions_with_similar_memory_accesses (struct graph *rdg,
394 +                                             VEC (bitmap, heap) **partitions)
395 +{
396 +  int p1, p2;
397 +  bitmap partition1, partition2;
398 +
399 +  for (p1 = 0; VEC_iterate (bitmap, *partitions, p1, partition1); p1++)
400 +    if (!can_generate_builtin (rdg, partition1))
401 +      for (p2 = 0; VEC_iterate (bitmap, *partitions, p2, partition2); p2++)
402 +       if (p1 != p2
403 +           && !can_generate_builtin (rdg, partition2)
404 +           && similar_memory_accesses (rdg, partition1, partition2))
405 +         {
406 +           bitmap_ior_into (partition1, partition2);
407 +           VEC_ordered_remove (bitmap, *partitions, p2);
408 +           p2--;
409 +         }
410 +}
411 +
412  /* Aggregate several components into a useful partition that is
413     registered in the PARTITIONS vector.  Partitions will be
414     distributed in different loops.  */
415 @@ -885,8 +847,7 @@
416        if (bitmap_bit_p (processed, v))
417         continue;
418  
419 -      np = build_rdg_partition_for_component (rdg, x, &part_has_writes,
420 -                                             other_stores);
421 +      np = build_rdg_partition_for_component (rdg, x, &part_has_writes);
422        bitmap_ior_into (partition, np);
423        bitmap_ior_into (processed, np);
424        BITMAP_FREE (np);
425 @@ -932,6 +893,8 @@
426      VEC_safe_push (bitmap, heap, *partitions, partition);
427    else
428      BITMAP_FREE (partition);
429 +
430 +  fuse_partitions_with_similar_memory_accesses (rdg, partitions);
431  }
432  
433  /* Dump to FILE the PARTITIONS.  */
434 Index: gcc/DATESTAMP
435 ===================================================================
436 --- gcc/DATESTAMP       (.../tags/gcc_4_5_2_release)    (wersja 169176)
437 +++ gcc/DATESTAMP       (.../branches/gcc-4_5-branch)   (wersja 169176)
438 @@ -1 +1 @@
439 -20101216
440 +20110124
441 Index: gcc/DEV-PHASE
442 ===================================================================
443 --- gcc/DEV-PHASE       (.../tags/gcc_4_5_2_release)    (wersja 169176)
444 +++ gcc/DEV-PHASE       (.../branches/gcc-4_5-branch)   (wersja 169176)
445 @@ -0,0 +1 @@
446 +prerelease
447 Index: gcc/tree-ssa-sccvn.c
448 ===================================================================
449 --- gcc/tree-ssa-sccvn.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
450 +++ gcc/tree-ssa-sccvn.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
451 @@ -988,6 +988,7 @@
452  }
453  
454  static tree *last_vuse_ptr;
455 +static vn_lookup_kind vn_walk_kind;
456  
457  /* Callback for walk_non_aliased_vuses.  Adjusts the vn_reference_t VR_
458     with the current VUSE and performs the expression lookup.  */
459 @@ -1063,6 +1064,7 @@
460        size2 = TREE_INT_CST_LOW (gimple_call_arg (def_stmt, 2)) * 8;
461        if ((unsigned HOST_WIDE_INT)size2 / 8
462           == TREE_INT_CST_LOW (gimple_call_arg (def_stmt, 2))
463 +         && maxsize2 != -1
464           && operand_equal_p (base, base2, 0)
465           && offset2 <= offset
466           && offset2 + size2 >= offset + maxsize)
467 @@ -1086,7 +1088,8 @@
468        HOST_WIDE_INT offset2, size2, maxsize2;
469        base2 = get_ref_base_and_extent (gimple_assign_lhs (def_stmt),
470                                        &offset2, &size2, &maxsize2);
471 -      if (operand_equal_p (base, base2, 0)
472 +      if (maxsize2 != -1
473 +         && operand_equal_p (base, base2, 0)
474           && offset2 <= offset
475           && offset2 + size2 >= offset + maxsize)
476         {
477 @@ -1101,7 +1104,8 @@
478  
479    /* For aggregate copies translate the reference through them if
480       the copy kills ref.  */
481 -  else if (gimple_assign_single_p (def_stmt)
482 +  else if (vn_walk_kind == VN_WALKREWRITE
483 +          && gimple_assign_single_p (def_stmt)
484            && (DECL_P (gimple_assign_rhs1 (def_stmt))
485                || INDIRECT_REF_P (gimple_assign_rhs1 (def_stmt))
486                || handled_component_p (gimple_assign_rhs1 (def_stmt))))
487 @@ -1116,7 +1120,8 @@
488        /* See if the assignment kills REF.  */
489        base2 = get_ref_base_and_extent (gimple_assign_lhs (def_stmt),
490                                        &offset2, &size2, &maxsize2);
491 -      if (!operand_equal_p (base, base2, 0)
492 +      if (maxsize2 == -1
493 +         || !operand_equal_p (base, base2, 0)
494           || offset2 > offset
495           || offset2 + size2 < offset + maxsize)
496         return (void *)-1;
497 @@ -1190,7 +1195,7 @@
498  tree
499  vn_reference_lookup_pieces (tree vuse, alias_set_type set, tree type,
500                             VEC (vn_reference_op_s, heap) *operands,
501 -                           vn_reference_t *vnresult, bool maywalk)
502 +                           vn_reference_t *vnresult, vn_lookup_kind kind)
503  {
504    struct vn_reference_s vr1;
505    vn_reference_t tmp;
506 @@ -1215,10 +1220,11 @@
507    vn_reference_lookup_1 (&vr1, vnresult);
508  
509    if (!*vnresult
510 -      && maywalk
511 +      && kind != VN_NOWALK
512        && vr1.vuse)
513      {
514        ao_ref r;
515 +      vn_walk_kind = kind;
516        if (ao_ref_init_from_vn_reference (&r, set, type, vr1.operands))
517         *vnresult =
518           (vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse,
519 @@ -1241,7 +1247,7 @@
520     stored in the hashtable if one exists.  */
521  
522  tree
523 -vn_reference_lookup (tree op, tree vuse, bool maywalk,
524 +vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind,
525                      vn_reference_t *vnresult)
526  {
527    VEC (vn_reference_op_s, heap) *operands;
528 @@ -1256,12 +1262,13 @@
529    vr1.set = get_alias_set (op);
530    vr1.hashcode = vn_reference_compute_hash (&vr1);
531  
532 -  if (maywalk
533 +  if (kind != VN_NOWALK
534        && vr1.vuse)
535      {
536        vn_reference_t wvnresult;
537        ao_ref r;
538        ao_ref_init (&r, op);
539 +      vn_walk_kind = kind;
540        wvnresult =
541         (vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse,
542                                                 vn_reference_lookup_2,
543 @@ -1980,14 +1987,14 @@
544  
545    last_vuse = gimple_vuse (stmt);
546    last_vuse_ptr = &last_vuse;
547 -  result = vn_reference_lookup (op, gimple_vuse (stmt), true, NULL);
548 +  result = vn_reference_lookup (op, gimple_vuse (stmt), VN_WALKREWRITE, NULL);
549    last_vuse_ptr = NULL;
550  
551    /* If we have a VCE, try looking up its operand as it might be stored in
552       a different type.  */
553    if (!result && TREE_CODE (op) == VIEW_CONVERT_EXPR)
554      result = vn_reference_lookup (TREE_OPERAND (op, 0), gimple_vuse (stmt),
555 -                                 true, NULL);
556 +                                 VN_WALKREWRITE, NULL);
557  
558    /* We handle type-punning through unions by value-numbering based
559       on offset and size of the access.  Be prepared to handle a
560 @@ -2098,7 +2105,7 @@
561       Otherwise, the vdefs for the store are used when inserting into
562       the table, since the store generates a new memory state.  */
563  
564 -  result = vn_reference_lookup (lhs, gimple_vuse (stmt), false, NULL);
565 +  result = vn_reference_lookup (lhs, gimple_vuse (stmt), VN_NOWALK, NULL);
566  
567    if (result)
568      {
569 Index: gcc/tree-ssa-sccvn.h
570 ===================================================================
571 --- gcc/tree-ssa-sccvn.h        (.../tags/gcc_4_5_2_release)    (wersja 169176)
572 +++ gcc/tree-ssa-sccvn.h        (.../branches/gcc-4_5-branch)   (wersja 169176)
573 @@ -185,10 +185,11 @@
574  void copy_reference_ops_from_call (gimple, VEC(vn_reference_op_s, heap) **);
575  bool ao_ref_init_from_vn_reference (ao_ref *, alias_set_type, tree,
576                                     VEC (vn_reference_op_s, heap) *);
577 +typedef enum { VN_NOWALK, VN_WALK, VN_WALKREWRITE } vn_lookup_kind;
578  tree vn_reference_lookup_pieces (tree, alias_set_type, tree,
579                                  VEC (vn_reference_op_s, heap) *,
580 -                                vn_reference_t *, bool);
581 -tree vn_reference_lookup (tree, tree, bool, vn_reference_t *);
582 +                                vn_reference_t *, vn_lookup_kind);
583 +tree vn_reference_lookup (tree, tree, vn_lookup_kind, vn_reference_t *);
584  vn_reference_t vn_reference_insert (tree, tree, tree);
585  vn_reference_t vn_reference_insert_pieces (tree, alias_set_type, tree,
586                                            VEC (vn_reference_op_s, heap) *,
587 Index: gcc/ChangeLog
588 ===================================================================
589 --- gcc/ChangeLog       (.../tags/gcc_4_5_2_release)    (wersja 169176)
590 +++ gcc/ChangeLog       (.../branches/gcc-4_5-branch)   (wersja 169176)
591 @@ -1,3 +1,306 @@
592 +2011-01-21  Richard Guenther  <rguenther@suse.de>
593 +
594 +       PR tree-optimization/47365
595 +       * tree-ssa-sccvn.h (vn_lookup_kind): Declare.
596 +       (vn_reference_lookup_pieces): Adjust.
597 +       (vn_reference_lookup): Likewise.
598 +       * tree-ssa-sccvn.c (vn_walk_kind): New static global.
599 +       (vn_reference_lookup_3): Only look through kills if in
600 +       VN_WALKREWRITE mode.
601 +       (vn_reference_lookup_pieces): Adjust.
602 +       (vn_reference_lookup): Likewise.
603 +       (visit_reference_op_load): Likewise.
604 +       (visit_reference_op_store): Likewise.
605 +       * tree-ssa-pre.c (phi_translate_1): Use VN_WALK mode.
606 +       (compute_avail): Likewise.
607 +       (eliminate): Likewise.
608 +
609 +2011-01-20  Richard Guenther  <rguenther@suse.de>
610 +
611 +       PR tree-optimization/47167
612 +       * tree-ssa-copyrename.c (copy_rename_partition_coalesce):
613 +       Revert previous change, only avoid enumeral type changes.
614 +
615 +2011-01-17  H.J. Lu  <hongjiu.lu@intel.com>
616 +
617 +       Backport from mainline
618 +       2011-01-17  H.J. Lu  <hongjiu.lu@intel.com>
619 +
620 +       PR target/47318
621 +       * config/i386/avxintrin.h (_mm_maskload_pd): Change mask to
622 +       __m128i.
623 +       (_mm_maskstore_pd): Likewise.
624 +       (_mm_maskload_ps): Likewise.
625 +       (_mm_maskstore_ps): Likewise.
626 +       (_mm256_maskload_pd): Change mask to __m256i.
627 +       (_mm256_maskstore_pd): Likewise.
628 +       (_mm256_maskload_ps): Likewise.
629 +       (_mm256_maskstore_ps): Likewise.
630 +
631 +       * config/i386/i386-builtin-types.def: Updated.
632 +       (ix86_expand_special_args_builtin): Likewise.
633 +
634 +       * config/i386/i386.c (bdesc_special_args): Update
635 +       __builtin_ia32_maskloadpd, __builtin_ia32_maskloadps,
636 +       __builtin_ia32_maskloadpd256, __builtin_ia32_maskloadps256,
637 +       __builtin_ia32_maskstorepd, __builtin_ia32_maskstoreps,
638 +       __builtin_ia32_maskstorepd256 and __builtin_ia32_maskstoreps256.
639 +
640 +       * config/i386/sse.md (avx_maskload<ssemodesuffix><avxmodesuffix>):
641 +       Use <avxpermvecmode> on mask register.
642 +       (avx_maskstore<ssemodesuffix><avxmodesuffix>): Likewise.
643 +
644 +2011-01-17  Olivier Hainque  <hainque@adacore.com>
645 +            Michael Haubenwallner  <michael.haubenwallner@salomon.at>
646 +            Eric Botcazou  <ebotcazou@adacore.com>
647 +
648 +       PR target/46655
649 +       * xcoffout.c (ASM_OUTPUT_LINE): Output line only if positive, and only
650 +       if <= USHRT_MAX in 32-bit mode.
651 +
652 +2011-01-17  Richard Guenther  <rguenther@suse.de>
653 +
654 +       Backport from mainline
655 +       PR tree-optimization/47286
656 +       * tree-ssa-structalias.c (new_var_info): Register variables
657 +       are global.
658 +
659 +       PR tree-optimization/44592
660 +       * tree-ssa-ccp.c (gimplify_and_update_call_from_tree): Copy
661 +       from trunk.
662 +
663 +2011-01-16  Jakub Jelinek  <jakub@redhat.com>
664 +
665 +       Backport from mainline
666 +       2011-01-07  Jakub Jelinek  <jakub@redhat.com>
667 +
668 +       PR target/47201
669 +       * config/i386/i386.c (ix86_delegitimize_address): If
670 +       simplify_gen_subreg fails, return orig_x.
671 +
672 +       2011-01-06  Jakub Jelinek  <jakub@redhat.com>
673 +
674 +       PR c/47150
675 +       * c-convert.c (convert): When converting a complex expression
676 +       other than COMPLEX_EXPR to a different complex type, ensure
677 +       c_save_expr is called instead of save_expr, unless in_late_binary_op.
678 +       * c-typeck.c (convert_for_assignment): Set in_late_binary_op also
679 +       when converting COMPLEX_TYPE.
680 +
681 +       2010-12-21  Jakub Jelinek  <jakub@redhat.com>
682 +
683 +       PR target/46880
684 +       * config/i386/sse.md (sse2_loadlpd, sse2_movsd): Fix shufpd source
685 +       operand.
686 +
687 +       PR middle-end/45852
688 +       * expr.c (store_expr): Ignore alt_rtl if equal to target,
689 +       but has side-effects.
690 +
691 +       2010-12-16  Jakub Jelinek  <jakub@redhat.com>
692 +
693 +       PR tree-optimization/43655
694 +       * tree-ssa-ter.c (is_replaceable_p): Don't use
695 +       gimple_references_memory_p for -O0, instead check for load
696 +       by looking at rhs.
697 +
698 +       PR debug/46893
699 +       * cfgexpand.c (expand_debug_expr): If GET_MODE (op0) is VOIDmode,
700 +       use TYPE_MODE (TREE_TYPE (tem)) instead of mode1.
701 +
702 +       2010-12-10  Jakub Jelinek  <jakub@redhat.com>
703 +
704 +       PR rtl-optimization/46804
705 +       * regmove.c (optimize_reg_copy_3): Look for REG_EQUAL note
706 +       on the setter of src_reg rather than on insn.  If it is
707 +       equal to the setter's original SET_SRC, replace it with its
708 +       zero or sign extension instead of dropping it.
709 +
710 +       PR rtl-optimization/46865
711 +       * rtl.c (rtx_equal_p_cb, rtx_equal_p): For last operand of
712 +       ASM_OPERANDS and ASM_INPUT if integers are different,
713 +       call locator_eq.
714 +       * jump.c (rtx_renumbered_equal_p): Likewise.
715 +
716 +       PR tree-optimization/46864
717 +       * tree-ssa-loop-im.c (loop_suitable_for_sm): Return false even
718 +       when there are EDGE_EH exit edges.
719 +
720 +       2010-12-09  Jakub Jelinek  <jakub@redhat.com>
721 +
722 +       PR target/41082
723 +       * config/rs6000/rs6000.c (rs6000_expand_vector_extract): Use stvx
724 +       instead of stve*x.
725 +       (altivec_expand_stv_builtin): For op0 use mode of operand 1 instead
726 +       of operand 0.
727 +       * config/rs6000/altivec.md (VI_scalar): New mode attr.
728 +       (altivec_stve<VI_char>x, *altivec_stvesfx): Use scalar instead of
729 +       vector mode for operand 0, put operand 1 into UNSPEC.
730 +
731 +2011-01-13  Nick Clifton  <nickc@redhat.com>
732 +
733 +       Import this fix from the mainline:
734 +       2010-10-19  Nick Clifton  <nickc@redhat.com>
735 +
736 +       * config/rx/rx.c (rx_function_value): Small integer types are
737 +       promoted to SImode.
738 +       (rx_promote_function_mode): New function.
739 +       (TARGET_PROMOTE_FUNCTION_MODE): Define.
740 +
741 +2011-01-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
742 +
743 +       Backport from mainline:
744 +       2011-01-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
745 +
746 +       PR target/43309
747 +       * config/i386/i386.c (legitimize_tls_address)
748 +       <TLS_MODEL_INITIAL_EXEC>: Handle TARGET_64BIT && TARGET_SUN_TLS.
749 +       * config/i386/i386.md (UNSPEC_TLS_IE_SUN): Declare.
750 +       (tls_initial_exec_64_sun): New pattern.
751 +
752 +2011-01-03  Eric Botcazou  <ebotcazou@adacore.com>
753 +
754 +       Backport from mainline
755 +       2010-12-30  Eric Botcazou  <ebotcazou@adacore.com>
756 +
757 +       PR target/47038
758 +       * config/sparc/sparc.c (sparc_file_end): Call resolve_unique_section
759 +       on the GOT helper if USE_HIDDEN_LINKONCE.
760 +
761 +       2010-12-02  Eric Botcazou  <ebotcazou@adacore.com>
762 +
763 +       PR target/46685
764 +       * config/sparc/sparc.c (can_use_mov_pic_label_ref): New predicate.
765 +       (sparc_expand_move): Call it to decide whether to emit the special
766 +       mov{si,di}_pic_label_ref patterns.
767 +       (sparc_legitimize_pic_address): Call it to decide whether to emit
768 +       the regular PIC sequence for labels.  Fix long line.
769 +       (sparc_file_end): Set is_thunk for the PIC helper.
770 +
771 +2010-12-30  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
772 +
773 +       * config/pa/pa.md: Add ",*" condition to 64-bit add/subtract boolean
774 +       patterns.
775 +
776 +2010-12-27  Yao Qi  <yao@codesourcery.com>
777 +
778 +       Backport from mainline:
779 +       2010-10-14  Yao Qi  <yao@codesourcery.com>
780 +
781 +       PR target/45447
782 +       * config/arm/arm.c (arm_build_builtin_va_list): Assign
783 +       va_list_name to TYPE_STUB_DECL (va_list_type).
784 +
785 +2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
786 +           Richard Guenther  <rguenther@suse.de>
787 +
788 +       PR tree-optimization/46758
789 +       * graphite-sese-to-poly.c (scan_tree_for_params_right_scev): Use
790 +       tree_int_to_gmp instead of int_cst_value.
791 +       (scan_tree_for_params_int): Same.
792 +       (scan_tree_for_params): Same.
793 +       (pdr_add_data_dimensions): Use ppl_set_inhomogeneous_tree.
794 +
795 +2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
796 +
797 +       Backport from mainline
798 +       Fix PR45758: reset scevs before Graphite.
799 +        2010-09-24  Sebastian Pop  <sebastian.pop@amd.com>
800 +
801 +       PR tree-optimization/45552
802 +       * graphite.c (graphite_initialize): Call scev_reset.
803 +
804 +2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
805 +
806 +       PR tree-optimization/43023
807 +       * tree-data-ref.c (mem_write_stride_of_same_size_as_unit_type_p):
808 +       Removed.
809 +       (stores_zero_from_loop): Call stmt_stores_zero.
810 +       (stmt_with_adjacent_zero_store_dr_p): New.
811 +       * tree-data-ref.h (stmt_with_adjacent_zero_store_dr_p): Declared.
812 +       (stride_of_unit_type_p): New.
813 +       * tree-loop-distribution.c (generate_memset_zero): Do not return a
814 +       boolean.  Call gcc_assert on stride_of_unit_type_p.
815 +       (generate_builtin): Call stmt_stores_zero.
816 +       (rdg_flag_all_uses): Removed.
817 +       (rdg_flag_similar_memory_accesses): Removed.
818 +       (build_rdg_partition_for_component): Removed parameter
819 +       other_stores.  Removed call to rdg_flag_similar_memory_accesses.
820 +       (can_generate_builtin): New.
821 +       (similar_memory_accesses): New.
822 +       (fuse_partitions_with_similar_memory_accesses): New.
823 +       (rdg_build_partitions): Call
824 +       fuse_partitions_with_similar_memory_accesses.
825 +
826 +2010-12-21  Martin Jambor  <mjambor@suse.cz>
827 +
828 +       Backport from mainline:
829 +       2010-12-09  Martin Jambor  <mjambor@suse.cz>
830 +
831 +       PR middle-end/46734
832 +       * tree-sra.c (splice_param_accesses): Check that there are not
833 +       multiple ADDRESSABLE types.
834 +
835 +2010-12-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
836 +
837 +       Backport from mainline:
838 +       2010-12-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
839 +
840 +       PR target/46915
841 +       * config/pa/pa.c (branch_to_delay_slot_p): Use next_active_insn instead
842 +       of next_real_insn.  Search forward checking for both ASM_INPUT and
843 +       ASM_OPERANDS asms until exit condition is found.
844 +       (branch_needs_nop_p): Likewise.
845 +       (use_skip_p): New function.
846 +       (output_cbranch): Use use_skip_p.
847 +       (output_bb, output_bvb): Likewise.
848 +
849 +2010-12-19  Eric Botcazou  <ebotcazou@adacore.com>
850 +
851 +       PR target/46729
852 +       * config/sparc/sparc.h (GLOBAL_OFFSET_TABLE_REGNUM): New macro.
853 +       (PIC_OFFSET_TABLE_REGNUM): Rewrite in terms of above macro.
854 +       * config/sparc/sparc.c (pic_helper_needed): Delete.
855 +       (global_offset_table): Likewise.
856 +       (pic_helper_symbol): Rename to...
857 +       (got_helper_rtx): ...this.
858 +       (global_offset_table_rtx): New global variable.
859 +       (sparc_got_symbol): Likewise.
860 +       (sparc_got): New static function.
861 +       (check_pic): Use local variable and call sparc_got.
862 +       (sparc_tls_symbol): Initialize to NULL_RTX.
863 +       (sparc_tls_got): In non-PIC mode, reload the GOT register for Sun TLS
864 +       and 32-bit ABI and copy the GOT symbol to a new register otherwise.
865 +       (get_pc_thunk_name): Rename local variable.
866 +       (gen_load_pcrel_sym): New wrapper around load_pcrel_sym{si,di}.
867 +       (load_pic_register): Rename to...
868 +       (load_got_register): ...this.  Adjust and call gen_load_pcrel_sym.
869 +       (sparc_expand_prologue): Do not test flag_pic.
870 +       (sparc_output_mi_thunk): Use pic_offset_table_rtx directly.
871 +       (sparc_file_end): Test got_helper_rtx instead of pic_helper_needed.
872 +       Rename local variable and do not call get_pc_thunk_name again.
873 +       * config/sparc/sparc.md (load_pcrel_sym): Add operand #3.
874 +
875 +2010-12-18  Alexandre Oliva  <aoliva@redhat.com>
876 +
877 +       PR debug/46756
878 +       * jump.c (mark_all_labels): Skip debug insns.
879 +
880 +2010-12-18  Alexandre Oliva  <aoliva@redhat.com>
881 +
882 +       PR debug/46782
883 +       * cfgcleanup.c (try_forward_edges): Skip debug insns.
884 +
885 +2010-12-16  Eric Botcazou  <ebotcazou@adacore.com>
886 +
887 +       * tree-ssa-sccvn.c (vn_reference_lookup_3): Always punt if the call to
888 +       get_ref_base_and_extent returns -1 as the max size.
889 +
890 +2010-12-16  Richard Guenther  <rguenther@suse.de>
891 +
892 +       * DEV-PHASE: Set back to prerelease.
893 +       * BASE-VER: Bump to 4.5.3.
894 +
895  2010-12-16  Release Manager
896  
897         * GCC 4.5.2 released.
898 Index: gcc/testsuite/gcc.c-torture/compile/pr47150.c
899 ===================================================================
900 --- gcc/testsuite/gcc.c-torture/compile/pr47150.c       (.../tags/gcc_4_5_2_release)    (wersja 0)
901 +++ gcc/testsuite/gcc.c-torture/compile/pr47150.c       (.../branches/gcc-4_5-branch)   (wersja 169176)
902 @@ -0,0 +1,11 @@
903 +/* PR c/47150 */
904 +
905 +float _Complex foo (float, float);
906 +
907 +void
908 +bar ()
909 +{
910 +  float w = 2;
911 +  float _Complex b;
912 +  b = 0.5 * (foo (0, w) + foo (1, w) / w);
913 +}
914 Index: gcc/testsuite/gcc.target/arm/pr45447.c
915 ===================================================================
916 --- gcc/testsuite/gcc.target/arm/pr45447.c      (.../tags/gcc_4_5_2_release)    (wersja 0)
917 +++ gcc/testsuite/gcc.target/arm/pr45447.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
918 @@ -0,0 +1,3 @@
919 +/* { dg-do compile } */
920 +/* { dg-options "-g -femit-struct-debug-baseonly" } */
921 +typedef __builtin_va_list x;
922 Index: gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c
923 ===================================================================
924 --- gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
925 +++ gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
926 @@ -16,10 +16,11 @@
927    int i;
928    int m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3), mask_v(4), mask_v(5), mask_v(6), mask_v(7)};
929    float s[8] = {1,2,3,4,5,6,7,8};
930 -  union256 u, mask;
931 +  union256 u;
932 +  union256i_d mask;
933    float e [8] = {0.0};
934  
935 -  mask.x = _mm256_loadu_ps ((float*)m);
936 +  mask.x = _mm256_loadu_si256 ((__m256i *)m);
937    u.x = _mm256_maskload_ps (s, mask.x);
938  
939    for (i = 0 ; i < 8; i++) 
940 Index: gcc/testsuite/gcc.target/i386/pr46880.c
941 ===================================================================
942 --- gcc/testsuite/gcc.target/i386/pr46880.c     (.../tags/gcc_4_5_2_release)    (wersja 0)
943 +++ gcc/testsuite/gcc.target/i386/pr46880.c     (.../branches/gcc-4_5-branch)   (wersja 169176)
944 @@ -0,0 +1,28 @@
945 +/* PR target/46880 */
946 +/* { dg-do run } */
947 +/* { dg-options "-O2 -fno-strict-aliasing -msse2" } */
948 +/* { dg-require-effective-target sse2_runtime } */
949 +
950 +typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
951 +typedef double (*T)[2];
952 +
953 +static __attribute__ ((noinline, noclone)) __m128d
954 +foo (__m128d c, __m128d d)
955 +{
956 +  T cp = (T) &c;
957 +  T dp = (T) &d;
958 +  __m128d e = { (*cp)[1], (*dp)[1] };
959 +  return e;
960 +}
961 +
962 +int
963 +main ()
964 +{
965 +  __m128d c = { 1.0, 2.0 };
966 +  __m128d d = { 3.0, 4.0 };
967 +  union { __m128d x; double d[2]; } u;
968 +  u.x = foo (c, d);
969 +  if (u.d[0] != 2.0 || u.d[1] != 4.0)
970 +    __builtin_abort ();
971 +  return 0;
972 +}
973 Index: gcc/testsuite/gcc.target/i386/avx-vmaskmovps-1.c
974 ===================================================================
975 --- gcc/testsuite/gcc.target/i386/avx-vmaskmovps-1.c    (.../tags/gcc_4_5_2_release)    (wersja 0)
976 +++ gcc/testsuite/gcc.target/i386/avx-vmaskmovps-1.c    (.../branches/gcc-4_5-branch)   (wersja 169176)
977 @@ -0,0 +1,31 @@
978 +/* { dg-do run } */
979 +/* { dg-require-effective-target avx } */
980 +/* { dg-options "-O2 -mavx" } */
981 +
982 +#include "avx-check.h"
983 +
984 +#ifndef MASK
985 +#define MASK 134
986 +#endif
987 +
988 +#define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31)
989 +
990 +void static
991 +avx_test (void)
992 +{
993 +  int i;
994 +  int m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
995 +  float s[4] = {1,2,3,4};
996 +  union128 u;
997 +  union128i_d mask;
998 +  float e[4] = {0.0};
999 +
1000 +  mask.x = _mm_loadu_si128 ((__m128i *)m);
1001 +  u.x = _mm_maskload_ps (s, mask.x);
1002 +
1003 +  for (i = 0 ; i < 4; i++) 
1004 +    e[i] = m[i] ? s[i] : 0;
1005 +   
1006 +  if (check_union128 (u, e))
1007 +    abort ();
1008 +}
1009 Index: gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c
1010 ===================================================================
1011 --- gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
1012 +++ gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
1013 @@ -14,12 +14,13 @@
1014  avx_test (void)
1015  {
1016    int i;
1017 -  long long m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
1018 +  long long m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
1019    double s[4] = {1.1, 2.2, 3.3, 4.4};
1020 -  union256d u, mask;
1021 +  union256d u;
1022 +  union256i_q mask;
1023    double e [4] = {0.0};
1024  
1025 -  mask.x = _mm256_loadu_pd ((double*)m);
1026 +  mask.x = _mm256_loadu_si256 ((__m256i *)m);
1027    u.x = _mm256_maskload_pd (s, mask.x);
1028  
1029    for (i = 0 ; i < 4; i++) 
1030 Index: gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-1.c
1031 ===================================================================
1032 --- gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-1.c    (.../tags/gcc_4_5_2_release)    (wersja 0)
1033 +++ gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-1.c    (.../branches/gcc-4_5-branch)   (wersja 169176)
1034 @@ -0,0 +1,31 @@
1035 +/* { dg-do run } */
1036 +/* { dg-require-effective-target avx } */
1037 +/* { dg-options "-O2 -mavx" } */
1038 +
1039 +#include "avx-check.h"
1040 +
1041 +#ifndef MASK
1042 +#define MASK 7
1043 +#endif
1044 +
1045 +#define mask_v(pos) (((MASK & (0x1ULL << (pos))) >> (pos)) << 63)
1046 +
1047 +void static
1048 +avx_test (void)
1049 +{
1050 +  int i;
1051 +  long long m[2] = {mask_v(0), mask_v(1)};
1052 +  double s[2] = {1.1, 2.2};
1053 +  union128d u;
1054 +  union128i_q mask;
1055 +  double e[2] = {0.0};
1056 +
1057 +  mask.x = _mm_loadu_si128 ((__m128i *)m);
1058 +  u.x = _mm_maskload_pd (s, mask.x);
1059 +
1060 +  for (i = 0 ; i < 2; i++) 
1061 +    e[i] = m[i] ? s[i] : 0;
1062 +   
1063 +  if (check_union128d (u, e))
1064 +    abort ();
1065 +}
1066 Index: gcc/testsuite/gcc.target/i386/pr46865-1.c
1067 ===================================================================
1068 --- gcc/testsuite/gcc.target/i386/pr46865-1.c   (.../tags/gcc_4_5_2_release)    (wersja 0)
1069 +++ gcc/testsuite/gcc.target/i386/pr46865-1.c   (.../branches/gcc-4_5-branch)   (wersja 169176)
1070 @@ -0,0 +1,31 @@
1071 +/* PR rtl-optimization/46865 */
1072 +/* { dg-do compile } */
1073 +/* { dg-options "-O2" } */
1074 +
1075 +extern unsigned long f;
1076 +
1077 +#define m1(f)                                                  \
1078 +  if (f & 1)                                                   \
1079 +    asm volatile ("nop /* asmnop */\n");                       \
1080 +  else                                                         \
1081 +    asm volatile ("nop /* asmnop */\n");
1082 +
1083 +#define m2(f)                                                  \
1084 +  if (f & 1)                                                   \
1085 +    asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");    \
1086 +  else                                                         \
1087 +    asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
1088 +
1089 +void
1090 +foo (void)
1091 +{
1092 +  m1 (f);
1093 +}
1094 +
1095 +void
1096 +bar (void)
1097 +{
1098 +  m2 (f);
1099 +}
1100 +
1101 +/* { dg-final { scan-assembler-times "asmnop" 2 } } */
1102 Index: gcc/testsuite/gcc.target/i386/pr45852.c
1103 ===================================================================
1104 --- gcc/testsuite/gcc.target/i386/pr45852.c     (.../tags/gcc_4_5_2_release)    (wersja 0)
1105 +++ gcc/testsuite/gcc.target/i386/pr45852.c     (.../branches/gcc-4_5-branch)   (wersja 169176)
1106 @@ -0,0 +1,16 @@
1107 +/* PR middle-end/45852 */
1108 +/* { dg-options "-O2 -mcmodel=small" } */
1109 +/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && lp64 } } } */
1110 +/* { dg-require-visibility "" } */
1111 +
1112 +struct S { int s; };
1113 +
1114 +volatile struct S globvar __attribute__((visibility ("hidden"))) = { -6 };
1115 +
1116 +void
1117 +foo (void)
1118 +{
1119 +  globvar = globvar;
1120 +}
1121 +
1122 +/* { dg-final { scan-assembler-times "globvar.%?rip" 2 } } */
1123 Index: gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c
1124 ===================================================================
1125 --- gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
1126 +++ gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
1127 @@ -16,12 +16,13 @@
1128    int i;
1129    int m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3), mask_v(4), mask_v(5), mask_v(6), mask_v(7)};
1130    float s[8] = {1,2,3,4,5,6,7,8};
1131 -  union256 src, mask;
1132 +  union256 src;
1133 +  union256i_d mask;
1134    float e [8] = {0.0};
1135    float d [8] = {0.0};
1136  
1137    src.x = _mm256_loadu_ps (s);
1138 -  mask.x = _mm256_loadu_ps ((float *)m);
1139 +  mask.x = _mm256_loadu_si256 ((__m256i *)m);
1140    _mm256_maskstore_ps (d, mask.x, src.x);
1141  
1142    for (i = 0 ; i < 8; i++) 
1143 Index: gcc/testsuite/gcc.target/i386/avx-vmaskmovps-2.c
1144 ===================================================================
1145 --- gcc/testsuite/gcc.target/i386/avx-vmaskmovps-2.c    (.../tags/gcc_4_5_2_release)    (wersja 0)
1146 +++ gcc/testsuite/gcc.target/i386/avx-vmaskmovps-2.c    (.../branches/gcc-4_5-branch)   (wersja 169176)
1147 @@ -0,0 +1,33 @@
1148 +/* { dg-do run } */
1149 +/* { dg-require-effective-target avx } */
1150 +/* { dg-options "-O2 -mavx" } */
1151 +
1152 +#include "avx-check.h"
1153 +
1154 +#ifndef MASK
1155 +#define MASK 214
1156 +#endif
1157 +
1158 +#define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31)
1159 +
1160 +void static
1161 +avx_test (void)
1162 +{
1163 +  int i;
1164 +  int m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
1165 +  float s[4] = {1,2,3,4};
1166 +  union128 src;
1167 +  union128i_d mask;
1168 +  float e[4] = {0.0};
1169 +  float d[4] = {0.0};
1170 +
1171 +  src.x = _mm_loadu_ps (s);
1172 +  mask.x = _mm_loadu_si128 ((__m128i *)m);
1173 +  _mm_maskstore_ps (d, mask.x, src.x);
1174 +
1175 +  for (i = 0 ; i < 4; i++) 
1176 +    e[i] = m[i] ? s[i] : 0;
1177 +   
1178 +  if (checkVf (d, e, 4))
1179 +    abort ();
1180 +}
1181 Index: gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c
1182 ===================================================================
1183 --- gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
1184 +++ gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
1185 @@ -18,10 +18,11 @@
1186    double s[4] = {1.1, 2.2, 3.3, 4.4};
1187    double e [4] = {0.0};
1188    double d [4] = {0.0};
1189 -  union256d src, mask;
1190 +  union256d src;
1191 +  union256i_q mask;
1192    
1193    src.x = _mm256_loadu_pd (s);
1194 -  mask.x = _mm256_loadu_pd ((double*)m);
1195 +  mask.x = _mm256_loadu_si256 ((__m256i *)m);
1196    _mm256_maskstore_pd (d, mask.x, src.x);
1197  
1198    for (i = 0 ; i < 4; i++) 
1199 Index: gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-2.c
1200 ===================================================================
1201 --- gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-2.c    (.../tags/gcc_4_5_2_release)    (wersja 0)
1202 +++ gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-2.c    (.../branches/gcc-4_5-branch)   (wersja 169176)
1203 @@ -0,0 +1,33 @@
1204 +/* { dg-do run } */
1205 +/* { dg-require-effective-target avx } */
1206 +/* { dg-options "-O2 -mavx" } */
1207 +
1208 +#include "avx-check.h"
1209 +
1210 +#ifndef MASK
1211 +#define MASK 6
1212 +#endif
1213 +
1214 +#define mask_v(pos) (((MASK & (0x1ULL << (pos))) >> (pos)) << 63)
1215 +
1216 +void static
1217 +avx_test (void)
1218 +{
1219 +  int i;
1220 +  long long m[2] = {mask_v(0), mask_v(1)};
1221 +  double s[2] = {1.1, 2.2};
1222 +  double e[2] = {0.0};
1223 +  double d[2] = {0.0};
1224 +  union128d src;
1225 +  union128i_q mask;
1226 +  
1227 +  src.x = _mm_loadu_pd (s);
1228 +  mask.x = _mm_loadu_si128 ((__m128i *)m);
1229 +  _mm_maskstore_pd (d, mask.x, src.x);
1230 +
1231 +  for (i = 0 ; i < 2; i++) 
1232 +    e[i] = m[i] ? s[i] : 0;
1233 +   
1234 +  if (checkVd (d, e, 2))
1235 +    abort ();
1236 +}
1237 Index: gcc/testsuite/gcc.target/i386/pr46865-2.c
1238 ===================================================================
1239 --- gcc/testsuite/gcc.target/i386/pr46865-2.c   (.../tags/gcc_4_5_2_release)    (wersja 0)
1240 +++ gcc/testsuite/gcc.target/i386/pr46865-2.c   (.../branches/gcc-4_5-branch)   (wersja 169176)
1241 @@ -0,0 +1,32 @@
1242 +/* PR rtl-optimization/46865 */
1243 +/* { dg-do compile } */
1244 +/* { dg-options "-O2 -save-temps" } */
1245 +
1246 +extern unsigned long f;
1247 +
1248 +#define m1(f)                                                  \
1249 +  if (f & 1)                                                   \
1250 +    asm volatile ("nop /* asmnop */\n");                       \
1251 +  else                                                         \
1252 +    asm volatile ("nop /* asmnop */\n");
1253 +
1254 +#define m2(f)                                                  \
1255 +  if (f & 1)                                                   \
1256 +    asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");    \
1257 +  else                                                         \
1258 +    asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
1259 +
1260 +void
1261 +foo (void)
1262 +{
1263 +  m1 (f);
1264 +}
1265 +
1266 +void
1267 +bar (void)
1268 +{
1269 +  m2 (f);
1270 +}
1271 +
1272 +/* { dg-final { scan-assembler-times "asmnop" 2 } } */
1273 +/* { dg-final { cleanup-saved-temps } } */
1274 Index: gcc/testsuite/gnat.dg/opt13.adb
1275 ===================================================================
1276 --- gcc/testsuite/gnat.dg/opt13.adb     (.../tags/gcc_4_5_2_release)    (wersja 0)
1277 +++ gcc/testsuite/gnat.dg/opt13.adb     (.../branches/gcc-4_5-branch)   (wersja 169176)
1278 @@ -0,0 +1,13 @@
1279 +-- { dg-do run }
1280 +-- { dg-options "-O" }
1281 +
1282 +with Opt13_Pkg; use Opt13_Pkg;
1283 +
1284 +procedure Opt13 is
1285 +  T : My_Type;
1286 +begin
1287 +  Allocate (T);
1288 +  if N /= 1 then
1289 +    raise Program_Error;
1290 +  end if;
1291 +end;
1292 Index: gcc/testsuite/gnat.dg/opt13_pkg.adb
1293 ===================================================================
1294 --- gcc/testsuite/gnat.dg/opt13_pkg.adb (.../tags/gcc_4_5_2_release)    (wersja 0)
1295 +++ gcc/testsuite/gnat.dg/opt13_pkg.adb (.../branches/gcc-4_5-branch)   (wersja 169176)
1296 @@ -0,0 +1,31 @@
1297 +package body Opt13_Pkg is
1298 +
1299 +  subtype Index_Type is Natural range 0 .. 16;
1300 +
1301 +  type Arr is array (Index_Type range <>) of Integer;
1302 +
1303 +  type Rec is record
1304 +    F1, F2, F3 : Float;
1305 +    N : Natural;
1306 +    B1, B2 : Boolean;
1307 +    F4 : Float;
1308 +  end record;
1309 +
1310 +  type Data (D : Index_Type) is record
1311 +    A : Arr (1 .. D);
1312 +    R : Rec;
1313 +  end record;
1314 +
1315 +  Zero : constant Rec := (0.0, 0.0, 0.0, 0, False, False, 0.0);
1316 +
1317 +  procedure Allocate (T : out My_Type) is
1318 +  begin
1319 +    T := new Data (Index_Type'last);
1320 +    T.R := Zero;
1321 +
1322 +    for I in 1 .. T.A'last loop
1323 +      N := 1;
1324 +    end loop;
1325 +  end;
1326 +
1327 +end Opt13_Pkg;
1328 Index: gcc/testsuite/gnat.dg/opt13_pkg.ads
1329 ===================================================================
1330 --- gcc/testsuite/gnat.dg/opt13_pkg.ads (.../tags/gcc_4_5_2_release)    (wersja 0)
1331 +++ gcc/testsuite/gnat.dg/opt13_pkg.ads (.../branches/gcc-4_5-branch)   (wersja 169176)
1332 @@ -0,0 +1,15 @@
1333 +package Opt13_Pkg is
1334 +
1335 +    N : Natural := 0;
1336 +
1337 +    type My_Type is private;
1338 +
1339 +    procedure Allocate (T : out My_Type);
1340 +
1341 +private
1342 +
1343 +    type Data;
1344 +
1345 +    type My_Type is access Data;
1346 +
1347 +end Opt13_Pkg;
1348 Index: gcc/testsuite/gcc.dg/pr47201.c
1349 ===================================================================
1350 --- gcc/testsuite/gcc.dg/pr47201.c      (.../tags/gcc_4_5_2_release)    (wersja 0)
1351 +++ gcc/testsuite/gcc.dg/pr47201.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
1352 @@ -0,0 +1,18 @@
1353 +/* PR target/47201 */
1354 +/* { dg-do compile } */
1355 +/* { dg-options "-O -fpic -g" { target fpic } } */
1356 +
1357 +union U
1358 +{
1359 +  __UINTPTR_TYPE__ m;
1360 +  float d;
1361 +} u;
1362 +
1363 +int
1364 +foo (void)
1365 +{
1366 +  union U v = {
1367 +    (__UINTPTR_TYPE__)&u
1368 +  };
1369 +  return u.d == v.d;
1370 +}
1371 Index: gcc/testsuite/gcc.dg/pr46893.c
1372 ===================================================================
1373 --- gcc/testsuite/gcc.dg/pr46893.c      (.../tags/gcc_4_5_2_release)    (wersja 0)
1374 +++ gcc/testsuite/gcc.dg/pr46893.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
1375 @@ -0,0 +1,13 @@
1376 +/* PR debug/46893 */
1377 +/* { dg-do compile } */
1378 +/* { dg-options "-O -g" } */
1379 +
1380 +void
1381 +foo (void)
1382 +{
1383 +  union { unsigned long long l; double d; } u = { 0x7ff0000000000000ULL };
1384 +  double v = 0, w = -u.d;
1385 +
1386 +  if (w)
1387 +    w = v;
1388 +}
1389 Index: gcc/testsuite/gcc.dg/20061124-1.c
1390 ===================================================================
1391 --- gcc/testsuite/gcc.dg/20061124-1.c   (.../tags/gcc_4_5_2_release)    (wersja 169176)
1392 +++ gcc/testsuite/gcc.dg/20061124-1.c   (.../branches/gcc-4_5-branch)   (wersja 169176)
1393 @@ -1,5 +1,6 @@
1394  /* { dg-do run } */
1395  /* { dg-require-effective-target sync_char_short } */
1396 +/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
1397  
1398  /* This testcase failed on s390 because no compare instruction for
1399     the check of FLAG was emitted.  */
1400 Index: gcc/testsuite/gcc.dg/debug/pr46782.c
1401 ===================================================================
1402 --- gcc/testsuite/gcc.dg/debug/pr46782.c        (.../tags/gcc_4_5_2_release)    (wersja 0)
1403 +++ gcc/testsuite/gcc.dg/debug/pr46782.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
1404 @@ -0,0 +1,11 @@
1405 +/* PR debug/46782 */
1406 +/* { dg-do compile } */
1407 +/* { dg-options "-w -O0 -fvar-tracking -fcompare-debug" } */
1408 +
1409 +void foo (int i)
1410 +{
1411 +  if (i)
1412 +    i++;
1413 +  while (i)
1414 +    ;
1415 +}
1416 Index: gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c
1417 ===================================================================
1418 --- gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c      (.../tags/gcc_4_5_2_release)    (wersja 0)
1419 +++ gcc/testsuite/gcc.dg/graphite/run-id-pr46758.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
1420 @@ -0,0 +1,18 @@
1421 +int
1422 +movegt (int y, long long a)
1423 +{
1424 +  int i;
1425 +  int ret = 0;
1426 +  for (i = 0; i < y; i++)
1427 +    if (a == -1LL << 33)
1428 +      ret = -1;
1429 +  return ret;
1430 +}
1431 +
1432 +int
1433 +main ()
1434 +{
1435 +  if (movegt (1, -1LL << 33) != -1)
1436 +    __builtin_abort ();
1437 +  return 0;
1438 +}
1439 Index: gcc/testsuite/gcc.dg/graphite/pr45552.c
1440 ===================================================================
1441 --- gcc/testsuite/gcc.dg/graphite/pr45552.c     (.../tags/gcc_4_5_2_release)    (wersja 0)
1442 +++ gcc/testsuite/gcc.dg/graphite/pr45552.c     (.../branches/gcc-4_5-branch)   (wersja 169176)
1443 @@ -0,0 +1,46 @@
1444 +typedef struct
1445 +{
1446 +  double z;
1447 +} Vector;
1448 +typedef struct
1449 +{
1450 +  float *vertex;
1451 +  float *normal;
1452 +} VertexArray;
1453 +typedef struct
1454 +{
1455 +  Vector *vertex;
1456 +  int num_vertex;
1457 +} ObjectSmooth;
1458 +typedef struct
1459 +{
1460 +  int num_cells;
1461 +} State;
1462 +static void *array_from_ObjectSmooth( ObjectSmooth *obj )
1463 +{
1464 +  int i, j;
1465 +  VertexArray *array = (VertexArray *) __builtin_malloc( sizeof( VertexArray ) );
1466 +  array->vertex = (float *) __builtin_malloc( 3*sizeof(float)*obj->num_vertex );
1467 +  array->normal = (float *) __builtin_malloc( 3*sizeof(float)*obj->num_vertex );
1468 +  for (i=0, j=0; i<obj->num_vertex; ++i) {
1469 +    array->normal[j++] = 9;
1470 +    array->vertex[j] = obj->vertex[i].z;
1471 +    array->normal[j++] = 1;
1472 +  }
1473 +}
1474 +static void draw_cell( void )
1475 +{
1476 +  glCallList( array_from_ObjectSmooth( (ObjectSmooth *) __builtin_malloc(10) ));
1477 +}
1478 +static int render( State *st)
1479 +{
1480 +  int b;
1481 +  for (b=0; b<st->num_cells; ++b) {
1482 +    draw_cell();
1483 +    draw_cell();
1484 +  }
1485 +}
1486 +reshape_glcells( int width, int height )
1487 +{
1488 +  render( 0 );
1489 +}
1490 Index: gcc/testsuite/gcc.dg/torture/pr47365.c
1491 ===================================================================
1492 --- gcc/testsuite/gcc.dg/torture/pr47365.c      (.../tags/gcc_4_5_2_release)    (wersja 0)
1493 +++ gcc/testsuite/gcc.dg/torture/pr47365.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
1494 @@ -0,0 +1,39 @@
1495 +/* { dg-do run } */
1496 +
1497 +struct A
1498 +{
1499 +  int i;
1500 +};
1501 +
1502 +struct B
1503 +{
1504 +  struct A a[2];
1505 +};
1506 +
1507 +int i = 1;
1508 +struct B b = { 0, 3 };
1509 +
1510 +static void
1511 +test ()
1512 +{
1513 +  if (b.a[0].i != i)
1514 +    {
1515 +      int t = b.a[0].i;
1516 +      b.a[0] = b.a[1];
1517 +      b.a[1].i = t;
1518 +    }
1519 +
1520 +  if (b.a[1].i == i)
1521 +    __builtin_abort ();
1522 +
1523 +  if (b.a[0].i == 0)
1524 +    __builtin_abort ();
1525 +}
1526 +
1527 +int
1528 +main ()
1529 +{
1530 +  test ();
1531 +  return 0;
1532 +}
1533 +
1534 Index: gcc/testsuite/gcc.dg/tree-ssa/pr47392.c
1535 ===================================================================
1536 --- gcc/testsuite/gcc.dg/tree-ssa/pr47392.c     (.../tags/gcc_4_5_2_release)    (wersja 0)
1537 +++ gcc/testsuite/gcc.dg/tree-ssa/pr47392.c     (.../branches/gcc-4_5-branch)   (wersja 169176)
1538 @@ -0,0 +1,42 @@
1539 +/* { dg-do run } */
1540 +/* { dg-options "-O2 -fdump-tree-pre-stats" } */
1541 +
1542 +struct A
1543 +{
1544 +  int i;
1545 +};
1546 +
1547 +struct B
1548 +{
1549 +  struct A a[2];
1550 +};
1551 +
1552 +int i = 1;
1553 +struct B b = { 0, 3 };
1554 +
1555 +static void
1556 +test ()
1557 +{
1558 +  if (b.a[0].i != i)
1559 +    {
1560 +      int t = b.a[0].i;
1561 +      b.a[0] = b.a[1];
1562 +      b.a[1].i = t;
1563 +    }
1564 +
1565 +  if (b.a[1].i == i)
1566 +    __builtin_abort ();
1567 +
1568 +  if (b.a[0].i == 0)
1569 +    __builtin_abort ();
1570 +}
1571 +
1572 +int
1573 +main ()
1574 +{
1575 +  test ();
1576 +  return 0;
1577 +}
1578 +
1579 +/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */
1580 +/* { dg-final { cleanup-tree-dump "pre" } } */
1581 Index: gcc/testsuite/gcc.dg/tree-ssa/pr47286.c
1582 ===================================================================
1583 --- gcc/testsuite/gcc.dg/tree-ssa/pr47286.c     (.../tags/gcc_4_5_2_release)    (wersja 0)
1584 +++ gcc/testsuite/gcc.dg/tree-ssa/pr47286.c     (.../branches/gcc-4_5-branch)   (wersja 169176)
1585 @@ -0,0 +1,20 @@
1586 +/* { dg-do compile } */
1587 +/* { dg-skip-if "" { ! { i?86-*-* x86_64-*-* } } { "*" } { "" } } */
1588 +/* { dg-options "-O2 -fdump-tree-optimized" } */
1589 +
1590 +struct thread_info { int preempt_count; };
1591 +static inline struct thread_info *current_thread_info(void)
1592 +{
1593 +  register struct thread_info *sp asm("esp");
1594 +  return sp;
1595 +}
1596 +void testcase(void)
1597 +{
1598 +  current_thread_info()->preempt_count += 1;
1599 +}
1600 +
1601 +/* We have to make sure that alias analysis treats sp as pointing
1602 +   to globals and thus the store not optimized away.  */
1603 +
1604 +/* { dg-final { scan-tree-dump "->preempt_count =" "optimized" } } */
1605 +/* { dg-final { cleanup-tree-dump "optimized" } } */
1606 Index: gcc/testsuite/gcc.dg/pr28796-2.c
1607 ===================================================================
1608 --- gcc/testsuite/gcc.dg/pr28796-2.c    (.../tags/gcc_4_5_2_release)    (wersja 169176)
1609 +++ gcc/testsuite/gcc.dg/pr28796-2.c    (.../branches/gcc-4_5-branch)   (wersja 169176)
1610 @@ -2,6 +2,7 @@
1611  /* { dg-options "-O2 -funsafe-math-optimizations -fno-finite-math-only -DUNSAFE" } */
1612  /* { dg-add-options ieee } */
1613  /* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */
1614 +/* { dg-skip-if "Bug in _Q_dtoq" { sparc*-sun-solaris2.8 } } */
1615  
1616  #include "tg-tests.h"
1617  
1618 Index: gcc/testsuite/gcc.dg/vect/pr43430-1.c
1619 ===================================================================
1620 --- gcc/testsuite/gcc.dg/vect/pr43430-1.c       (.../tags/gcc_4_5_2_release)    (wersja 169176)
1621 +++ gcc/testsuite/gcc.dg/vect/pr43430-1.c       (.../branches/gcc-4_5-branch)   (wersja 169176)
1622 @@ -35,5 +35,5 @@
1623    return foo (data_ch1, data_ch2, 1);
1624  }
1625  
1626 -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
1627 +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */
1628  /* { dg-final { cleanup-tree-dump "vect" } } */
1629 Index: gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c
1630 ===================================================================
1631 --- gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
1632 +++ gcc/testsuite/gcc.dg/vect/slp-multitypes-2.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
1633 @@ -1,4 +1,5 @@
1634  /* { dg-require-effective-target vect_int } */
1635 +/* { dg-do run { xfail { sparc*-*-* && ilp32 } } } PR rtl-opt/46603 */
1636  
1637  #include <stdarg.h>
1638  #include <stdio.h>
1639 Index: gcc/testsuite/ChangeLog
1640 ===================================================================
1641 --- gcc/testsuite/ChangeLog     (.../tags/gcc_4_5_2_release)    (wersja 169176)
1642 +++ gcc/testsuite/ChangeLog     (.../branches/gcc-4_5-branch)   (wersja 169176)
1643 @@ -1,3 +1,176 @@
1644 +2011-01-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1645 +
1646 +       * gfortran.dg/cray_pointers_2.f90: Avoid cycling through
1647 +       optimization options.
1648 +
1649 +2011-01-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1650 +
1651 +       * gfortran.dg/array_constructor_33.f90: Use dg-timeout-factor 4.
1652 +
1653 +2011-01-21  Richard Guenther  <rguenther@suse.de>
1654 +
1655 +       PR tree-optimization/47365
1656 +       * gcc.dg/torture/pr47365.c: New testcase.
1657 +       * gcc.dg/tree-ssa/pr47392.c: Likewise.
1658 +
1659 +2011-01-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1660 +
1661 +       * g++.dg/other/anon5.C: Skip on mips-sgi-irix*.
1662 +
1663 +2011-01-17  Eric Botcazou  <ebotcazou@adacore.com>
1664 +
1665 +       Backport from mainline
1666 +       2010-11-22  Eric Botcazou  <ebotcazou@adacore.com>
1667 +
1668 +       * gcc.dg/pr28796-2.c: SKIP on SPARC/Solaris 8.
1669 +
1670 +       PR rtl-optimization/46603
1671 +       * gcc.dg/vect/slp-multitypes-2.c: XFAIL execution on SPARC 32-bit.
1672 +
1673 +       2010-08-31  Bingfeng Mei  <bmei@broadcom.com>
1674 +
1675 +       * gcc.dg/vect/pr43430-1.c: Requires vect_condition target.
1676 +
1677 +2011-01-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1678 +
1679 +       * g++.old-deja/g++.other/init19.C: Don't XFAIL on mips-sgi-irix*.
1680 +
1681 +2011-01-17  H.J. Lu  <hongjiu.lu@intel.com>
1682 +
1683 +       Backport from mainline
1684 +       2011-01-17  H.J. Lu  <hongjiu.lu@intel.com>
1685 +
1686 +       PR target/47318
1687 +       * gcc.target/i386/avx-vmaskmovpd-1.c: New.
1688 +       * gcc.target/i386/avx-vmaskmovpd-2.c: Likewise.
1689 +       * gcc.target/i386/avx-vmaskmovps-1.c: Likewise.
1690 +       * gcc.target/i386/avx-vmaskmovps-1.c: Likewise.
1691 +
1692 +       * gcc.target/i386/avx-vmaskmovpd-256-1.c (avx_test): Load mask
1693 +       as __m256i.
1694 +       * gcc.target/i386/avx-vmaskmovpd-256-2.c (avx_test): Likewise.
1695 +       * gcc.target/i386/avx-vmaskmovps-256-1.c (avx_test): Likewise.
1696 +       * gcc.target/i386/avx-vmaskmovps-256-2.c (avx_test): Likewise.
1697 +
1698 +2011-01-17  Richard Guenther  <rguenther@suse.de>
1699 +
1700 +       Backport from mainline
1701 +       PR tree-optimization/47286
1702 +       * gcc.dg/tree-ssa/pr47286.c: New testcase.
1703 +
1704 +       PR tree-optimization/44592
1705 +       * gfortran.dg/pr44592.f90: New testcase.
1706 +
1707 +2011-01-16  Jakub Jelinek  <jakub@redhat.com>
1708 +
1709 +       Backport from mainline
1710 +       2011-01-07  Jakub Jelinek  <jakub@redhat.com>
1711 +
1712 +       PR target/47201
1713 +       * gcc.dg/pr47201.c: New test.
1714 +
1715 +       2011-01-06  Jakub Jelinek  <jakub@redhat.com>
1716 +
1717 +       PR c/47150
1718 +       * gcc.c-torture/compile/pr47150.c: New test.
1719 +
1720 +       2010-12-21  Jakub Jelinek  <jakub@redhat.com>
1721 +
1722 +       PR target/46880
1723 +       * gcc.target/i386/pr46880.c: New test.
1724 +
1725 +       PR middle-end/45852
1726 +       * gcc.target/i386/pr45852.c: New test.
1727 +
1728 +       2010-12-16  Jakub Jelinek  <jakub@redhat.com>
1729 +
1730 +       PR tree-optimization/43655
1731 +       * g++.dg/opt/pr43655.C: New test.
1732 +
1733 +       PR debug/46893
1734 +       * gcc.dg/pr46893.c: New test.
1735 +
1736 +       2010-12-10  Jakub Jelinek  <jakub@redhat.com>
1737 +
1738 +       PR rtl-optimization/46804
1739 +       * gfortran.dg/pr46804.f90: New test.
1740 +
1741 +       PR rtl-optimization/46865
1742 +       * gcc.target/i386/pr46865-1.c: New test.
1743 +       * gcc.target/i386/pr46865-2.c: New test.
1744 +
1745 +       PR tree-optimization/46864
1746 +       * g++.dg/opt/pr46864.C: New test.
1747 +
1748 +2011-01-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1749 +
1750 +       * gfortran.dg/cray_pointers_2.f90: Use dg-timeout-factor 4.
1751 +
1752 +2011-01-12  Eric Botcazou  <ebotcazou@adacore.com>
1753 +
1754 +       PR testsuite/33033
1755 +       * gcc.dg/20061124-1.c: Pass -mcpu=v9 on the SPARC.
1756 +
1757 +2011-02-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
1758 +
1759 +       Backport from mainline
1760 +       PR fortran/45338
1761 +       * gfortran.dg/userdef_operator_2.f90:  New test case.
1762 +
1763 +2010-12-27  Yao Qi  <yao@codesourcery.com>
1764 +
1765 +       Backport from mainline:
1766 +       2010-10-14  Yao Qi  <yao@codesourcery.com>
1767 +
1768 +       PR target/45447
1769 +       * gcc.target/arm/pr45447.c: New test.
1770 +
1771 +2010-12-24  Eric Botcazou  <ebotcazou@adacore.com>
1772 +
1773 +       * gnat.dg/opt13_pkg.ad[sb]: Fix line ending.
1774 +
1775 +2010-12-22  Sebastian Pop  <sebastian.pop@amd.com>
1776 +
1777 +       PR tree-optimization/46758
1778 +       * gcc.dg/graphite/run-id-pr46758.c: New.
1779 +
1780 +2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
1781 +
1782 +       PR tree-optimization/45552
1783 +       * gcc.dg/graphite/pr45552.c
1784 +
1785 +
1786 +2010-12-23  Sebastian Pop  <sebastian.pop@amd.com>
1787 +
1788 +       PR tree-optimization/43023
1789 +       * gfortran.dg/ldist-1.f90: Adjust pattern.
1790 +       * gfortran.dg/ldist-pr43023.f90: New.
1791 +
1792 +2010-12-21  Martin Jambor  <mjambor@suse.cz>
1793 +
1794 +       PR middle-end/46734
1795 +       * g++.dg/tree-ssa/pr46734.C: New test.
1796 +
1797 +2010-12-18  Alexandre Oliva  <aoliva@redhat.com>
1798 +
1799 +       PR debug/46756
1800 +       * gfortran.dg/debug/pr46756.f: New.
1801 +
1802 +2010-12-18  Alexandre Oliva  <aoliva@redhat.com>
1803 +
1804 +       PR debug/46782
1805 +       * gcc.dg/debug/pr46782.c: New.
1806 +
1807 +2010-12-17  Daniel Kraft  <d@domob.eu>
1808 +
1809 +       PR fortran/46794
1810 +       * gfortran.dg/power2.f90: Initialize variables.
1811 +
1812 +2010-12-16  Eric Botcazou  <ebotcazou@adacore.com>
1813 +
1814 +       * gnat.dg/opt13.adb: New test.
1815 +       * gnat.dg/opt13_pkg.ad[sb]: New helper.
1816 +
1817  2010-12-16  Release Manager
1818  
1819         * GCC 4.5.2 released.
1820 Index: gcc/testsuite/g++.old-deja/g++.other/init19.C
1821 ===================================================================
1822 --- gcc/testsuite/g++.old-deja/g++.other/init19.C       (.../tags/gcc_4_5_2_release)    (wersja 169176)
1823 +++ gcc/testsuite/g++.old-deja/g++.other/init19.C       (.../branches/gcc-4_5-branch)   (wersja 169176)
1824 @@ -1,4 +1,4 @@
1825 -// { dg-do run { xfail { { ! cxa_atexit } && { ! *-*-solaris2* } } } }
1826 +// { dg-do run { xfail { { ! cxa_atexit } && { ! { mips-sgi-irix* *-*-solaris2* } } } } }
1827  #include <stdlib.h>
1828  
1829  #define assert(x) do { if (! (x)) abort(); } while (0)
1830 Index: gcc/testsuite/g++.dg/other/anon5.C
1831 ===================================================================
1832 --- gcc/testsuite/g++.dg/other/anon5.C  (.../tags/gcc_4_5_2_release)    (wersja 169176)
1833 +++ gcc/testsuite/g++.dg/other/anon5.C  (.../branches/gcc-4_5-branch)   (wersja 169176)
1834 @@ -1,5 +1,5 @@
1835  // PR c++/34094
1836 -// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* alpha*-dec-osf* } } } }
1837 +// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* alpha*-dec-osf* mips-sgi-irix* } } } }
1838  // { dg-options "-g" }
1839  
1840  namespace {
1841 Index: gcc/testsuite/g++.dg/tree-ssa/pr46734.C
1842 ===================================================================
1843 --- gcc/testsuite/g++.dg/tree-ssa/pr46734.C     (.../tags/gcc_4_5_2_release)    (wersja 0)
1844 +++ gcc/testsuite/g++.dg/tree-ssa/pr46734.C     (.../branches/gcc-4_5-branch)   (wersja 169176)
1845 @@ -0,0 +1,34 @@
1846 +/* { dg-do compile } */
1847 +/* { dg-options "-O -fipa-sra" } */
1848 +
1849 +struct A
1850 +{
1851 +  int *p;
1852 +  A() {p = (int *) -1;}
1853 +  ~A() {if (p && p != (int *) -1) *p = 0;}
1854 +};
1855 +
1856 +struct B
1857 +{
1858 +  A a;
1859 +  char data[23];
1860 +  B() : a() {data[0] = 0;}
1861 +};
1862 +
1863 +extern A ga;
1864 +extern int *gi;
1865 +extern void *gz;
1866 +extern B *gb;
1867 +
1868 +static int * __attribute__ ((noinline)) foo (B *b, void *z)
1869 +{
1870 +  __builtin_memcpy (gz, z, 28);
1871 +  ga = b->a;
1872 +  return b->a.p;
1873 +}
1874 +
1875 +int *bar (B *b, void *z)
1876 +{
1877 +  gb = b;
1878 +  return foo (b, z);
1879 +}
1880 Index: gcc/testsuite/g++.dg/opt/pr43655.C
1881 ===================================================================
1882 --- gcc/testsuite/g++.dg/opt/pr43655.C  (.../tags/gcc_4_5_2_release)    (wersja 0)
1883 +++ gcc/testsuite/g++.dg/opt/pr43655.C  (.../branches/gcc-4_5-branch)   (wersja 169176)
1884 @@ -0,0 +1,34 @@
1885 +// PR tree-optimization/43655
1886 +// { dg-do run }
1887 +// { dg-options "-O0 -ftree-ter" }
1888 +
1889 +extern "C" void abort ();
1890 +
1891 +struct C
1892 +{
1893 +  C (int i) : val(i) { }
1894 +  C (const C& c) : val(c.val) { }
1895 +  ~C (void) { val = 999; }
1896 +  C& operator = (const C& c) { val = c.val; return *this; }
1897 +  C& inc (int i) { val += i; return *this; }
1898 +  int val;
1899 +};
1900 +
1901 +C
1902 +f ()
1903 +{
1904 +  return C (3);
1905 +}
1906 +
1907 +C
1908 +f (int i)
1909 +{
1910 +  return f ().inc (i);
1911 +}
1912 +
1913 +int
1914 +main ()
1915 +{
1916 +  if (f (2).val != 5)
1917 +    abort ();
1918 +}
1919 Index: gcc/testsuite/g++.dg/opt/pr46864.C
1920 ===================================================================
1921 --- gcc/testsuite/g++.dg/opt/pr46864.C  (.../tags/gcc_4_5_2_release)    (wersja 0)
1922 +++ gcc/testsuite/g++.dg/opt/pr46864.C  (.../branches/gcc-4_5-branch)   (wersja 169176)
1923 @@ -0,0 +1,26 @@
1924 +// PR tree-optimization/46864
1925 +// { dg-do compile }
1926 +// { dg-options "-O -fnon-call-exceptions" }
1927 +
1928 +int baz ();
1929 +
1930 +struct S
1931 +{
1932 +  int k;
1933 +  bool bar () throw ()
1934 +  {
1935 +    int m = baz ();
1936 +    for (int i = 0; i < m; i++)
1937 +      k = i;
1938 +    return m;
1939 +  }
1940 +};
1941 +
1942 +extern S *s;
1943 +
1944 +void
1945 +foo ()
1946 +{
1947 +  while (baz () && s->bar ())
1948 +    ;
1949 +}
1950 Index: gcc/testsuite/gfortran.dg/ldist-1.f90
1951 ===================================================================
1952 --- gcc/testsuite/gfortran.dg/ldist-1.f90       (.../tags/gcc_4_5_2_release)    (wersja 169176)
1953 +++ gcc/testsuite/gfortran.dg/ldist-1.f90       (.../branches/gcc-4_5-branch)   (wersja 169176)
1954 @@ -29,5 +29,8 @@
1955    return
1956  end Subroutine PADEC
1957  
1958 -! { dg-final { scan-tree-dump-times "distributed: split to 4 loops" 1 "ldist" } }
1959 +! There are 5 legal partitions in this code.  Based on the data
1960 +! locality heuristic, this loop should not be split.
1961 +
1962 +! { dg-final { scan-tree-dump-not "distributed: split to" "ldist" } }
1963  ! { dg-final { cleanup-tree-dump "ldist" } }
1964 Index: gcc/testsuite/gfortran.dg/debug/pr46756.f
1965 ===================================================================
1966 --- gcc/testsuite/gfortran.dg/debug/pr46756.f   (.../tags/gcc_4_5_2_release)    (wersja 0)
1967 +++ gcc/testsuite/gfortran.dg/debug/pr46756.f   (.../branches/gcc-4_5-branch)   (wersja 169176)
1968 @@ -0,0 +1,29 @@
1969 +C PR debug/46756, reduced from ../20010519-1.f
1970 +C { dg-do compile }
1971 +C { dg-options "-O -fcompare-debug" }
1972 +      LOGICAL QDISK,QDW,QCMPCT
1973 +      LOGICAL LNOMA,LRAISE,LSCI,LBIG
1974 +      ASSIGN 801 TO I800 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
1975 +      GOTO 800
1976 + 801  CONTINUE
1977 +      ASSIGN 761 TO I760 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
1978 + 761  CONTINUE
1979 +      IF(LSCI) THEN
1980 +         DO I=1,LENCM
1981 +         ENDDO
1982 +      ENDIF
1983 +      DO WHILE((CVGMX.GT.TOLDIM).AND.(ITER.LT.ITMX))
1984 +         IF(.NOT.QDW) THEN
1985 +            ASSIGN 641 to I640 ! { dg-warning "Deleted feature: ASSIGN" "Deleted feature: ASSIGN" }
1986 +            GOTO 640
1987 + 641        CONTINUE
1988 +         ENDIF
1989 +      ENDDO
1990 +      GOTO 700
1991 + 640  CONTINUE
1992 +      GOTO I640 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
1993 + 700  CONTINUE
1994 +      GOTO I760 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
1995 + 800  CONTINUE
1996 +      GOTO I800 ! { dg-warning "Deleted feature: Assigned" "Assigned GO TO" }
1997 +      END
1998 Index: gcc/testsuite/gfortran.dg/cray_pointers_2.f90
1999 ===================================================================
2000 --- gcc/testsuite/gfortran.dg/cray_pointers_2.f90       (.../tags/gcc_4_5_2_release)    (wersja 169176)
2001 +++ gcc/testsuite/gfortran.dg/cray_pointers_2.f90       (.../branches/gcc-4_5-branch)   (wersja 169176)
2002 @@ -1,5 +1,8 @@
2003 -! { dg-do run }
2004 -! { dg-options "-fcray-pointer -fbounds-check" }
2005 +! Using two spaces between dg-do and run is a hack to keep gfortran-dg-runtest
2006 +! from cycling through optimization options for this expensive test.
2007 +! { dg-do  run }
2008 +! { dg-options "-O3 -fcray-pointer -fbounds-check" }
2009 +! { dg-timeout-factor 4 }
2010  ! Series of routines for testing a Cray pointer implementation
2011  program craytest
2012    common /errors/errors(400)
2013 Index: gcc/testsuite/gfortran.dg/dependency_39.f90
2014 ===================================================================
2015 --- gcc/testsuite/gfortran.dg/dependency_39.f90 (.../tags/gcc_4_5_2_release)    (wersja 0)
2016 +++ gcc/testsuite/gfortran.dg/dependency_39.f90 (.../branches/gcc-4_5-branch)   (wersja 169176)
2017 @@ -0,0 +1,37 @@
2018 +! { dg-do run }
2019 +! PR 45777 - component ref aliases when both are pointers
2020 +module m1
2021 +  type t1
2022 +     integer, dimension(:), allocatable :: data
2023 +  end type t1
2024 +contains
2025 +  subroutine s1(t,d)
2026 +    integer, dimension(:), pointer :: d
2027 +    type(t1), pointer :: t
2028 +    d(1:5)=t%data(3:7)
2029 +  end subroutine s1
2030 +  subroutine s2(d,t)
2031 +    integer, dimension(:), pointer :: d
2032 +    type(t1), pointer :: t
2033 +    t%data(3:7) = d(1:5)
2034 +  end subroutine s2
2035 +end module m1
2036 +
2037 +program main
2038 +  use m1
2039 +  type(t1), pointer :: t
2040 +  integer, dimension(:), pointer :: d
2041 +  allocate(t)
2042 +  allocate(t%data(10))
2043 +  t%data=(/(i,i=1,10)/)
2044 +  d=>t%data(5:9)
2045 +  call s1(t,d)
2046 +  if (any(d.ne.(/3,4,5,6,7/))) call abort()
2047 +  t%data=(/(i,i=1,10)/)
2048 +  d=>t%data(1:5)
2049 +  call s2(d,t)
2050 +  if (any(t%data.ne.(/1,2,1,2,3,4,5,8,9,10/))) call abort
2051 +  deallocate(t%data)
2052 +  deallocate(t)
2053 +end program main
2054 +! { dg-final { cleanup-modules "m1" } }
2055 Index: gcc/testsuite/gfortran.dg/ldist-pr43023.f90
2056 ===================================================================
2057 --- gcc/testsuite/gfortran.dg/ldist-pr43023.f90 (.../tags/gcc_4_5_2_release)    (wersja 0)
2058 +++ gcc/testsuite/gfortran.dg/ldist-pr43023.f90 (.../branches/gcc-4_5-branch)   (wersja 169176)
2059 @@ -0,0 +1,31 @@
2060 +! { dg-do compile }
2061 +! { dg-options "-O2 -ftree-loop-distribution" }
2062 +
2063 +MODULE NFT_mod
2064 +
2065 +implicit none
2066 +integer :: Nangle
2067 +real:: Z0
2068 +real, dimension(:,:), allocatable :: Angle
2069 +real, dimension(:), allocatable :: exth, ezth, hxth, hyth, hyphi
2070 +
2071 +CONTAINS
2072 +
2073 +SUBROUTINE NFT_Init()
2074 +
2075 +real :: th, fi
2076 +integer :: n
2077 +
2078 +do n = 1,Nangle
2079 +  th = Angle(n,1)
2080 +  fi = Angle(n,2)
2081 +
2082 +  exth(n) =  cos(fi)*cos(th)
2083 +  ezth(n) = -sin(th)
2084 +  hxth(n) = -sin(fi)
2085 +  hyth(n) =  cos(fi)
2086 +  hyphi(n) = -sin(fi)
2087 +end do
2088 +END SUBROUTINE NFT_Init
2089 +
2090 +END MODULE NFT_mod
2091 Index: gcc/testsuite/gfortran.dg/pr44592.f90
2092 ===================================================================
2093 --- gcc/testsuite/gfortran.dg/pr44592.f90       (.../tags/gcc_4_5_2_release)    (wersja 0)
2094 +++ gcc/testsuite/gfortran.dg/pr44592.f90       (.../branches/gcc-4_5-branch)   (wersja 169176)
2095 @@ -0,0 +1,20 @@
2096 +! { dg-do run }
2097 +! { dg-options "-O3" }
2098 +! From forall_12.f90
2099 +! Fails with loop reversal at -O3
2100 +!
2101 +  character(len=1) :: b(4) = (/"1","2","3","4"/), c(4)
2102 +  c = b
2103 +  i = 1
2104 +  ! This statement must be here for the abort below
2105 +  b(1:3)(i:i) = b(2:4)(i:i)
2106 +
2107 +  b = c
2108 +  b(4:2:-1)(i:i) = b(3:1:-1)(i:i)
2109 +
2110 +  ! This fails.  If the condition is printed, the result is F F F F
2111 +  if (any (b .ne. (/"1","1","2","3"/))) i = 2
2112 +  print *, b
2113 +  print *, b .ne. (/"1","1","2","3"/)
2114 +  if (i == 2) call abort
2115 +end
2116 Index: gcc/testsuite/gfortran.dg/userdef_operator_2.f90
2117 ===================================================================
2118 --- gcc/testsuite/gfortran.dg/userdef_operator_2.f90    (.../tags/gcc_4_5_2_release)    (wersja 0)
2119 +++ gcc/testsuite/gfortran.dg/userdef_operator_2.f90    (.../branches/gcc-4_5-branch)   (wersja 169176)
2120 @@ -0,0 +1,17 @@
2121 +! { dg-do compile }
2122 +! PR 45338 - no ICE when cmp is not used explicitly.
2123 +! Test case by Simon Smart 
2124 +module test_mod
2125 +  implicit none
2126 +contains
2127 +  subroutine test_fn (cmp)
2128 +    interface operator(.myop.)
2129 +       pure function cmp (a, b) result(ret)
2130 +         integer, intent(in) :: a, b
2131 +         logical ret
2132 +       end function cmp
2133 +    end interface
2134 +    integer :: a, b
2135 +    print*, a .myop. b
2136 +  end subroutine test_fn
2137 +end module test_mod
2138 Index: gcc/testsuite/gfortran.dg/array_constructor_33.f90
2139 ===================================================================
2140 --- gcc/testsuite/gfortran.dg/array_constructor_33.f90  (.../tags/gcc_4_5_2_release)    (wersja 169176)
2141 +++ gcc/testsuite/gfortran.dg/array_constructor_33.f90  (.../branches/gcc-4_5-branch)   (wersja 169176)
2142 @@ -1,4 +1,5 @@
2143  ! { dg-do compile }
2144 +! { dg-timeout-factor 4 }
2145  ! PR20923 gfortran slow for large array constructors.
2146  ! Test case prepared from PR by Jerry DeLisle <jvdelisle@gcc.gnu.org>
2147  program sel
2148 Index: gcc/testsuite/gfortran.dg/pr46804.f90
2149 ===================================================================
2150 --- gcc/testsuite/gfortran.dg/pr46804.f90       (.../tags/gcc_4_5_2_release)    (wersja 0)
2151 +++ gcc/testsuite/gfortran.dg/pr46804.f90       (.../branches/gcc-4_5-branch)   (wersja 169176)
2152 @@ -0,0 +1,36 @@
2153 +! PR rtl-optimization/46804
2154 +! { dg-do run }
2155 +! { dg-options "-O -fPIC -fexpensive-optimizations -fgcse -foptimize-register-move -fpeel-loops -fno-tree-loop-optimize" }
2156 +
2157 +program main
2158 +  integer, parameter :: n1 = 2, n2 = 3, n3 = 4, slen = 3
2159 +  character (len = slen), dimension (n1, n2, n3) :: a
2160 +  integer (kind = 1), dimension (2, 4) :: shift1
2161 +  integer (kind = 2), dimension (2, 4) :: shift2
2162 +  integer (kind = 4), dimension (2, 4) :: shift3
2163 +  do i3 = 1, n3
2164 +    do i2 = 1, n2
2165 +      do i1 = 1, n1
2166 +        a (i1, i2, i3) = 'ab'(i1:i1) // 'cde'(i2:i2) // 'fghi'(i3:i3)
2167 +      end do
2168 +    end do
2169 +  end do
2170 +  shift1 (1, :) = (/ 4, 11, 19, 20 /)
2171 +  shift1 (2, :) = (/ 55, 5, 1, 2 /)
2172 +  shift2 = shift1
2173 +  shift3 = shift1
2174 +  call test (cshift (a, shift2, 2))
2175 +  call test (cshift (a, shift3, 2))
2176 +contains
2177 +  subroutine test (b)
2178 +    character (len = slen), dimension (n1, n2, n3) :: b
2179 +    do i3 = 1, n3
2180 +      do i2 = 1, n2
2181 +        do i1 = 1, n1
2182 +          i2p = mod (shift1 (i1, i3) + i2 - 1, n2) + 1
2183 +          if (b (i1, i2, i3) .ne. a (i1, i2p, i3)) call abort
2184 +        end do
2185 +      end do
2186 +    end do
2187 +  end subroutine test
2188 +end program main
2189 Index: gcc/testsuite/gfortran.dg/power2.f90
2190 ===================================================================
2191 --- gcc/testsuite/gfortran.dg/power2.f90        (.../tags/gcc_4_5_2_release)    (wersja 169176)
2192 +++ gcc/testsuite/gfortran.dg/power2.f90        (.../branches/gcc-4_5-branch)   (wersja 169176)
2193 @@ -13,6 +13,9 @@
2194    INTEGER(KIND=1) :: k1
2195    INTEGER(KIND=2) :: k2
2196  
2197 +  k1 = 1_1
2198 +  k2 = 1_2
2199 +
2200    k1 = 1_1 + 1_1**k1
2201    k2 = 1_2 + 1_2**k2
2202  
2203 Index: gcc/tree-ssa-copyrename.c
2204 ===================================================================
2205 --- gcc/tree-ssa-copyrename.c   (.../tags/gcc_4_5_2_release)    (wersja 169176)
2206 +++ gcc/tree-ssa-copyrename.c   (.../branches/gcc-4_5-branch)   (wersja 169176)
2207 @@ -225,11 +225,16 @@
2208        ign2 = false;
2209      }
2210  
2211 -  /* Don't coalesce if the two variables are not of the same type.  */
2212 -  if (TREE_TYPE (root1) != TREE_TYPE (root2))
2213 +  /* Don't coalesce if the two variables aren't type compatible .  */
2214 +  if (!types_compatible_p (TREE_TYPE (root1), TREE_TYPE (root2))
2215 +      /* There is a disconnect between the middle-end type-system and
2216 +         VRP, avoid coalescing enum types with different bounds.  */
2217 +      || ((TREE_CODE (TREE_TYPE (root1)) == ENUMERAL_TYPE
2218 +          || TREE_CODE (TREE_TYPE (root2)) == ENUMERAL_TYPE)
2219 +         && TREE_TYPE (root1) != TREE_TYPE (root2)))
2220      {
2221        if (debug)
2222 -       fprintf (debug, " : Different types.  No coalesce.\n");
2223 +       fprintf (debug, " : Incompatible types.  No coalesce.\n");
2224        return false;
2225      }
2226  
2227 Index: gcc/tree-ssa-ccp.c
2228 ===================================================================
2229 --- gcc/tree-ssa-ccp.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
2230 +++ gcc/tree-ssa-ccp.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
2231 @@ -3355,7 +3355,9 @@
2232     is replaced.  If the call is expected to produces a result, then it
2233     is replaced by an assignment of the new RHS to the result variable.
2234     If the result is to be ignored, then the call is replaced by a
2235 -   GIMPLE_NOP.  */
2236 +   GIMPLE_NOP.  A proper VDEF chain is retained by making the first
2237 +   VUSE and the last VDEF of the whole sequence be the same as the replaced
2238 +   statement and using new SSA names for stores in between.  */
2239  
2240  static void
2241  gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
2242 @@ -3366,17 +3368,36 @@
2243    gimple_stmt_iterator i;
2244    gimple_seq stmts = gimple_seq_alloc();
2245    struct gimplify_ctx gctx;
2246 +  gimple last = NULL;
2247 +  gimple laststore = NULL;
2248 +  tree reaching_vuse;
2249  
2250    stmt = gsi_stmt (*si_p);
2251  
2252    gcc_assert (is_gimple_call (stmt));
2253  
2254    lhs = gimple_call_lhs (stmt);
2255 +  reaching_vuse = gimple_vuse (stmt);
2256  
2257    push_gimplify_context (&gctx);
2258  
2259    if (lhs == NULL_TREE)
2260 -    gimplify_and_add (expr, &stmts);
2261 +    {
2262 +      gimplify_and_add (expr, &stmts);
2263 +      /* We can end up with folding a memcpy of an empty class assignment
2264 +        which gets optimized away by C++ gimplification.  */
2265 +      if (gimple_seq_empty_p (stmts))
2266 +       {
2267 +         pop_gimplify_context (NULL);
2268 +         if (gimple_in_ssa_p (cfun))
2269 +           {
2270 +             unlink_stmt_vdef (stmt);
2271 +             release_defs (stmt);
2272 +           }
2273 +         gsi_remove (si_p, true);
2274 +         return;
2275 +       }
2276 +    }
2277    else
2278      tmp = get_initialized_tmp_var (expr, &stmts, NULL);
2279  
2280 @@ -3387,26 +3408,95 @@
2281  
2282    /* The replacement can expose previously unreferenced variables.  */
2283    for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i))
2284 -  {
2285 -    new_stmt = gsi_stmt (i);
2286 -    find_new_referenced_vars (new_stmt);
2287 -    gsi_insert_before (si_p, new_stmt, GSI_NEW_STMT);
2288 -    mark_symbols_for_renaming (new_stmt);
2289 -    gsi_next (si_p);
2290 -  }
2291 +    {
2292 +      if (last)
2293 +       {
2294 +         gsi_insert_before (si_p, last, GSI_NEW_STMT);
2295 +         gsi_next (si_p);
2296 +       }
2297 +      new_stmt = gsi_stmt (i);
2298 +      if (gimple_in_ssa_p (cfun))
2299 +       {
2300 +         find_new_referenced_vars (new_stmt);
2301 +         mark_symbols_for_renaming (new_stmt);
2302 +       }
2303 +      /* If the new statement has a VUSE, update it with exact SSA name we
2304 +         know will reach this one.  */
2305 +      if (gimple_vuse (new_stmt))
2306 +       {
2307 +         /* If we've also seen a previous store create a new VDEF for
2308 +            the latter one, and make that the new reaching VUSE.  */
2309 +         if (laststore)
2310 +           {
2311 +             reaching_vuse = make_ssa_name (gimple_vop (cfun), laststore);
2312 +             gimple_set_vdef (laststore, reaching_vuse);
2313 +             update_stmt (laststore);
2314 +             laststore = NULL;
2315 +           }
2316 +         gimple_set_vuse (new_stmt, reaching_vuse);
2317 +         gimple_set_modified (new_stmt, true);
2318 +       }
2319 +      if (gimple_assign_single_p (new_stmt)
2320 +         && !is_gimple_reg (gimple_assign_lhs (new_stmt)))
2321 +       {
2322 +         laststore = new_stmt;
2323 +       }
2324 +      last = new_stmt;
2325 +    }
2326  
2327    if (lhs == NULL_TREE)
2328      {
2329 -      new_stmt = gimple_build_nop ();
2330 -      unlink_stmt_vdef (stmt);
2331 -      release_defs (stmt);
2332 +      /* If we replace a call without LHS that has a VDEF and our new
2333 +         sequence ends with a store we must make that store have the same
2334 +        vdef in order not to break the sequencing.  This can happen
2335 +        for instance when folding memcpy calls into assignments.  */
2336 +      if (gimple_vdef (stmt) && laststore)
2337 +       {
2338 +         gimple_set_vdef (laststore, gimple_vdef (stmt));
2339 +         if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
2340 +           SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = laststore;
2341 +         update_stmt (laststore);
2342 +       }
2343 +      else if (gimple_in_ssa_p (cfun))
2344 +       {
2345 +         unlink_stmt_vdef (stmt);
2346 +         release_defs (stmt);
2347 +       }
2348 +      new_stmt = last;
2349      }
2350    else
2351      {
2352 +      if (last)
2353 +       {
2354 +         gsi_insert_before (si_p, last, GSI_NEW_STMT);
2355 +         gsi_next (si_p);
2356 +       }
2357 +      if (laststore && is_gimple_reg (lhs))
2358 +       {
2359 +         gimple_set_vdef (laststore, gimple_vdef (stmt));
2360 +         update_stmt (laststore);
2361 +         if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
2362 +           SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = laststore;
2363 +         laststore = NULL;
2364 +       }
2365 +      else if (laststore)
2366 +       {
2367 +         reaching_vuse = make_ssa_name (gimple_vop (cfun), laststore);
2368 +         gimple_set_vdef (laststore, reaching_vuse);
2369 +         update_stmt (laststore);
2370 +         laststore = NULL;
2371 +       }
2372        new_stmt = gimple_build_assign (lhs, tmp);
2373 -      gimple_set_vuse (new_stmt, gimple_vuse (stmt));
2374 -      gimple_set_vdef (new_stmt, gimple_vdef (stmt));
2375 -      move_ssa_defining_stmt_for_defs (new_stmt, stmt);
2376 +      if (!is_gimple_reg (tmp))
2377 +       gimple_set_vuse (new_stmt, reaching_vuse);
2378 +      if (!is_gimple_reg (lhs))
2379 +       {
2380 +         gimple_set_vdef (new_stmt, gimple_vdef (stmt));
2381 +         if (TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
2382 +           SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = new_stmt;
2383 +       }
2384 +      else if (reaching_vuse == gimple_vuse (stmt))
2385 +       unlink_stmt_vdef (stmt);
2386      }
2387  
2388    gimple_set_location (new_stmt, gimple_location (stmt));
2389 Index: gcc/xcoffout.c
2390 ===================================================================
2391 --- gcc/xcoffout.c      (.../tags/gcc_4_5_2_release)    (wersja 169176)
2392 +++ gcc/xcoffout.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
2393 @@ -81,8 +81,15 @@
2394  #define ASM_OUTPUT_LINE(FILE,LINENUM)                                     \
2395    do                                                                      \
2396      {                                                                     \
2397 +      /* Make sure we're in a function and prevent output of .line 0, as   \
2398 +        line # 0 is meant for symbol addresses in xcoff.  Additionally,   \
2399 +        line numbers are 'unsigned short' in 32-bit mode.  */             \
2400        if (xcoff_begin_function_line >= 0)                                 \
2401 -       fprintf (FILE, "\t.line\t%d\n", ABS_OR_RELATIVE_LINENO (LINENUM)); \
2402 +       {                                                                  \
2403 +         int lno = ABS_OR_RELATIVE_LINENO (LINENUM);                      \
2404 +         if (lno > 0 && (TARGET_64BIT || lno <= (int)USHRT_MAX))          \
2405 +           fprintf (FILE, "\t.line\t%d\n", lno);                          \
2406 +       }                                                                  \
2407      }                                                                     \
2408    while (0)
2409  
2410 Index: gcc/jump.c
2411 ===================================================================
2412 --- gcc/jump.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
2413 +++ gcc/jump.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
2414 @@ -194,7 +194,7 @@
2415    rtx prev_nonjump_insn = NULL;
2416  
2417    for (insn = f; insn; insn = NEXT_INSN (insn))
2418 -    if (INSN_P (insn))
2419 +    if (NONDEBUG_INSN_P (insn))
2420        {
2421         mark_jump_label (PATTERN (insn), insn, 0);
2422  
2423 @@ -1728,7 +1728,13 @@
2424  
2425         case 'i':
2426           if (XINT (x, i) != XINT (y, i))
2427 -           return 0;
2428 +           {
2429 +             if (((code == ASM_OPERANDS && i == 6)
2430 +                  || (code == ASM_INPUT && i == 1))
2431 +                 && locator_eq (XINT (x, i), XINT (y, i)))
2432 +               break;
2433 +             return 0;
2434 +           }
2435           break;
2436  
2437         case 't':
2438 Index: gcc/expr.c
2439 ===================================================================
2440 --- gcc/expr.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
2441 +++ gcc/expr.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
2442 @@ -4730,7 +4730,10 @@
2443        /* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
2444          but TARGET is not valid memory reference, TEMP will differ
2445          from TARGET although it is really the same location.  */
2446 -      && !(alt_rtl && rtx_equal_p (alt_rtl, target))
2447 +      && !(alt_rtl
2448 +          && rtx_equal_p (alt_rtl, target)
2449 +          && !side_effects_p (alt_rtl)
2450 +          && !side_effects_p (target))
2451        /* If there's nothing to copy, don't bother.  Don't call
2452          expr_size unless necessary, because some front-ends (C++)
2453          expr_size-hook must not be given objects that are not
2454 Index: gcc/ada/ChangeLog
2455 ===================================================================
2456 --- gcc/ada/ChangeLog   (.../tags/gcc_4_5_2_release)    (wersja 169176)
2457 +++ gcc/ada/ChangeLog   (.../branches/gcc-4_5-branch)   (wersja 169176)
2458 @@ -1,3 +1,9 @@
2459 +2011-01-04  Eric Botcazou  <ebotcazou@adacore.com>
2460 +
2461 +       * gcc-interface/trans.c (Subprogram_Body_to_gnu): Evaluate the
2462 +       expressions of the parameter cache within the statement group of
2463 +       the CICO mechanism.
2464 +
2465  2010-12-16  Release Manager
2466  
2467         * GCC 4.5.2 released.
2468 Index: gcc/ada/gcc-interface/trans.c
2469 ===================================================================
2470 --- gcc/ada/gcc-interface/trans.c       (.../tags/gcc_4_5_2_release)    (wersja 169176)
2471 +++ gcc/ada/gcc-interface/trans.c       (.../branches/gcc-4_5-branch)   (wersja 169176)
2472 @@ -2303,6 +2303,31 @@
2473    gnat_poplevel ();
2474    gnu_result = end_stmt_group ();
2475  
2476 +  /* If we populated the parameter attributes cache, we need to make sure that
2477 +     the cached expressions are evaluated on all the possible paths leading to
2478 +     their uses.  So we force their evaluation on entry of the function.  */
2479 +  cache = DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language->parm_attr_cache;
2480 +  if (cache)
2481 +    {
2482 +      struct parm_attr_d *pa;
2483 +      int i;
2484 +
2485 +      start_stmt_group ();
2486 +
2487 +      for (i = 0; VEC_iterate (parm_attr, cache, i, pa); i++)
2488 +       {
2489 +         if (pa->first)
2490 +           add_stmt_with_node (pa->first, gnat_node);
2491 +         if (pa->last)
2492 +           add_stmt_with_node (pa->last, gnat_node);
2493 +         if (pa->length)
2494 +           add_stmt_with_node (pa->length, gnat_node);
2495 +       }
2496 +
2497 +      add_stmt (gnu_result);
2498 +      gnu_result = end_stmt_group ();
2499 +    }
2500 +
2501    /* If we are dealing with a return from an Ada procedure with parameters
2502       passed by copy-in/copy-out, we need to return a record containing the
2503       final values of these parameters.  If the list contains only one entry,
2504 @@ -2341,30 +2366,6 @@
2505  
2506    pop_stack (&gnu_return_label_stack);
2507  
2508 -  /* If we populated the parameter attributes cache, we need to make sure
2509 -     that the cached expressions are evaluated on all possible paths.  */
2510 -  cache = DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language->parm_attr_cache;
2511 -  if (cache)
2512 -    {
2513 -      struct parm_attr_d *pa;
2514 -      int i;
2515 -
2516 -      start_stmt_group ();
2517 -
2518 -      for (i = 0; VEC_iterate (parm_attr, cache, i, pa); i++)
2519 -       {
2520 -         if (pa->first)
2521 -           add_stmt_with_node (pa->first, gnat_node);
2522 -         if (pa->last)
2523 -           add_stmt_with_node (pa->last, gnat_node);
2524 -         if (pa->length)
2525 -           add_stmt_with_node (pa->length, gnat_node);
2526 -       }
2527 -
2528 -      add_stmt (gnu_result);
2529 -      gnu_result = end_stmt_group ();
2530 -    }
2531 -
2532    /* Set the end location.  */
2533    Sloc_to_locus
2534      ((Present (End_Label (Handled_Statement_Sequence (gnat_node)))
2535 Index: gcc/fortran/trans-array.c
2536 ===================================================================
2537 --- gcc/fortran/trans-array.c   (.../tags/gcc_4_5_2_release)    (wersja 169176)
2538 +++ gcc/fortran/trans-array.c   (.../branches/gcc-4_5-branch)   (wersja 169176)
2539 @@ -3389,7 +3389,38 @@
2540      }
2541  }
2542  
2543 +/* Return true if both symbols could refer to the same data object.  Does
2544 +   not take account of aliasing due to equivalence statements.  */
2545  
2546 +static int
2547 +symbols_could_alias (gfc_symbol *lsym, gfc_symbol *rsym, bool lsym_pointer,
2548 +                    bool lsym_target, bool rsym_pointer, bool rsym_target)
2549 +{
2550 +  /* Aliasing isn't possible if the symbols have different base types.  */
2551 +  if (gfc_compare_types (&lsym->ts, &rsym->ts) == 0)
2552 +    return 0;
2553 +
2554 +  /* Pointers can point to other pointers and target objects.  */
2555 +
2556 +  if ((lsym_pointer && (rsym_pointer || rsym_target))
2557 +      || (rsym_pointer && (lsym_pointer || lsym_target)))
2558 +    return 1;
2559 +
2560 +  /* Special case: Argument association, cf. F90 12.4.1.6, F2003 12.4.1.7
2561 +     and F2008 12.5.2.13 items 3b and 4b. The pointer case (a) is already
2562 +     checked above.  */
2563 +  if (lsym->attr.target && rsym->attr.target
2564 +      && ((lsym->attr.dummy
2565 +          && (!lsym->attr.dimension || lsym->as->type == AS_ASSUMED_SHAPE))
2566 +         || (rsym->attr.dummy
2567 +             && (!rsym->attr.dimension
2568 +                 || rsym->as->type == AS_ASSUMED_SHAPE))))
2569 +    return 1;
2570 +
2571 +  return 0;
2572 +}
2573 +
2574 +
2575  /* Return true if the two SS could be aliased, i.e. both point to the same data
2576     object.  */
2577  /* TODO: resolve aliases based on frontend expressions.  */
2578 @@ -3401,10 +3432,18 @@
2579    gfc_ref *rref;
2580    gfc_symbol *lsym;
2581    gfc_symbol *rsym;
2582 +  bool lsym_pointer, lsym_target, rsym_pointer, rsym_target;
2583  
2584    lsym = lss->expr->symtree->n.sym;
2585    rsym = rss->expr->symtree->n.sym;
2586 -  if (gfc_symbols_could_alias (lsym, rsym))
2587 +
2588 +  lsym_pointer = lsym->attr.pointer;
2589 +  lsym_target = lsym->attr.target;
2590 +  rsym_pointer = rsym->attr.pointer;
2591 +  rsym_target = rsym->attr.target;
2592 +
2593 +  if (symbols_could_alias (lsym, rsym, lsym_pointer, lsym_target,
2594 +                          rsym_pointer, rsym_target))
2595      return 1;
2596  
2597    if (rsym->ts.type != BT_DERIVED
2598 @@ -3419,27 +3458,75 @@
2599        if (lref->type != REF_COMPONENT)
2600         continue;
2601  
2602 -      if (gfc_symbols_could_alias (lref->u.c.sym, rsym))
2603 +      lsym_pointer = lsym_pointer || lref->u.c.sym->attr.pointer;
2604 +      lsym_target  = lsym_target  || lref->u.c.sym->attr.target;
2605 +
2606 +      if (symbols_could_alias (lref->u.c.sym, rsym, lsym_pointer, lsym_target,
2607 +                              rsym_pointer, rsym_target))
2608         return 1;
2609  
2610 +      if ((lsym_pointer && (rsym_pointer || rsym_target))
2611 +         || (rsym_pointer && (lsym_pointer || lsym_target)))
2612 +       {
2613 +         if (gfc_compare_types (&lref->u.c.component->ts,
2614 +                                &rsym->ts))
2615 +           return 1;
2616 +       }
2617 +
2618        for (rref = rss->expr->ref; rref != rss->data.info.ref;
2619            rref = rref->next)
2620         {
2621           if (rref->type != REF_COMPONENT)
2622             continue;
2623  
2624 -         if (gfc_symbols_could_alias (lref->u.c.sym, rref->u.c.sym))
2625 +         rsym_pointer = rsym_pointer || rref->u.c.sym->attr.pointer;
2626 +         rsym_target  = lsym_target  || rref->u.c.sym->attr.target;
2627 +
2628 +         if (symbols_could_alias (lref->u.c.sym, rref->u.c.sym,
2629 +                                  lsym_pointer, lsym_target,
2630 +                                  rsym_pointer, rsym_target))
2631             return 1;
2632 +
2633 +         if ((lsym_pointer && (rsym_pointer || rsym_target))
2634 +             || (rsym_pointer && (lsym_pointer || lsym_target)))
2635 +           {
2636 +             if (gfc_compare_types (&lref->u.c.component->ts,
2637 +                                    &rref->u.c.sym->ts))
2638 +               return 1;
2639 +             if (gfc_compare_types (&lref->u.c.sym->ts,
2640 +                                    &rref->u.c.component->ts))
2641 +               return 1;
2642 +             if (gfc_compare_types (&lref->u.c.component->ts,
2643 +                                    &rref->u.c.component->ts))
2644 +               return 1;
2645 +           }
2646         }
2647      }
2648  
2649 +  lsym_pointer = lsym->attr.pointer;
2650 +  lsym_target = lsym->attr.target;
2651 +  lsym_pointer = lsym->attr.pointer;
2652 +  lsym_target = lsym->attr.target;
2653 +
2654    for (rref = rss->expr->ref; rref != rss->data.info.ref; rref = rref->next)
2655      {
2656        if (rref->type != REF_COMPONENT)
2657         break;
2658  
2659 -      if (gfc_symbols_could_alias (rref->u.c.sym, lsym))
2660 +      rsym_pointer = rsym_pointer || rref->u.c.sym->attr.pointer;
2661 +      rsym_target  = lsym_target  || rref->u.c.sym->attr.target;
2662 +
2663 +      if (symbols_could_alias (rref->u.c.sym, lsym,
2664 +                              lsym_pointer, lsym_target,
2665 +                              rsym_pointer, rsym_target))
2666         return 1;
2667 +
2668 +      if ((lsym_pointer && (rsym_pointer || rsym_target))
2669 +         || (rsym_pointer && (lsym_pointer || lsym_target)))
2670 +       {
2671 +         if (gfc_compare_types (&lsym->ts, &rref->u.c.component->ts))
2672 +           return 1;
2673 +       }
2674      }
2675  
2676    return 0;
2677 Index: gcc/fortran/symbol.c
2678 ===================================================================
2679 --- gcc/fortran/symbol.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
2680 +++ gcc/fortran/symbol.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
2681 @@ -2733,41 +2733,6 @@
2682    return i;
2683  }
2684  
2685 -/* Return true if both symbols could refer to the same data object.  Does
2686 -   not take account of aliasing due to equivalence statements.  */
2687 -
2688 -int
2689 -gfc_symbols_could_alias (gfc_symbol *lsym, gfc_symbol *rsym)
2690 -{
2691 -  /* Aliasing isn't possible if the symbols have different base types.  */
2692 -  if (gfc_compare_types (&lsym->ts, &rsym->ts) == 0)
2693 -    return 0;
2694 -
2695 -  /* Pointers can point to other pointers, target objects and allocatable
2696 -     objects.  Two allocatable objects cannot share the same storage.  */
2697 -  if (lsym->attr.pointer
2698 -      && (rsym->attr.pointer || rsym->attr.allocatable || rsym->attr.target))
2699 -    return 1;
2700 -  if (lsym->attr.target && rsym->attr.pointer)
2701 -    return 1;
2702 -  if (lsym->attr.allocatable && rsym->attr.pointer)
2703 -    return 1;
2704 -
2705 -  /* Special case: Argument association, cf. F90 12.4.1.6, F2003 12.4.1.7
2706 -     and F2008 12.5.2.13 items 3b and 4b. The pointer case (a) is already
2707 -     checked above.  */
2708 -  if (lsym->attr.target && rsym->attr.target
2709 -      && ((lsym->attr.dummy
2710 -          && (!lsym->attr.dimension || lsym->as->type == AS_ASSUMED_SHAPE))
2711 -         || (rsym->attr.dummy
2712 -             && (!rsym->attr.dimension
2713 -                 || rsym->as->type == AS_ASSUMED_SHAPE))))
2714 -    return 1;
2715 -
2716 -  return 0;
2717 -}
2718 -
2719 -
2720  /* Undoes all the changes made to symbols in the current statement.
2721     This subroutine is made simpler due to the fact that attributes are
2722     never removed once added.  */
2723 Index: gcc/fortran/trans-openmp.c
2724 ===================================================================
2725 --- gcc/fortran/trans-openmp.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
2726 +++ gcc/fortran/trans-openmp.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
2727 @@ -480,13 +480,23 @@
2728    gfc_symbol init_val_sym, outer_sym, intrinsic_sym;
2729    gfc_expr *e1, *e2, *e3, *e4;
2730    gfc_ref *ref;
2731 -  tree decl, backend_decl, stmt;
2732 +  tree decl, backend_decl, stmt, type, outer_decl;
2733    locus old_loc = gfc_current_locus;
2734    const char *iname;
2735    gfc_try t;
2736  
2737    decl = OMP_CLAUSE_DECL (c);
2738    gfc_current_locus = where;
2739 +  type = TREE_TYPE (decl);
2740 +  outer_decl = create_tmp_var_raw (type, NULL);
2741 +  if (TREE_CODE (decl) == PARM_DECL
2742 +      && TREE_CODE (type) == REFERENCE_TYPE
2743 +      && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type))
2744 +      && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (type)) == GFC_ARRAY_ALLOCATABLE)
2745 +    {
2746 +      decl = build_fold_indirect_ref (decl);
2747 +      type = TREE_TYPE (type);
2748 +    }
2749  
2750    /* Create a fake symbol for init value.  */
2751    memset (&init_val_sym, 0, sizeof (init_val_sym));
2752 @@ -505,7 +515,9 @@
2753    outer_sym.attr.dummy = 0;
2754    outer_sym.attr.result = 0;
2755    outer_sym.attr.flavor = FL_VARIABLE;
2756 -  outer_sym.backend_decl = create_tmp_var_raw (TREE_TYPE (decl), NULL);
2757 +  outer_sym.backend_decl = outer_decl;
2758 +  if (decl != OMP_CLAUSE_DECL (c))
2759 +    outer_sym.backend_decl = build_fold_indirect_ref (outer_decl);
2760  
2761    /* Create fake symtrees for it.  */
2762    symtree1 = gfc_new_symtree (&root1, sym->name);
2763 @@ -622,12 +634,12 @@
2764  
2765    /* Create the init statement list.  */
2766    pushlevel (0);
2767 -  if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))
2768 -      && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl)) == GFC_ARRAY_ALLOCATABLE)
2769 +  if (GFC_DESCRIPTOR_TYPE_P (type)
2770 +      && GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
2771      {
2772        /* If decl is an allocatable array, it needs to be allocated
2773          with the same bounds as the outer var.  */
2774 -      tree type = TREE_TYPE (decl), rank, size, esize, ptr;
2775 +      tree rank, size, esize, ptr;
2776        stmtblock_t block;
2777  
2778        gfc_start_block (&block);
2779 @@ -663,8 +675,8 @@
2780  
2781    /* Create the merge statement list.  */
2782    pushlevel (0);
2783 -  if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))
2784 -      && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl)) == GFC_ARRAY_ALLOCATABLE)
2785 +  if (GFC_DESCRIPTOR_TYPE_P (type)
2786 +      && GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
2787      {
2788        /* If decl is an allocatable array, it needs to be deallocated
2789          afterwards.  */
2790 @@ -684,7 +696,7 @@
2791    OMP_CLAUSE_REDUCTION_MERGE (c) = stmt;
2792  
2793    /* And stick the placeholder VAR_DECL into the clause as well.  */
2794 -  OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = outer_sym.backend_decl;
2795 +  OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = outer_decl;
2796  
2797    gfc_current_locus = old_loc;
2798  
2799 Index: gcc/fortran/gfortran.h
2800 ===================================================================
2801 --- gcc/fortran/gfortran.h      (.../tags/gcc_4_5_2_release)    (wersja 169176)
2802 +++ gcc/fortran/gfortran.h      (.../branches/gcc-4_5-branch)   (wersja 169176)
2803 @@ -2483,8 +2483,6 @@
2804  int gfc_get_ha_symbol (const char *, gfc_symbol **);
2805  int gfc_get_ha_sym_tree (const char *, gfc_symtree **);
2806  
2807 -int gfc_symbols_could_alias (gfc_symbol *, gfc_symbol *);
2808 -
2809  void gfc_undo_symbols (void);
2810  void gfc_commit_symbols (void);
2811  void gfc_commit_symbol (gfc_symbol *);
2812 Index: gcc/fortran/error.c
2813 ===================================================================
2814 --- gcc/fortran/error.c (.../tags/gcc_4_5_2_release)    (wersja 169176)
2815 +++ gcc/fortran/error.c (.../branches/gcc-4_5-branch)   (wersja 169176)
2816 @@ -939,7 +939,7 @@
2817    buffer_flag = i;
2818  
2819    if (flag_fatal_errors)
2820 -    exit (1);
2821 +    exit (FATAL_EXIT_CODE);
2822  }
2823  
2824  
2825 @@ -956,7 +956,7 @@
2826    error_print (_("Fatal Error:"), _(gmsgid), argp);
2827    va_end (argp);
2828  
2829 -  exit (3);
2830 +  exit (FATAL_EXIT_CODE);
2831  }
2832  
2833  
2834 @@ -1019,7 +1019,7 @@
2835        gfc_increment_error_count();
2836  
2837        if (flag_fatal_errors)
2838 -       exit (1);
2839 +       exit (FATAL_EXIT_CODE);
2840      }
2841  
2842    return rc;
2843 Index: gcc/fortran/ChangeLog
2844 ===================================================================
2845 --- gcc/fortran/ChangeLog       (.../tags/gcc_4_5_2_release)    (wersja 169176)
2846 +++ gcc/fortran/ChangeLog       (.../branches/gcc-4_5-branch)   (wersja 169176)
2847 @@ -1,3 +1,42 @@
2848 +2011-01-21  Tobias Burnus  <burnus@net-b.de>
2849 +
2850 +       PR fortran/47394
2851 +       * error.c (gfc_error_now, gfc_fatal_error, gfc_error_check):
2852 +       Use defined instead of magic number exit status codes.
2853 +       * scanner.c (include_line, gfc_new_file): Ditto.
2854 +       * gfortranspec.c (lang_specific_driver): Ditto.
2855 +
2856 +2011-01-16  Jakub Jelinek  <jakub@redhat.com>
2857 +
2858 +       Backport from mainline
2859 +       2010-12-14  Jakub Jelinek  <jakub@redhat.com>
2860 +
2861 +       PR fortran/46874
2862 +       * trans-openmp.c (gfc_trans_omp_array_reduction): Handle allocatable
2863 +       dummy variables.
2864 +
2865 +2011-01-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
2866 +
2867 +       Backport from trunk
2868 +       PR fortran/45777
2869 +       * symbol.c (gfc_symbols_could_alias):  Strip gfc_ prefix,
2870 +       make static and move in front of its only caller, to ...
2871 +       * trans-array.c (symbols_could_alias): ... here.
2872 +       Pass information about pointer and target status as
2873 +       arguments.  Allocatable arrays don't alias anything
2874 +       unless they have the POINTER attribute.
2875 +       (gfc_could_be_alias):  Keep track of pointer and target
2876 +       status when following references.  Also check if typespecs
2877 +       of components match those of other components or symbols.
2878 +       * gfortran.h:  Remove prototype for gfc_symbols_could_alias.
2879 +
2880 +2011-01-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
2881 +
2882 +       Backport from mainline
2883 +       PR fortran/45338
2884 +       * resolve.c (resolve_operator):  Mark function for user-defined
2885 +       operator as referenced.
2886 +
2887  2010-12-16  Release Manager
2888  
2889         * GCC 4.5.2 released.
2890 Index: gcc/fortran/scanner.c
2891 ===================================================================
2892 --- gcc/fortran/scanner.c       (.../tags/gcc_4_5_2_release)    (wersja 169176)
2893 +++ gcc/fortran/scanner.c       (.../branches/gcc-4_5-branch)   (wersja 169176)
2894 @@ -1841,7 +1841,7 @@
2895  
2896    filename = gfc_widechar_to_char (begin, -1);
2897    if (load_file (filename, NULL, false) == FAILURE)
2898 -    exit (1);
2899 +    exit (FATAL_EXIT_CODE);
2900  
2901    gfc_free (filename);
2902    return true;
2903 @@ -2045,7 +2045,7 @@
2904      printf ("%s:%3d %s\n", LOCATION_FILE (line_head->location),
2905             LOCATION_LINE (line_head->location), line_head->line);
2906  
2907 -  exit (0);
2908 +  exit (SUCCESS_EXIT_CODE);
2909  #endif
2910  
2911    return result;
2912 Index: gcc/fortran/gfortranspec.c
2913 ===================================================================
2914 --- gcc/fortran/gfortranspec.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
2915 +++ gcc/fortran/gfortranspec.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
2916 @@ -375,7 +375,7 @@
2917  You may redistribute copies of GNU Fortran\n\
2918  under the terms of the GNU General Public License.\n\
2919  For more information about these matters, see the file named COPYING\n\n"));
2920 -         exit (0);
2921 +         exit (SUCCESS_EXIT_CODE);
2922           break;
2923  
2924         case OPTION_help:
2925 Index: gcc/fortran/resolve.c
2926 ===================================================================
2927 --- gcc/fortran/resolve.c       (.../tags/gcc_4_5_2_release)    (wersja 169176)
2928 +++ gcc/fortran/resolve.c       (.../branches/gcc-4_5-branch)   (wersja 169176)
2929 @@ -3577,9 +3577,12 @@
2930         sprintf (msg, _("Operand of user operator '%s' at %%L is %s"),
2931                  e->value.op.uop->name, gfc_typename (&op1->ts));
2932        else
2933 -       sprintf (msg, _("Operands of user operator '%s' at %%L are %s/%s"),
2934 -                e->value.op.uop->name, gfc_typename (&op1->ts),
2935 -                gfc_typename (&op2->ts));
2936 +       {
2937 +         sprintf (msg, _("Operands of user operator '%s' at %%L are %s/%s"),
2938 +                  e->value.op.uop->name, gfc_typename (&op1->ts),
2939 +                  gfc_typename (&op2->ts));
2940 +         e->value.op.uop->op->sym->attr.referenced = 1;
2941 +       }
2942  
2943        goto bad_op;
2944  
2945 Index: gcc/regmove.c
2946 ===================================================================
2947 --- gcc/regmove.c       (.../tags/gcc_4_5_2_release)    (wersja 169176)
2948 +++ gcc/regmove.c       (.../branches/gcc-4_5-branch)   (wersja 169176)
2949 @@ -513,7 +513,7 @@
2950    rtx src_reg = XEXP (src, 0);
2951    int src_no = REGNO (src_reg);
2952    int dst_no = REGNO (dest);
2953 -  rtx p, set;
2954 +  rtx p, set, set_insn;
2955    enum machine_mode old_mode;
2956    basic_block bb = BLOCK_FOR_INSN (insn);
2957  
2958 @@ -551,6 +551,7 @@
2959                                  GET_MODE_BITSIZE (GET_MODE (src_reg))))
2960      return;
2961  
2962 +  set_insn = p;
2963    old_mode = GET_MODE (src_reg);
2964    PUT_MODE (src_reg, GET_MODE (src));
2965    XEXP (src, 0) = SET_SRC (set);
2966 @@ -583,9 +584,19 @@
2967      }
2968    else
2969      {
2970 -      rtx note = find_reg_note (p, REG_EQUAL, NULL_RTX);
2971 +      rtx note = find_reg_note (set_insn, REG_EQUAL, NULL_RTX);
2972        if (note)
2973 -       remove_note (p, note);
2974 +       {
2975 +         if (rtx_equal_p (XEXP (note, 0), XEXP (src, 0)))
2976 +           {
2977 +             XEXP (note, 0)
2978 +               = gen_rtx_fmt_e (GET_CODE (src), GET_MODE (src),
2979 +                                XEXP (note, 0));
2980 +             df_notes_rescan (set_insn);
2981 +           }
2982 +         else
2983 +           remove_note (set_insn, note);
2984 +       }
2985      }
2986  }
2987  
2988 Index: gcc/BASE-VER
2989 ===================================================================
2990 --- gcc/BASE-VER        (.../tags/gcc_4_5_2_release)    (wersja 169176)
2991 +++ gcc/BASE-VER        (.../branches/gcc-4_5-branch)   (wersja 169176)
2992 @@ -1 +1 @@
2993 -4.5.2
2994 +4.5.3
2995 Index: gcc/tree-data-ref.c
2996 ===================================================================
2997 --- gcc/tree-data-ref.c (.../tags/gcc_4_5_2_release)    (wersja 169176)
2998 +++ gcc/tree-data-ref.c (.../branches/gcc-4_5-branch)   (wersja 169176)
2999 @@ -4594,7 +4594,7 @@
3000      for (e = v->succ; e; e = e->succ_next)
3001        fprintf (file, " %d", e->dest);
3002  
3003 -  fprintf (file, ") \n");
3004 +  fprintf (file, ")\n");
3005    print_gimple_stmt (file, RDGV_STMT (v), 0, TDF_VOPS|TDF_MEMSYMS);
3006    fprintf (file, ")\n");
3007  }
3008 @@ -4991,6 +4991,38 @@
3009    free (bbs);
3010  }
3011  
3012 +/* Returns true when the statement at STMT is of the form "A[i] = 0"
3013 +   that contains a data reference on its LHS with a stride of the same
3014 +   size as its unit type.  */
3015 +
3016 +bool
3017 +stmt_with_adjacent_zero_store_dr_p (gimple stmt)
3018 +{
3019 +  tree op0, op1;
3020 +  bool res;
3021 +  struct data_reference *dr;
3022 +
3023 +  if (!stmt
3024 +      || !gimple_vdef (stmt)
3025 +      || !is_gimple_assign (stmt)
3026 +      || !gimple_assign_single_p (stmt)
3027 +      || !(op1 = gimple_assign_rhs1 (stmt))
3028 +      || !(integer_zerop (op1) || real_zerop (op1)))
3029 +    return false;
3030 +
3031 +  dr = XCNEW (struct data_reference);
3032 +  op0 = gimple_assign_lhs (stmt);
3033 +
3034 +  DR_STMT (dr) = stmt;
3035 +  DR_REF (dr) = op0;
3036 +
3037 +  res = dr_analyze_innermost (dr)
3038 +    && stride_of_unit_type_p (DR_STEP (dr), TREE_TYPE (op0));
3039 +
3040 +  free_data_ref (dr);
3041 +  return res;
3042 +}
3043 +
3044  /* For a data reference REF, return the declaration of its base
3045     address or NULL_TREE if the base is not determined.  */
3046  
3047 Index: gcc/tree-data-ref.h
3048 ===================================================================
3049 --- gcc/tree-data-ref.h (.../tags/gcc_4_5_2_release)    (wersja 169176)
3050 +++ gcc/tree-data-ref.h (.../branches/gcc-4_5-branch)   (wersja 169176)
3051 @@ -567,7 +567,19 @@
3052  void remove_similar_memory_refs (VEC (gimple, heap) **);
3053  bool rdg_defs_used_in_other_loops_p (struct graph *, int);
3054  bool have_similar_memory_accesses (gimple, gimple);
3055 +bool stmt_with_adjacent_zero_store_dr_p (gimple);
3056  
3057 +/* Returns true when STRIDE is equal in absolute value to the size of
3058 +   the unit type of TYPE.  */
3059 +
3060 +static inline bool
3061 +stride_of_unit_type_p (tree stride, tree type)
3062 +{
3063 +  return tree_int_cst_equal (fold_unary (ABS_EXPR, TREE_TYPE (stride),
3064 +                                        stride),
3065 +                            TYPE_SIZE_UNIT (type));
3066 +}
3067 +
3068  /* Determines whether RDG vertices V1 and V2 access to similar memory
3069     locations, in which case they have to be in the same partition.  */
3070  
3071 Index: gcc/c-typeck.c
3072 ===================================================================
3073 --- gcc/c-typeck.c      (.../tags/gcc_4_5_2_release)    (wersja 169176)
3074 +++ gcc/c-typeck.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
3075 @@ -5025,10 +5025,10 @@
3076      {
3077        tree ret;
3078        bool save = in_late_binary_op;
3079 -      if (codel == BOOLEAN_TYPE)
3080 +      if (codel == BOOLEAN_TYPE || codel == COMPLEX_TYPE)
3081         in_late_binary_op = true;
3082        ret = convert_and_check (type, orig_rhs);
3083 -      if (codel == BOOLEAN_TYPE)
3084 +      if (codel == BOOLEAN_TYPE || codel == COMPLEX_TYPE)
3085         in_late_binary_op = save;
3086        return ret;
3087      }
3088 Index: gcc/cfgexpand.c
3089 ===================================================================
3090 --- gcc/cfgexpand.c     (.../tags/gcc_4_5_2_release)    (wersja 169176)
3091 +++ gcc/cfgexpand.c     (.../branches/gcc-4_5-branch)   (wersja 169176)
3092 @@ -2578,7 +2578,7 @@
3093             enum machine_mode opmode = GET_MODE (op0);
3094  
3095             if (opmode == VOIDmode)
3096 -             opmode = mode1;
3097 +             opmode = TYPE_MODE (TREE_TYPE (tem));
3098  
3099             /* This condition may hold if we're expanding the address
3100                right past the end of an array that turned out not to
3101 @@ -2599,7 +2599,8 @@
3102                                      ? SIGN_EXTRACT
3103                                      : ZERO_EXTRACT, mode,
3104                                      GET_MODE (op0) != VOIDmode
3105 -                                    ? GET_MODE (op0) : mode1,
3106 +                                    ? GET_MODE (op0)
3107 +                                    : TYPE_MODE (TREE_TYPE (tem)),
3108                                      op0, GEN_INT (bitsize), GEN_INT (bitpos));
3109        }
3110  
3111 Index: gcc/graphite.c
3112 ===================================================================
3113 --- gcc/graphite.c      (.../tags/gcc_4_5_2_release)    (wersja 169176)
3114 +++ gcc/graphite.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
3115 @@ -210,6 +210,7 @@
3116        return false;
3117      }
3118  
3119 +  scev_reset ();
3120    recompute_all_dominators ();
3121    initialize_original_copy_tables ();
3122    cloog_initialize ();
3123 Index: gcc/tree-ssa-pre.c
3124 ===================================================================
3125 --- gcc/tree-ssa-pre.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
3126 +++ gcc/tree-ssa-pre.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
3127 @@ -1701,7 +1701,7 @@
3128             tree result = vn_reference_lookup_pieces (newvuse, ref->set,
3129                                                       ref->type,
3130                                                       newoperands,
3131 -                                                     &newref, true);
3132 +                                                     &newref, VN_WALK);
3133             if (newref)
3134               VEC_free (vn_reference_op_s, heap, newoperands);
3135  
3136 @@ -2558,6 +2558,10 @@
3137      {
3138        if (dump_file && (dump_flags & TDF_DETAILS))
3139         fprintf (dump_file, "Starting iteration %d\n", num_iterations);
3140 +      /* ???  We need to clear our PHI translation cache here as the
3141 +         ANTIC sets shrink and we restrict valid translations to
3142 +        those having operands with leaders in ANTIC.  Same below
3143 +        for PA ANTIC computation.  */
3144        num_iterations++;
3145        changed = false;
3146        for (i = n_basic_blocks - NUM_FIXED_BLOCKS - 1; i >= 0; i--)
3147 @@ -3965,7 +3969,7 @@
3148                 copy_reference_ops_from_call (stmt, &ops);
3149                 vn_reference_lookup_pieces (gimple_vuse (stmt), 0,
3150                                             gimple_expr_type (stmt),
3151 -                                           ops, &ref, false);
3152 +                                           ops, &ref, VN_NOWALK);
3153                 VEC_free (vn_reference_op_s, heap, ops);
3154                 if (!ref)
3155                   continue;
3156 @@ -4035,7 +4039,7 @@
3157  
3158                       vn_reference_lookup (gimple_assign_rhs1 (stmt),
3159                                            gimple_vuse (stmt),
3160 -                                          true, &ref);
3161 +                                          VN_WALK, &ref);
3162                       if (!ref)
3163                         continue;
3164  
3165 @@ -4265,7 +4269,7 @@
3166               tree rhs = gimple_assign_rhs1 (stmt);
3167               tree val;
3168               val = vn_reference_lookup (gimple_assign_lhs (stmt),
3169 -                                        gimple_vuse (stmt), true, NULL);
3170 +                                        gimple_vuse (stmt), VN_WALK, NULL);
3171               if (TREE_CODE (rhs) == SSA_NAME)
3172                 rhs = VN_INFO (rhs)->valnum;
3173               if (val
3174 Index: gcc/cfgcleanup.c
3175 ===================================================================
3176 --- gcc/cfgcleanup.c    (.../tags/gcc_4_5_2_release)    (wersja 169176)
3177 +++ gcc/cfgcleanup.c    (.../branches/gcc-4_5-branch)   (wersja 169176)
3178 @@ -482,15 +482,20 @@
3179                   /* When not optimizing, ensure that edges or forwarder
3180                      blocks with different locus are not optimized out.  */
3181                   int locus = single_succ_edge (target)->goto_locus;
3182 +                 rtx last ;
3183  
3184                   if (locus && goto_locus && !locator_eq (locus, goto_locus))
3185                     counter = n_basic_blocks;
3186                   else if (locus)
3187                     goto_locus = locus;
3188  
3189 -                 if (INSN_P (BB_END (target)))
3190 +                 last = BB_END (target);
3191 +                 if (DEBUG_INSN_P (last))
3192 +                   last = prev_nondebug_insn (last);
3193 +
3194 +                 if (last && INSN_P (last))
3195                     {
3196 -                     locus = INSN_LOCATOR (BB_END (target));
3197 +                     locus = INSN_LOCATOR (last);
3198  
3199                       if (locus && goto_locus
3200                           && !locator_eq (locus, goto_locus))
3201 Index: gcc/tree-sra.c
3202 ===================================================================
3203 --- gcc/tree-sra.c      (.../tags/gcc_4_5_2_release)    (wersja 169176)
3204 +++ gcc/tree-sra.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
3205 @@ -3413,7 +3413,10 @@
3206           else if (ac2->size != access->size)
3207             return NULL;
3208  
3209 -         if (access_precludes_ipa_sra_p (ac2))
3210 +         if (access_precludes_ipa_sra_p (ac2)
3211 +             || (ac2->type != access->type
3212 +                 && (TREE_ADDRESSABLE (ac2->type)
3213 +                     || TREE_ADDRESSABLE (access->type))))
3214             return NULL;
3215  
3216           modification |= ac2->write;
3217 Index: gcc/c-convert.c
3218 ===================================================================
3219 --- gcc/c-convert.c     (.../tags/gcc_4_5_2_release)    (wersja 169176)
3220 +++ gcc/c-convert.c     (.../branches/gcc-4_5-branch)   (wersja 169176)
3221 @@ -131,6 +131,32 @@
3222        goto maybe_fold;
3223  
3224      case COMPLEX_TYPE:
3225 +      /* If converting from COMPLEX_TYPE to a different COMPLEX_TYPE
3226 +        and e is not COMPLEX_EXPR, convert_to_complex uses save_expr,
3227 +        but for the C FE c_save_expr needs to be called instead.  */
3228 +      if (TREE_CODE (TREE_TYPE (e)) == COMPLEX_TYPE)
3229 +       {
3230 +         tree subtype = TREE_TYPE (type);
3231 +         tree elt_type = TREE_TYPE (TREE_TYPE (e));
3232 +
3233 +         if (TYPE_MAIN_VARIANT (elt_type) != TYPE_MAIN_VARIANT (subtype)
3234 +             && TREE_CODE (e) != COMPLEX_EXPR)
3235 +           {
3236 +             if (in_late_binary_op)
3237 +               e = save_expr (e);
3238 +             else
3239 +               e = c_save_expr (e);
3240 +             ret
3241 +               = fold_build2 (COMPLEX_EXPR, type,
3242 +                              convert (subtype,
3243 +                                       fold_build1 (REALPART_EXPR,
3244 +                                                    elt_type, e)),
3245 +                              convert (subtype,
3246 +                                       fold_build1 (IMAGPART_EXPR,
3247 +                                                    elt_type, e)));
3248 +             goto maybe_fold;
3249 +           }
3250 +       }
3251        ret = convert_to_complex (type, e);
3252        goto maybe_fold;
3253  
3254 Index: gcc/tree-ssa-ter.c
3255 ===================================================================
3256 --- gcc/tree-ssa-ter.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
3257 +++ gcc/tree-ssa-ter.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
3258 @@ -416,7 +416,9 @@
3259      return false;
3260  
3261    /* Without alias info we can't move around loads.  */
3262 -  if (gimple_references_memory_p (stmt) && !optimize)
3263 +  if (!optimize
3264 +      && gimple_assign_single_p (stmt)
3265 +      && !is_gimple_val (gimple_assign_rhs1 (stmt)))
3266      return false;
3267  
3268    /* Float expressions must go through memory if float-store is on.  */
3269 Index: gcc/rtl.c
3270 ===================================================================
3271 --- gcc/rtl.c   (.../tags/gcc_4_5_2_release)    (wersja 169176)
3272 +++ gcc/rtl.c   (.../branches/gcc-4_5-branch)   (wersja 169176)
3273 @@ -429,7 +429,15 @@
3274         case 'n':
3275         case 'i':
3276           if (XINT (x, i) != XINT (y, i))
3277 -           return 0;
3278 +           {
3279 +#ifndef GENERATOR_FILE
3280 +             if (((code == ASM_OPERANDS && i == 6)
3281 +                  || (code == ASM_INPUT && i == 1))
3282 +                 && locator_eq (XINT (x, i), XINT (y, i)))
3283 +               break;
3284 +#endif
3285 +             return 0;
3286 +           }
3287           break;
3288  
3289         case 'V':
3290 @@ -549,7 +557,15 @@
3291         case 'n':
3292         case 'i':
3293           if (XINT (x, i) != XINT (y, i))
3294 -           return 0;
3295 +           {
3296 +#ifndef GENERATOR_FILE
3297 +             if (((code == ASM_OPERANDS && i == 6)
3298 +                  || (code == ASM_INPUT && i == 1))
3299 +                 && locator_eq (XINT (x, i), XINT (y, i)))
3300 +               break;
3301 +#endif
3302 +             return 0;
3303 +           }
3304           break;
3305  
3306         case 'V':
3307 Index: gcc/graphite-sese-to-poly.c
3308 ===================================================================
3309 --- gcc/graphite-sese-to-poly.c (.../tags/gcc_4_5_2_release)    (wersja 169176)
3310 +++ gcc/graphite-sese-to-poly.c (.../branches/gcc-4_5-branch)   (wersja 169176)
3311 @@ -715,7 +715,7 @@
3312        gcc_assert (TREE_CODE (e) == INTEGER_CST);
3313  
3314        value_init (val);
3315 -      value_set_si (val, int_cst_value (e));
3316 +      tree_int_to_gmp (e, val);
3317        add_value_to_dim (l, expr, val);
3318        value_clear (val);
3319      }
3320 @@ -729,16 +729,13 @@
3321  {
3322    Value val;
3323    ppl_Coefficient_t coef;
3324 -  int v = int_cst_value (cst);
3325 +  tree type = TREE_TYPE (cst);
3326  
3327    value_init (val);
3328 -  value_set_si (val, 0);
3329  
3330    /* Necessary to not get "-1 = 2^n - 1". */
3331 -  if (v < 0)
3332 -    value_sub_int (val, val, -v);
3333 -  else
3334 -    value_add_int (val, val, v);
3335 +  mpz_set_double_int (val, double_int_sext (tree_to_double_int (cst),
3336 +                                           TYPE_PRECISION (type)), false);
3337  
3338    value_multiply (val, val, k);
3339    ppl_new_Coefficient (&coef);
3340 @@ -816,7 +813,7 @@
3341               Value val;
3342               gcc_assert (host_integerp (TREE_OPERAND (e, 1), 0));
3343               value_init (val);
3344 -             value_set_si (val, int_cst_value (TREE_OPERAND (e, 1)));
3345 +             tree_int_to_gmp (TREE_OPERAND (e, 1), val);
3346               value_multiply (val, val, k);
3347               scan_tree_for_params (s, TREE_OPERAND (e, 0), c, val);
3348               value_clear (val);
3349 @@ -831,7 +828,7 @@
3350               Value val;
3351               gcc_assert (host_integerp (TREE_OPERAND (e, 0), 0));
3352               value_init (val);
3353 -             value_set_si (val, int_cst_value (TREE_OPERAND (e, 0)));
3354 +             tree_int_to_gmp (TREE_OPERAND (e, 0), val);
3355               value_multiply (val, val, k);
3356               scan_tree_for_params (s, TREE_OPERAND (e, 1), c, val);
3357               value_clear (val);
3358 @@ -1717,10 +1714,13 @@
3359        /* subscript - low >= 0 */
3360        if (host_integerp (low, 0))
3361         {
3362 +         tree minus_low;
3363 +
3364           ppl_new_Linear_Expression_with_dimension (&expr, accessp_nb_dims);
3365           ppl_set_coef (expr, subscript, 1);
3366  
3367 -         ppl_set_inhomogeneous (expr, -int_cst_value (low));
3368 +         minus_low = fold_build1 (NEGATE_EXPR, TREE_TYPE (low), low);
3369 +         ppl_set_inhomogeneous_tree (expr, minus_low);
3370  
3371           ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
3372           ppl_Polyhedron_add_constraint (accesses, cstr);
3373 @@ -1740,7 +1740,7 @@
3374           ppl_new_Linear_Expression_with_dimension (&expr, accessp_nb_dims);
3375           ppl_set_coef (expr, subscript, -1);
3376  
3377 -         ppl_set_inhomogeneous (expr, int_cst_value (high));
3378 +         ppl_set_inhomogeneous_tree (expr, high);
3379  
3380           ppl_new_Constraint (&cstr, expr, PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
3381           ppl_Polyhedron_add_constraint (accesses, cstr);
3382 Index: gcc/tree-ssa-structalias.c
3383 ===================================================================
3384 --- gcc/tree-ssa-structalias.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
3385 +++ gcc/tree-ssa-structalias.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
3386 @@ -369,7 +369,11 @@
3387    ret->may_have_pointers = true;
3388    ret->is_global_var = (t == NULL_TREE);
3389    if (t && DECL_P (t))
3390 -    ret->is_global_var = is_global_var (t);
3391 +    ret->is_global_var = (is_global_var (t)
3392 +                         /* We have to treat even local register variables
3393 +                            as escape points.  */
3394 +                         || (TREE_CODE (t) == VAR_DECL
3395 +                             && DECL_HARD_REGISTER (t)));
3396    ret->solution = BITMAP_ALLOC (&pta_obstack);
3397    ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack);
3398    ret->next = NULL;
3399 Index: gcc/config/sparc/sparc.md
3400 ===================================================================
3401 --- gcc/config/sparc/sparc.md   (.../tags/gcc_4_5_2_release)    (wersja 169176)
3402 +++ gcc/config/sparc/sparc.md   (.../branches/gcc-4_5-branch)   (wersja 169176)
3403 @@ -1106,14 +1106,15 @@
3404  
3405  ;; Load in operand 0 the (absolute) address of operand 1, which is a symbolic
3406  ;; value subject to a PC-relative relocation.  Operand 2 is a helper function
3407 -;; that adds the PC value at the call point to operand 0.
3408 +;; that adds the PC value at the call point to register #(operand 3).
3409  
3410  (define_insn "load_pcrel_sym<P:mode>"
3411    [(set (match_operand:P 0 "register_operand" "=r")
3412         (unspec:P [(match_operand:P 1 "symbolic_operand" "")
3413 -                  (match_operand:P 2 "call_address_operand" "")] UNSPEC_LOAD_PCREL_SYM))
3414 +                  (match_operand:P 2 "call_address_operand" "")
3415 +                  (match_operand:P 3 "const_int_operand" "")] UNSPEC_LOAD_PCREL_SYM))
3416     (clobber (reg:P 15))]
3417 -  ""
3418 +  "REGNO (operands[0]) == INTVAL (operands[3])"
3419  {
3420    if (flag_delayed_branch)
3421      return "sethi\t%%hi(%a1-4), %0\n\tcall\t%a2\n\t add\t%0, %%lo(%a1+4), %0";
3422 Index: gcc/config/sparc/sparc.c
3423 ===================================================================
3424 --- gcc/config/sparc/sparc.c    (.../tags/gcc_4_5_2_release)    (wersja 169176)
3425 +++ gcc/config/sparc/sparc.c    (.../branches/gcc-4_5-branch)   (wersja 169176)
3426 @@ -363,7 +363,7 @@
3427  static int epilogue_renumber (rtx *, int);
3428  static bool sparc_assemble_integer (rtx, unsigned int, int);
3429  static int set_extends (rtx);
3430 -static void load_pic_register (void);
3431 +static void load_got_register (void);
3432  static int save_or_restore_regs (int, int, rtx, int, int);
3433  static void emit_save_or_restore_regs (int);
3434  static void sparc_asm_function_prologue (FILE *, HOST_WIDE_INT);
3435 @@ -966,6 +966,36 @@
3436    return 0;
3437  }
3438  
3439 +/* Return true if the address of LABEL can be loaded by means of the
3440 +   mov{si,di}_pic_label_ref patterns in PIC mode.  */
3441 +
3442 +static bool
3443 +can_use_mov_pic_label_ref (rtx label)
3444 +{
3445 +  /* VxWorks does not impose a fixed gap between segments; the run-time
3446 +     gap can be different from the object-file gap.  We therefore can't
3447 +     assume X - _GLOBAL_OFFSET_TABLE_ is a link-time constant unless we
3448 +     are absolutely sure that X is in the same segment as the GOT.
3449 +     Unfortunately, the flexibility of linker scripts means that we
3450 +     can't be sure of that in general, so assume that GOT-relative
3451 +     accesses are never valid on VxWorks.  */
3452 +  if (TARGET_VXWORKS_RTP)
3453 +    return false;
3454 +
3455 +  /* Similarly, if the label is non-local, it might end up being placed
3456 +     in a different section than the current one; now mov_pic_label_ref
3457 +     requires the label and the code to be in the same section.  */
3458 +  if (LABEL_REF_NONLOCAL_P (label))
3459 +    return false;
3460 +
3461 +  /* Finally, if we are reordering basic blocks and partition into hot
3462 +     and cold sections, this might happen for any label.  */
3463 +  if (flag_reorder_blocks_and_partition)
3464 +    return false;
3465 +
3466 +  return true;
3467 +}
3468 +
3469  /* Expand a move instruction.  Return true if all work is done.  */
3470  
3471  bool
3472 @@ -1000,14 +1030,9 @@
3473        if (pic_address_needs_scratch (operands[1]))
3474         operands[1] = legitimize_pic_address (operands[1], NULL_RTX);
3475  
3476 -      /* VxWorks does not impose a fixed gap between segments; the run-time
3477 -        gap can be different from the object-file gap.  We therefore can't
3478 -        assume X - _GLOBAL_OFFSET_TABLE_ is a link-time constant unless we
3479 -        are absolutely sure that X is in the same segment as the GOT.
3480 -        Unfortunately, the flexibility of linker scripts means that we
3481 -        can't be sure of that in general, so assume that _G_O_T_-relative
3482 -        accesses are never valid on VxWorks.  */
3483 -      if (GET_CODE (operands[1]) == LABEL_REF && !TARGET_VXWORKS_RTP)
3484 +      /* We cannot use the mov{si,di}_pic_label_ref patterns in all cases.  */
3485 +      if (GET_CODE (operands[1]) == LABEL_REF
3486 +         && can_use_mov_pic_label_ref (operands[1]))
3487         {
3488           if (mode == SImode)
3489             {
3490 @@ -2907,26 +2932,39 @@
3491      }
3492  }
3493  \f
3494 -/* PIC support.  */
3495 -static GTY(()) bool pic_helper_needed = false;
3496 -static GTY(()) rtx pic_helper_symbol;
3497 -static GTY(()) rtx global_offset_table;
3498 +/* Global Offset Table support.  */
3499 +static GTY(()) rtx got_helper_rtx = NULL_RTX;
3500 +static GTY(()) rtx global_offset_table_rtx = NULL_RTX;
3501  
3502 +/* Return the SYMBOL_REF for the Global Offset Table.  */
3503 +
3504 +static GTY(()) rtx sparc_got_symbol = NULL_RTX;
3505 +
3506 +static rtx
3507 +sparc_got (void)
3508 +{
3509 +  if (!sparc_got_symbol)
3510 +    sparc_got_symbol = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
3511 +
3512 +  return sparc_got_symbol;
3513 +}
3514 +
3515  /* Ensure that we are not using patterns that are not OK with PIC.  */
3516  
3517  int
3518  check_pic (int i)
3519  {
3520 +  rtx op;
3521 +
3522    switch (flag_pic)
3523      {
3524      case 1:
3525 -      gcc_assert (GET_CODE (recog_data.operand[i]) != SYMBOL_REF
3526 -                 && (GET_CODE (recog_data.operand[i]) != CONST
3527 -                 || (GET_CODE (XEXP (recog_data.operand[i], 0)) == MINUS
3528 -                     && (XEXP (XEXP (recog_data.operand[i], 0), 0)
3529 -                         == global_offset_table)
3530 -                     && (GET_CODE (XEXP (XEXP (recog_data.operand[i], 0), 1))
3531 -                         == CONST))));
3532 +      op = recog_data.operand[i];
3533 +      gcc_assert (GET_CODE (op) != SYMBOL_REF
3534 +                 && (GET_CODE (op) != CONST
3535 +                     || (GET_CODE (XEXP (op, 0)) == MINUS
3536 +                         && XEXP (XEXP (op, 0), 0) == sparc_got ()
3537 +                         && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST)));
3538      case 2:
3539      default:
3540        return 1;
3541 @@ -3161,9 +3199,9 @@
3542    return 1;
3543  }
3544  
3545 -/* Construct the SYMBOL_REF for the tls_get_offset function.  */
3546 +/* Return the SYMBOL_REF for the tls_get_addr function.  */
3547  
3548 -static GTY(()) rtx sparc_tls_symbol;
3549 +static GTY(()) rtx sparc_tls_symbol = NULL_RTX;
3550  
3551  static rtx
3552  sparc_tls_get_addr (void)
3553 @@ -3174,21 +3212,28 @@
3554    return sparc_tls_symbol;
3555  }
3556  
3557 +/* Return the Global Offset Table to be used in TLS mode.  */
3558 +
3559  static rtx
3560  sparc_tls_got (void)
3561  {
3562 -  rtx temp;
3563 +  /* In PIC mode, this is just the PIC offset table.  */
3564    if (flag_pic)
3565      {
3566        crtl->uses_pic_offset_table = 1;
3567        return pic_offset_table_rtx;
3568      }
3569  
3570 -  if (!global_offset_table)
3571 -    global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
3572 -  temp = gen_reg_rtx (Pmode);
3573 -  emit_move_insn (temp, global_offset_table);
3574 -  return temp;
3575 +  /* In non-PIC mode, Sun as (unlike GNU as) emits PC-relative relocations for
3576 +     the GOT symbol with the 32-bit ABI, so we reload the GOT register.  */
3577 +  if (TARGET_SUN_TLS && TARGET_ARCH32)
3578 +    {
3579 +      load_got_register ();
3580 +      return global_offset_table_rtx;
3581 +    }
3582 +
3583 +  /* In all other cases, we load a new pseudo with the GOT symbol.  */
3584 +  return copy_to_reg (sparc_got ());
3585  }
3586  
3587  /* Return true if X contains a thread-local symbol.  */
3588 @@ -3369,7 +3414,7 @@
3589  
3590    if (GET_CODE (orig) == SYMBOL_REF
3591        /* See the comment in sparc_expand_move.  */
3592 -      || (TARGET_VXWORKS_RTP && GET_CODE (orig) == LABEL_REF))
3593 +      || (GET_CODE (orig) == LABEL_REF && !can_use_mov_pic_label_ref (orig)))
3594      {
3595        rtx pic_ref, address;
3596        rtx insn;
3597 @@ -3420,11 +3465,13 @@
3598         }
3599        else
3600         {
3601 -         pic_ref = gen_const_mem (Pmode,
3602 -                                  gen_rtx_PLUS (Pmode,
3603 -                                                pic_offset_table_rtx, address));
3604 +         pic_ref
3605 +           = gen_const_mem (Pmode,
3606 +                            gen_rtx_PLUS (Pmode,
3607 +                                          pic_offset_table_rtx, address));
3608           insn = emit_move_insn (reg, pic_ref);
3609         }
3610 +
3611        /* Put a REG_EQUAL note on this insn, so that it can be optimized
3612          by loop.  */
3613        set_unique_reg_note (insn, REG_EQUAL, orig);
3614 @@ -3462,9 +3509,8 @@
3615        return gen_rtx_PLUS (Pmode, base, offset);
3616      }
3617    else if (GET_CODE (orig) == LABEL_REF)
3618 -    /* ??? Why do we do this?  */
3619 -    /* Now movsi_pic_label_ref uses it, but we ought to be checking that
3620 -       the register is live instead, in case it is eliminated.  */
3621 +    /* ??? We ought to be checking that the register is live instead, in case
3622 +       it is eliminated.  */
3623      crtl->uses_pic_offset_table = 1;
3624  
3625    return orig;
3626 @@ -3529,59 +3575,69 @@
3627  static void
3628  get_pc_thunk_name (char name[32], unsigned int regno)
3629  {
3630 -  const char *pic_name = reg_names[regno];
3631 +  const char *reg_name = reg_names[regno];
3632  
3633    /* Skip the leading '%' as that cannot be used in a
3634       symbol name.  */
3635 -  pic_name += 1;
3636 +  reg_name += 1;
3637  
3638    if (USE_HIDDEN_LINKONCE)
3639 -    sprintf (name, "__sparc_get_pc_thunk.%s", pic_name);
3640 +    sprintf (name, "__sparc_get_pc_thunk.%s", reg_name);
3641    else
3642      ASM_GENERATE_INTERNAL_LABEL (name, "LADDPC", regno);
3643  }
3644  
3645 -/* Emit code to load the PIC register.  */
3646 +/* Wrapper around the load_pcrel_sym{si,di} patterns.  */
3647  
3648 -static void
3649 -load_pic_register (void)
3650 +static rtx
3651 +gen_load_pcrel_sym (rtx op0, rtx op1, rtx op2, rtx op3)
3652  {
3653    int orig_flag_pic = flag_pic;
3654 +  rtx insn;
3655  
3656 -  if (TARGET_VXWORKS_RTP)
3657 -    {
3658 -      emit_insn (gen_vxworks_load_got ());
3659 -      emit_use (pic_offset_table_rtx);
3660 -      return;
3661 -    }
3662 +  /* The load_pcrel_sym{si,di} patterns require absolute addressing.  */
3663 +  flag_pic = 0;
3664 +  if (TARGET_ARCH64)
3665 +    insn = gen_load_pcrel_symdi (op0, op1, op2, op3);
3666 +  else
3667 +    insn = gen_load_pcrel_symsi (op0, op1, op2, op3);
3668 +  flag_pic = orig_flag_pic;
3669  
3670 -  /* If we haven't initialized the special PIC symbols, do so now.  */
3671 -  if (!pic_helper_needed)
3672 -    {
3673 -      char name[32];
3674 +  return insn;
3675 +}
3676  
3677 -      pic_helper_needed = true;
3678 +/* Emit code to load the GOT register.  */
3679  
3680 -      get_pc_thunk_name (name, REGNO (pic_offset_table_rtx));
3681 -      pic_helper_symbol = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
3682 +static void
3683 +load_got_register (void)
3684 +{
3685 +  /* In PIC mode, this will retrieve pic_offset_table_rtx.  */
3686 +  if (!global_offset_table_rtx)
3687 +    global_offset_table_rtx = gen_rtx_REG (Pmode, GLOBAL_OFFSET_TABLE_REGNUM);
3688  
3689 -      global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
3690 +  if (TARGET_VXWORKS_RTP)
3691 +    emit_insn (gen_vxworks_load_got ());
3692 +  else
3693 +    {
3694 +      /* The GOT symbol is subject to a PC-relative relocation so we need a
3695 +        helper function to add the PC value and thus get the final value.  */
3696 +      if (!got_helper_rtx)
3697 +       {
3698 +         char name[32];
3699 +         get_pc_thunk_name (name, GLOBAL_OFFSET_TABLE_REGNUM);
3700 +         got_helper_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
3701 +       }
3702 +
3703 +      emit_insn (gen_load_pcrel_sym (global_offset_table_rtx, sparc_got (),
3704 +                                    got_helper_rtx,
3705 +                                    GEN_INT (GLOBAL_OFFSET_TABLE_REGNUM)));
3706      }
3707  
3708 -  flag_pic = 0;
3709 -  if (TARGET_ARCH64)
3710 -    emit_insn (gen_load_pcrel_symdi (pic_offset_table_rtx, global_offset_table,
3711 -                                    pic_helper_symbol));
3712 -  else
3713 -    emit_insn (gen_load_pcrel_symsi (pic_offset_table_rtx, global_offset_table,
3714 -                                    pic_helper_symbol));
3715 -  flag_pic = orig_flag_pic;
3716 -
3717    /* Need to emit this whether or not we obey regdecls,
3718       since setjmp/longjmp can cause life info to screw up.
3719       ??? In the case where we don't obey regdecls, this is not sufficient
3720       since we may not fall out the bottom.  */
3721 -  emit_use (pic_offset_table_rtx);
3722 +  emit_use (global_offset_table_rtx);
3723  }
3724  
3725  /* Emit a call instruction with the pattern given by PAT.  ADDR is the
3726 @@ -4113,7 +4169,7 @@
3727  
3728  /* Expand the function prologue.  The prologue is responsible for reserving
3729     storage for the frame, saving the call-saved registers and loading the
3730 -   PIC register if needed.  */
3731 +   GOT register if needed.  */
3732  
3733  void
3734  sparc_expand_prologue (void)
3735 @@ -4215,9 +4271,9 @@
3736    if (num_gfregs)
3737      emit_save_or_restore_regs (SORR_SAVE);
3738  
3739 -  /* Load the PIC register if needed.  */
3740 -  if (flag_pic && crtl->uses_pic_offset_table)
3741 -    load_pic_register ();
3742 +  /* Load the GOT register if needed.  */
3743 +  if (crtl->uses_pic_offset_table)
3744 +    load_got_register ();
3745  }
3746  
3747  /* This function generates the assembly code for function entry, which boils
3748 @@ -8705,7 +8761,7 @@
3749  /* Emit the sequence of insns SEQ while preserving the registers REG and REG2.
3750     This is achieved by means of a manual dynamic stack space allocation in
3751     the current frame.  We make the assumption that SEQ doesn't contain any
3752 -   function calls, with the possible exception of calls to the PIC helper.  */
3753 +   function calls, with the possible exception of calls to the GOT helper.  */
3754  
3755  static void
3756  emit_and_preserve (rtx seq, rtx reg, rtx reg2)
3757 @@ -8868,20 +8924,19 @@
3758      {
3759        /* The hoops we have to jump through in order to generate a sibcall
3760          without using delay slots...  */
3761 -      rtx spill_reg, spill_reg2, seq, scratch = gen_rtx_REG (Pmode, 1);
3762 +      rtx spill_reg, seq, scratch = gen_rtx_REG (Pmode, 1);
3763  
3764        if (flag_pic)
3765          {
3766           spill_reg = gen_rtx_REG (word_mode, 15);  /* %o7 */
3767 -         spill_reg2 = gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM);
3768           start_sequence ();
3769 -         /* Delay emitting the PIC helper function because it needs to
3770 +         /* Delay emitting the GOT helper function because it needs to
3771              change the section and we are emitting assembly code.  */
3772 -         load_pic_register ();  /* clobbers %o7 */
3773 +         load_got_register ();  /* clobbers %o7 */
3774           scratch = legitimize_pic_address (funexp, scratch);
3775           seq = get_insns ();
3776           end_sequence ();
3777 -         emit_and_preserve (seq, spill_reg, spill_reg2);
3778 +         emit_and_preserve (seq, spill_reg, pic_offset_table_rtx);
3779         }
3780        else if (TARGET_ARCH32)
3781         {
3782 @@ -9032,17 +9087,15 @@
3783  static void
3784  sparc_file_end (void)
3785  {
3786 -  /* If need to emit the special PIC helper function, do so now.  */
3787 -  if (pic_helper_needed)
3788 +  /* If we need to emit the special GOT helper function, do so now.  */
3789 +  if (got_helper_rtx)
3790      {
3791 -      unsigned int regno = REGNO (pic_offset_table_rtx);
3792 -      const char *pic_name = reg_names[regno];
3793 -      char name[32];
3794 +      const char *name = XSTR (got_helper_rtx, 0);
3795 +      const char *reg_name = reg_names[GLOBAL_OFFSET_TABLE_REGNUM];
3796  #ifdef DWARF2_UNWIND_INFO
3797        bool do_cfi;
3798  #endif
3799  
3800 -      get_pc_thunk_name (name, regno);
3801        if (USE_HIDDEN_LINKONCE)
3802         {
3803           tree decl = build_decl (BUILTINS_LOCATION, FUNCTION_DECL,
3804 @@ -9055,7 +9108,9 @@
3805           make_decl_one_only (decl, DECL_ASSEMBLER_NAME (decl));
3806           DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
3807           DECL_VISIBILITY_SPECIFIED (decl) = 1;
3808 +         resolve_unique_section (decl, 0, flag_function_sections);
3809           allocate_struct_function (decl, true);
3810 +         cfun->is_thunk = 1;
3811           current_function_decl = decl;
3812           init_varasm_status ();
3813           assemble_start_function (decl, name);
3814 @@ -9076,10 +9131,10 @@
3815  #endif
3816        if (flag_delayed_branch)
3817         fprintf (asm_out_file, "\tjmp\t%%o7+8\n\t add\t%%o7, %s, %s\n",
3818 -                pic_name, pic_name);
3819 +                reg_name, reg_name);
3820        else
3821         fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp\t%%o7+8\n\t nop\n",
3822 -                pic_name, pic_name);
3823 +                reg_name, reg_name);
3824  #ifdef DWARF2_UNWIND_INFO
3825        if (do_cfi)
3826         fprintf (asm_out_file, "\t.cfi_endproc\n");
3827 Index: gcc/config/sparc/sparc.h
3828 ===================================================================
3829 --- gcc/config/sparc/sparc.h    (.../tags/gcc_4_5_2_release)    (wersja 169176)
3830 +++ gcc/config/sparc/sparc.h    (.../branches/gcc-4_5-branch)   (wersja 169176)
3831 @@ -964,10 +964,15 @@
3832     not be a register used by the prologue.  */
3833  #define STATIC_CHAIN_REGNUM (TARGET_ARCH64 ? 5 : 2)
3834  
3835 +/* Register which holds the global offset table, if any.  */
3836 +
3837 +#define GLOBAL_OFFSET_TABLE_REGNUM 23
3838 +
3839  /* Register which holds offset table for position-independent
3840     data references.  */
3841  
3842 -#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 23 : INVALID_REGNUM)
3843 +#define PIC_OFFSET_TABLE_REGNUM \
3844 +  (flag_pic ? GLOBAL_OFFSET_TABLE_REGNUM : INVALID_REGNUM)
3845  
3846  /* Pick a default value we can notice from override_options:
3847     !v9: Default is on.
3848 Index: gcc/config/rx/rx.c
3849 ===================================================================
3850 --- gcc/config/rx/rx.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
3851 +++ gcc/config/rx/rx.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
3852 @@ -821,9 +821,34 @@
3853                    const_tree fn_decl_or_type ATTRIBUTE_UNUSED,
3854                    bool       outgoing ATTRIBUTE_UNUSED)
3855  {
3856 -  return gen_rtx_REG (TYPE_MODE (ret_type), FUNC_RETURN_REGNUM);
3857 +  enum machine_mode mode = TYPE_MODE (ret_type);
3858 +
3859 +  /* RX ABI specifies that small integer types are
3860 +     promoted to int when returned by a function.  */
3861 +  if (GET_MODE_SIZE (mode) > 0 && GET_MODE_SIZE (mode) < 4)
3862 +    return gen_rtx_REG (SImode, FUNC_RETURN_REGNUM);
3863 +    
3864 +  return gen_rtx_REG (mode, FUNC_RETURN_REGNUM);
3865  }
3866  
3867 +/* TARGET_PROMOTE_FUNCTION_MODE must behave in the same way with
3868 +   regard to function returns as does TARGET_FUNCTION_VALUE.  */
3869 +
3870 +static enum machine_mode
3871 +rx_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
3872 +                         enum machine_mode mode,
3873 +                         int * punsignedp ATTRIBUTE_UNUSED,
3874 +                         const_tree funtype ATTRIBUTE_UNUSED,
3875 +                         int for_return)
3876 +{
3877 +  if (for_return != 1
3878 +      || GET_MODE_SIZE (mode) >= 4
3879 +      || GET_MODE_SIZE (mode) < 1)
3880 +    return mode;
3881 +
3882 +  return SImode;
3883 +}
3884 +
3885  static bool
3886  rx_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
3887  {
3888 @@ -2759,6 +2784,9 @@
3889  #undef  TARGET_CC_MODES_COMPATIBLE
3890  #define TARGET_CC_MODES_COMPATIBLE             rx_cc_modes_compatible
3891  
3892 +#undef  TARGET_PROMOTE_FUNCTION_MODE
3893 +#define TARGET_PROMOTE_FUNCTION_MODE           rx_promote_function_mode
3894 +
3895  struct gcc_target targetm = TARGET_INITIALIZER;
3896  
3897  /* #include "gt-rx.h" */
3898 Index: gcc/config/i386/i386.md
3899 ===================================================================
3900 --- gcc/config/i386/i386.md     (.../tags/gcc_4_5_2_release)    (wersja 169176)
3901 +++ gcc/config/i386/i386.md     (.../branches/gcc-4_5-branch)   (wersja 169176)
3902 @@ -92,6 +92,7 @@
3903     (UNSPEC_TLS_GD              21)
3904     (UNSPEC_TLS_LD_BASE         22)
3905     (UNSPEC_TLSDESC             23)
3906 +   (UNSPEC_TLS_IE_SUN          24)
3907  
3908     ; Other random patterns
3909     (UNSPEC_SCAS                        30)
3910 @@ -14702,6 +14703,18 @@
3911     (set_attr "memory" "load")
3912     (set_attr "imm_disp" "false")])
3913  
3914 +;; The Sun linker took the AMD64 TLS spec literally and can only handle
3915 +;; %rax as destination of the initial executable code sequence.
3916 +(define_insn "tls_initial_exec_64_sun"
3917 +  [(set (match_operand:DI 0 "register_operand" "=a")
3918 +       (unspec:DI
3919 +        [(match_operand:DI 1 "tls_symbolic_operand" "")]
3920 +        UNSPEC_TLS_IE_SUN))
3921 +   (clobber (reg:CC FLAGS_REG))]
3922 +  "TARGET_64BIT && TARGET_SUN_TLS"
3923 +  "mov{q}\t{%%fs:0, %0|%0, QWORD PTR fs:0}\n\tadd{q}\t{%a1@gottpoff(%%rip), %0|%0, %a1@gottpoff[rip]}"
3924 +  [(set_attr "type" "multi")])
3925 +
3926  ;; GNU2 TLS patterns can be split.
3927  
3928  (define_expand "tls_dynamic_gnu2_32"
3929 Index: gcc/config/i386/sse.md
3930 ===================================================================
3931 --- gcc/config/i386/sse.md      (.../tags/gcc_4_5_2_release)    (wersja 169176)
3932 +++ gcc/config/i386/sse.md      (.../branches/gcc-4_5-branch)   (wersja 169176)
3933 @@ -5011,7 +5011,7 @@
3934     movsd\t{%2, %0|%0, %2}
3935     movlpd\t{%2, %0|%0, %2}
3936     movsd\t{%2, %0|%0, %2}
3937 -   shufpd\t{$2, %2, %0|%0, %2, 2}
3938 +   shufpd\t{$2, %1, %0|%0, %1, 2}
3939     movhpd\t{%H1, %0|%0, %H1}
3940     #
3941     #
3942 @@ -5090,7 +5090,7 @@
3943     movsd\t{%2, %0|%0, %2}
3944     movlpd\t{%2, %0|%0, %2}
3945     movlpd\t{%2, %0|%0, %2}
3946 -   shufpd\t{$2, %2, %0|%0, %2, 2}
3947 +   shufpd\t{$2, %1, %0|%0, %1, 2}
3948     movhps\t{%H1, %0|%0, %H1}
3949     movhps\t{%1, %H0|%H0, %1}"
3950    [(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,ssemov")
3951 @@ -12097,7 +12097,7 @@
3952    [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
3953         (unspec:AVXMODEF2P
3954           [(match_operand:AVXMODEF2P 1 "memory_operand" "m")
3955 -          (match_operand:AVXMODEF2P 2 "register_operand" "x")
3956 +          (match_operand:<avxpermvecmode> 2 "register_operand" "x")
3957            (match_dup 0)]
3958           UNSPEC_MASKLOAD))]
3959    "TARGET_AVX"
3960 @@ -12110,7 +12110,7 @@
3961  (define_insn "avx_maskstorep<avxmodesuffixf2c><avxmodesuffix>"
3962    [(set (match_operand:AVXMODEF2P 0 "memory_operand" "=m")
3963         (unspec:AVXMODEF2P
3964 -         [(match_operand:AVXMODEF2P 1 "register_operand" "x")
3965 +         [(match_operand:<avxpermvecmode> 1 "register_operand" "x")
3966            (match_operand:AVXMODEF2P 2 "register_operand" "x")
3967            (match_dup 0)]
3968           UNSPEC_MASKSTORE))]
3969 Index: gcc/config/i386/i386-builtin-types.def
3970 ===================================================================
3971 --- gcc/config/i386/i386-builtin-types.def      (.../tags/gcc_4_5_2_release)    (wersja 169176)
3972 +++ gcc/config/i386/i386-builtin-types.def      (.../branches/gcc-4_5-branch)   (wersja 169176)
3973 @@ -229,7 +229,7 @@
3974  DEF_FUNCTION_TYPE (V1DI, V1DI, V1DI)
3975  DEF_FUNCTION_TYPE (V1DI, V2SI, V2SI)
3976  DEF_FUNCTION_TYPE (V1DI, V8QI, V8QI)
3977 -DEF_FUNCTION_TYPE (V2DF, PCV2DF, V2DF)
3978 +DEF_FUNCTION_TYPE (V2DF, PCV2DF, V2DI)
3979  DEF_FUNCTION_TYPE (V2DF, V2DF, DI)
3980  DEF_FUNCTION_TYPE (V2DF, V2DF, INT)
3981  DEF_FUNCTION_TYPE (V2DF, V2DF, PCDOUBLE)
3982 @@ -251,7 +251,7 @@
3983  DEF_FUNCTION_TYPE (V2SI, V2SI, SI)
3984  DEF_FUNCTION_TYPE (V2SI, V2SI, V2SI)
3985  DEF_FUNCTION_TYPE (V2SI, V4HI, V4HI)
3986 -DEF_FUNCTION_TYPE (V4DF, PCV4DF, V4DF)
3987 +DEF_FUNCTION_TYPE (V4DF, PCV4DF, V4DI)
3988  DEF_FUNCTION_TYPE (V4DF, V4DF, INT)
3989  DEF_FUNCTION_TYPE (V4DF, V4DF, V4DF)
3990  DEF_FUNCTION_TYPE (V4DF, V4DF, V4DI)
3991 @@ -260,7 +260,7 @@
3992  DEF_FUNCTION_TYPE (V4HI, V4HI, SI)
3993  DEF_FUNCTION_TYPE (V4HI, V4HI, V4HI)
3994  DEF_FUNCTION_TYPE (V4HI, V8QI, V8QI)
3995 -DEF_FUNCTION_TYPE (V4SF, PCV4SF, V4SF)
3996 +DEF_FUNCTION_TYPE (V4SF, PCV4SF, V4SI)
3997  DEF_FUNCTION_TYPE (V4SF, V4SF, DI)
3998  DEF_FUNCTION_TYPE (V4SF, V4SF, INT)
3999  DEF_FUNCTION_TYPE (V4SF, V4SF, PCV2SF)
4000 @@ -284,7 +284,7 @@
4001  DEF_FUNCTION_TYPE (V8HI, V8HI, V8HI)
4002  DEF_FUNCTION_TYPE (V8QI, V4HI, V4HI)
4003  DEF_FUNCTION_TYPE (V8QI, V8QI, V8QI)
4004 -DEF_FUNCTION_TYPE (V8SF, PCV8SF, V8SF)
4005 +DEF_FUNCTION_TYPE (V8SF, PCV8SF, V8SI)
4006  DEF_FUNCTION_TYPE (V8SF, V8SF, INT)
4007  DEF_FUNCTION_TYPE (V8SF, V8SF, V8SF)
4008  DEF_FUNCTION_TYPE (V8SF, V8SF, V8SI)
4009 @@ -343,10 +343,10 @@
4010  DEF_FUNCTION_TYPE (V8SI, V8SI, V8SI, INT)
4011  DEF_FUNCTION_TYPE (V8SI, V8SI, V8SI, V8SI)
4012  DEF_FUNCTION_TYPE (VOID, PCVOID, UNSIGNED, UNSIGNED)
4013 -DEF_FUNCTION_TYPE (VOID, PV2DF, V2DF, V2DF)
4014 -DEF_FUNCTION_TYPE (VOID, PV4DF, V4DF, V4DF)
4015 -DEF_FUNCTION_TYPE (VOID, PV4SF, V4SF, V4SF)
4016 -DEF_FUNCTION_TYPE (VOID, PV8SF, V8SF, V8SF)
4017 +DEF_FUNCTION_TYPE (VOID, PV2DF, V2DI, V2DF)
4018 +DEF_FUNCTION_TYPE (VOID, PV4DF, V4DI, V4DF)
4019 +DEF_FUNCTION_TYPE (VOID, PV4SF, V4SI, V4SF)
4020 +DEF_FUNCTION_TYPE (VOID, PV8SF, V8SI, V8SF)
4021  DEF_FUNCTION_TYPE (VOID, UINT, UINT, UINT)
4022  DEF_FUNCTION_TYPE (VOID, UINT64, UINT, UINT)
4023  DEF_FUNCTION_TYPE (VOID, V16QI, V16QI, PCHAR)
4024 Index: gcc/config/i386/avxintrin.h
4025 ===================================================================
4026 --- gcc/config/i386/avxintrin.h (.../tags/gcc_4_5_2_release)    (wersja 169176)
4027 +++ gcc/config/i386/avxintrin.h (.../branches/gcc-4_5-branch)   (wersja 169176)
4028 @@ -890,55 +890,55 @@
4029  }
4030  
4031  extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4032 -_mm_maskload_pd (double const *__P, __m128d __M)
4033 +_mm_maskload_pd (double const *__P, __m128i __M)
4034  {
4035    return (__m128d) __builtin_ia32_maskloadpd ((const __v2df *)__P,
4036 -                                             (__v2df)__M);
4037 +                                             (__v2di)__M);
4038  }
4039  
4040  extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4041 -_mm_maskstore_pd (double *__P, __m128d __M, __m128d __A)
4042 +_mm_maskstore_pd (double *__P, __m128i __M, __m128d __A)
4043  {
4044 -  __builtin_ia32_maskstorepd ((__v2df *)__P, (__v2df)__M, (__v2df)__A);
4045 +  __builtin_ia32_maskstorepd ((__v2df *)__P, (__v2di)__M, (__v2df)__A);
4046  }
4047  
4048  extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4049 -_mm256_maskload_pd (double const *__P, __m256d __M)
4050 +_mm256_maskload_pd (double const *__P, __m256i __M)
4051  {
4052    return (__m256d) __builtin_ia32_maskloadpd256 ((const __v4df *)__P,
4053 -                                                (__v4df)__M);
4054 +                                                (__v4di)__M);
4055  }
4056  
4057  extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4058 -_mm256_maskstore_pd (double *__P, __m256d __M, __m256d __A)
4059 +_mm256_maskstore_pd (double *__P, __m256i __M, __m256d __A)
4060  {
4061 -  __builtin_ia32_maskstorepd256 ((__v4df *)__P, (__v4df)__M, (__v4df)__A);
4062 +  __builtin_ia32_maskstorepd256 ((__v4df *)__P, (__v4di)__M, (__v4df)__A);
4063  }
4064  
4065  extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4066 -_mm_maskload_ps (float const *__P, __m128 __M)
4067 +_mm_maskload_ps (float const *__P, __m128i __M)
4068  {
4069    return (__m128) __builtin_ia32_maskloadps ((const __v4sf *)__P,
4070 -                                            (__v4sf)__M);
4071 +                                            (__v4si)__M);
4072  }
4073  
4074  extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4075 -_mm_maskstore_ps (float *__P, __m128 __M, __m128 __A)
4076 +_mm_maskstore_ps (float *__P, __m128i __M, __m128 __A)
4077  {
4078 -  __builtin_ia32_maskstoreps ((__v4sf *)__P, (__v4sf)__M, (__v4sf)__A);
4079 +  __builtin_ia32_maskstoreps ((__v4sf *)__P, (__v4si)__M, (__v4sf)__A);
4080  }
4081  
4082  extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4083 -_mm256_maskload_ps (float const *__P, __m256 __M)
4084 +_mm256_maskload_ps (float const *__P, __m256i __M)
4085  {
4086    return (__m256) __builtin_ia32_maskloadps256 ((const __v8sf *)__P,
4087 -                                               (__v8sf)__M);
4088 +                                               (__v8si)__M);
4089  }
4090  
4091  extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4092 -_mm256_maskstore_ps (float *__P, __m256 __M, __m256 __A)
4093 +_mm256_maskstore_ps (float *__P, __m256i __M, __m256 __A)
4094  {
4095 -  __builtin_ia32_maskstoreps256 ((__v8sf *)__P, (__v8sf)__M, (__v8sf)__A);
4096 +  __builtin_ia32_maskstoreps256 ((__v8sf *)__P, (__v8si)__M, (__v8sf)__A);
4097  }
4098  
4099  extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
4100 Index: gcc/config/i386/i386.c
4101 ===================================================================
4102 --- gcc/config/i386/i386.c      (.../tags/gcc_4_5_2_release)    (wersja 169176)
4103 +++ gcc/config/i386/i386.c      (.../branches/gcc-4_5-branch)   (wersja 169176)
4104 @@ -10438,6 +10438,17 @@
4105      case TLS_MODEL_INITIAL_EXEC:
4106        if (TARGET_64BIT)
4107         {
4108 +         if (TARGET_SUN_TLS)
4109 +           {
4110 +             /* The Sun linker took the AMD64 TLS spec literally
4111 +                and can only handle %rax as destination of the
4112 +                initial executable code sequence.  */
4113 +
4114 +             dest = gen_reg_rtx (Pmode);
4115 +             emit_insn (gen_tls_initial_exec_64_sun (dest, x));
4116 +             return dest;
4117 +           }
4118 +
4119           pic = NULL;
4120           type = UNSPEC_GOTNTPOFF;
4121         }
4122 @@ -11027,7 +11038,11 @@
4123         return orig_x;
4124        x = XVECEXP (XEXP (x, 0), 0, 0);
4125        if (GET_MODE (orig_x) != Pmode)
4126 -       return simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
4127 +       {
4128 +         x = simplify_gen_subreg (GET_MODE (orig_x), x, Pmode, 0);
4129 +         if (x == NULL_RTX)
4130 +           return orig_x;
4131 +       }
4132        return x;
4133      }
4134  
4135 @@ -11096,7 +11111,11 @@
4136         return orig_x;
4137      }
4138    if (GET_MODE (orig_x) != Pmode && MEM_P (orig_x))
4139 -    return simplify_gen_subreg (GET_MODE (orig_x), result, Pmode, 0);
4140 +    {
4141 +      result = simplify_gen_subreg (GET_MODE (orig_x), result, Pmode, 0);
4142 +      if (result == NULL_RTX)
4143 +       return orig_x;
4144 +    }
4145    return result;
4146  }
4147  
4148 @@ -21638,14 +21657,14 @@
4149    { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movntv4df, "__builtin_ia32_movntpd256", IX86_BUILTIN_MOVNTPD256, UNKNOWN, (int) VOID_FTYPE_PDOUBLE_V4DF },
4150    { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movntv8sf, "__builtin_ia32_movntps256", IX86_BUILTIN_MOVNTPS256, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V8SF },
4151  
4152 -  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd, "__builtin_ia32_maskloadpd", IX86_BUILTIN_MASKLOADPD, UNKNOWN, (int) V2DF_FTYPE_PCV2DF_V2DF },
4153 -  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps, "__builtin_ia32_maskloadps", IX86_BUILTIN_MASKLOADPS, UNKNOWN, (int) V4SF_FTYPE_PCV4SF_V4SF },
4154 -  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd256, "__builtin_ia32_maskloadpd256", IX86_BUILTIN_MASKLOADPD256, UNKNOWN, (int) V4DF_FTYPE_PCV4DF_V4DF },
4155 -  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps256, "__builtin_ia32_maskloadps256", IX86_BUILTIN_MASKLOADPS256, UNKNOWN, (int) V8SF_FTYPE_PCV8SF_V8SF },
4156 -  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd, "__builtin_ia32_maskstorepd", IX86_BUILTIN_MASKSTOREPD, UNKNOWN, (int) VOID_FTYPE_PV2DF_V2DF_V2DF },
4157 -  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps, "__builtin_ia32_maskstoreps", IX86_BUILTIN_MASKSTOREPS, UNKNOWN, (int) VOID_FTYPE_PV4SF_V4SF_V4SF },
4158 -  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd256, "__builtin_ia32_maskstorepd256", IX86_BUILTIN_MASKSTOREPD256, UNKNOWN, (int) VOID_FTYPE_PV4DF_V4DF_V4DF },
4159 -  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps256, "__builtin_ia32_maskstoreps256", IX86_BUILTIN_MASKSTOREPS256, UNKNOWN, (int) VOID_FTYPE_PV8SF_V8SF_V8SF },
4160 +  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd, "__builtin_ia32_maskloadpd", IX86_BUILTIN_MASKLOADPD, UNKNOWN, (int) V2DF_FTYPE_PCV2DF_V2DI },
4161 +  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps, "__builtin_ia32_maskloadps", IX86_BUILTIN_MASKLOADPS, UNKNOWN, (int) V4SF_FTYPE_PCV4SF_V4SI },
4162 +  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd256, "__builtin_ia32_maskloadpd256", IX86_BUILTIN_MASKLOADPD256, UNKNOWN, (int) V4DF_FTYPE_PCV4DF_V4DI },
4163 +  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps256, "__builtin_ia32_maskloadps256", IX86_BUILTIN_MASKLOADPS256, UNKNOWN, (int) V8SF_FTYPE_PCV8SF_V8SI },
4164 +  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd, "__builtin_ia32_maskstorepd", IX86_BUILTIN_MASKSTOREPD, UNKNOWN, (int) VOID_FTYPE_PV2DF_V2DI_V2DF },
4165 +  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps, "__builtin_ia32_maskstoreps", IX86_BUILTIN_MASKSTOREPS, UNKNOWN, (int) VOID_FTYPE_PV4SF_V4SI_V4SF },
4166 +  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd256, "__builtin_ia32_maskstorepd256", IX86_BUILTIN_MASKSTOREPD256, UNKNOWN, (int) VOID_FTYPE_PV4DF_V4DI_V4DF },
4167 +  { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps256, "__builtin_ia32_maskstoreps256", IX86_BUILTIN_MASKSTOREPS256, UNKNOWN, (int) VOID_FTYPE_PV8SF_V8SI_V8SF },
4168  
4169    { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_llwpcb, "__builtin_ia32_llwpcb", IX86_BUILTIN_LLWPCB, UNKNOWN, (int) VOID_FTYPE_PVOID },
4170    { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_slwpcb, "__builtin_ia32_slwpcb", IX86_BUILTIN_SLWPCB, UNKNOWN, (int) PVOID_FTYPE_VOID },
4171 @@ -23927,18 +23946,18 @@
4172        klass = load;
4173        memory = 1;
4174        break;
4175 -    case V8SF_FTYPE_PCV8SF_V8SF:
4176 -    case V4DF_FTYPE_PCV4DF_V4DF:
4177 -    case V4SF_FTYPE_PCV4SF_V4SF:
4178 -    case V2DF_FTYPE_PCV2DF_V2DF:
4179 +    case V8SF_FTYPE_PCV8SF_V8SI:
4180 +    case V4DF_FTYPE_PCV4DF_V4DI:
4181 +    case V4SF_FTYPE_PCV4SF_V4SI:
4182 +    case V2DF_FTYPE_PCV2DF_V2DI:
4183        nargs = 2;
4184        klass = load;
4185        memory = 0;
4186        break;
4187 -    case VOID_FTYPE_PV8SF_V8SF_V8SF:
4188 -    case VOID_FTYPE_PV4DF_V4DF_V4DF:
4189 -    case VOID_FTYPE_PV4SF_V4SF_V4SF:
4190 -    case VOID_FTYPE_PV2DF_V2DF_V2DF:
4191 +    case VOID_FTYPE_PV8SF_V8SI_V8SF:
4192 +    case VOID_FTYPE_PV4DF_V4DI_V4DF:
4193 +    case VOID_FTYPE_PV4SF_V4SI_V4SF:
4194 +    case VOID_FTYPE_PV2DF_V2DI_V2DF:
4195        nargs = 2;
4196        klass = store;
4197        /* Reserve memory operand for target.  */
4198 Index: gcc/config/rs6000/rs6000.c
4199 ===================================================================
4200 --- gcc/config/rs6000/rs6000.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
4201 +++ gcc/config/rs6000/rs6000.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
4202 @@ -4472,7 +4472,7 @@
4203  {
4204    enum machine_mode mode = GET_MODE (vec);
4205    enum machine_mode inner_mode = GET_MODE_INNER (mode);
4206 -  rtx mem, x;
4207 +  rtx mem;
4208  
4209    if (VECTOR_MEM_VSX_P (mode) && (mode == V2DFmode || mode == V2DImode))
4210      {
4211 @@ -4485,17 +4485,11 @@
4212    /* Allocate mode-sized buffer.  */
4213    mem = assign_stack_temp (mode, GET_MODE_SIZE (mode), 0);
4214  
4215 +  emit_move_insn (mem, vec);
4216 +
4217    /* Add offset to field within buffer matching vector element.  */
4218 -  mem = adjust_address_nv (mem, mode, elt * GET_MODE_SIZE (inner_mode));
4219 +  mem = adjust_address_nv (mem, inner_mode, elt * GET_MODE_SIZE (inner_mode));
4220  
4221 -  /* Store single field into mode-sized buffer.  */
4222 -  x = gen_rtx_UNSPEC (VOIDmode,
4223 -                     gen_rtvec (1, const0_rtx), UNSPEC_STVE);
4224 -  emit_insn (gen_rtx_PARALLEL (VOIDmode,
4225 -                              gen_rtvec (2,
4226 -                                         gen_rtx_SET (VOIDmode,
4227 -                                                      mem, vec),
4228 -                                         x)));
4229    emit_move_insn (target, adjust_address_nv (mem, inner_mode, 0));
4230  }
4231  
4232 @@ -9897,6 +9891,7 @@
4233    rtx op2 = expand_normal (arg2);
4234    rtx pat, addr;
4235    enum machine_mode tmode = insn_data[icode].operand[0].mode;
4236 +  enum machine_mode smode = insn_data[icode].operand[1].mode;
4237    enum machine_mode mode1 = Pmode;
4238    enum machine_mode mode2 = Pmode;
4239  
4240 @@ -9906,8 +9901,8 @@
4241        || arg2 == error_mark_node)
4242      return const0_rtx;
4243  
4244 -  if (! (*insn_data[icode].operand[1].predicate) (op0, tmode))
4245 -    op0 = copy_to_mode_reg (tmode, op0);
4246 +  if (! (*insn_data[icode].operand[1].predicate) (op0, smode))
4247 +    op0 = copy_to_mode_reg (smode, op0);
4248  
4249    op2 = copy_to_mode_reg (mode2, op2);
4250  
4251 Index: gcc/config/rs6000/altivec.md
4252 ===================================================================
4253 --- gcc/config/rs6000/altivec.md        (.../tags/gcc_4_5_2_release)    (wersja 169176)
4254 +++ gcc/config/rs6000/altivec.md        (.../branches/gcc-4_5-branch)   (wersja 169176)
4255 @@ -171,6 +171,7 @@
4256  (define_mode_iterator VM2 [V4SI V8HI V16QI V4SF V2DF V2DI])
4257  
4258  (define_mode_attr VI_char [(V4SI "w") (V8HI "h") (V16QI "b")])
4259 +(define_mode_attr VI_scalar [(V4SI "SI") (V8HI "HI") (V16QI "QI")])
4260  
4261  ;; Vector move instructions.
4262  (define_insn "*altivec_mov<mode>"
4263 @@ -1777,19 +1778,15 @@
4264    [(set_attr "type" "vecstore")])
4265  
4266  (define_insn "altivec_stve<VI_char>x"
4267 -  [(parallel
4268 -    [(set (match_operand:VI 0 "memory_operand" "=Z")
4269 -         (match_operand:VI 1 "register_operand" "v"))
4270 -     (unspec [(const_int 0)] UNSPEC_STVE)])]
4271 +  [(set (match_operand:<VI_scalar> 0 "memory_operand" "=Z")
4272 +       (unspec:<VI_scalar> [(match_operand:VI 1 "register_operand" "v")] UNSPEC_STVE))]
4273    "TARGET_ALTIVEC"
4274    "stve<VI_char>x %1,%y0"
4275    [(set_attr "type" "vecstore")])
4276  
4277  (define_insn "*altivec_stvesfx"
4278 -  [(parallel
4279 -    [(set (match_operand:V4SF 0 "memory_operand" "=Z")
4280 -         (match_operand:V4SF 1 "register_operand" "v"))
4281 -     (unspec [(const_int 0)] UNSPEC_STVE)])]
4282 +  [(set (match_operand:SF 0 "memory_operand" "=Z")
4283 +       (unspec:SF [(match_operand:V4SF 1 "register_operand" "v")] UNSPEC_STVE))]
4284    "TARGET_ALTIVEC"
4285    "stvewx %1,%y0"
4286    [(set_attr "type" "vecstore")])
4287 Index: gcc/config/arm/arm.c
4288 ===================================================================
4289 --- gcc/config/arm/arm.c        (.../tags/gcc_4_5_2_release)    (wersja 169176)
4290 +++ gcc/config/arm/arm.c        (.../branches/gcc-4_5-branch)   (wersja 169176)
4291 @@ -1114,6 +1114,7 @@
4292                              va_list_type);
4293    DECL_ARTIFICIAL (va_list_name) = 1;
4294    TYPE_NAME (va_list_type) = va_list_name;
4295 +  TYPE_STUB_DECL (va_list_type) = va_list_name;
4296    /* Create the __ap field.  */
4297    ap_field = build_decl (BUILTINS_LOCATION,
4298                          FIELD_DECL, 
4299 Index: gcc/config/pa/pa.md
4300 ===================================================================
4301 --- gcc/config/pa/pa.md (.../tags/gcc_4_5_2_release)    (wersja 169176)
4302 +++ gcc/config/pa/pa.md (.../branches/gcc-4_5-branch)   (wersja 169176)
4303 @@ -811,7 +811,7 @@
4304                          (match_operand:DI 3 "arith11_operand" "rI"))
4305                  (match_operand:DI 1 "register_operand" "r")))]
4306    "TARGET_64BIT"
4307 -  "sub%I3 %3,%2,%%r0\;add,dc %%r0,%1,%0"
4308 +  "sub%I3,* %3,%2,%%r0\;add,dc %%r0,%1,%0"
4309    [(set_attr "type" "binary")
4310     (set_attr "length" "8")])
4311  
4312 @@ -833,7 +833,7 @@
4313                          (match_operand:DI 3 "register_operand" "r"))
4314                  (match_operand:DI 1 "register_operand" "r")))]
4315    "TARGET_64BIT"
4316 -  "sub %2,%3,%%r0\;add,dc %%r0,%1,%0"
4317 +  "sub,* %2,%3,%%r0\;add,dc %%r0,%1,%0"
4318    [(set_attr "type" "binary")
4319     (set_attr "length" "8")])
4320  
4321 @@ -856,7 +856,7 @@
4322                          (match_operand:DI 3 "int11_operand" "I"))
4323                  (match_operand:DI 1 "register_operand" "r")))]
4324    "TARGET_64BIT"
4325 -  "addi %k3,%2,%%r0\;add,dc %%r0,%1,%0"
4326 +  "addi,* %k3,%2,%%r0\;add,dc %%r0,%1,%0"
4327    [(set_attr "type" "binary")
4328     (set_attr "length" "8")])
4329  
4330 @@ -902,7 +902,7 @@
4331                   (gtu:DI (match_operand:DI 2 "register_operand" "r")
4332                           (match_operand:DI 3 "arith11_operand" "rI"))))]
4333    "TARGET_64BIT"
4334 -  "sub%I3 %3,%2,%%r0\;sub,db %1,%%r0,%0"
4335 +  "sub%I3,* %3,%2,%%r0\;sub,db %1,%%r0,%0"
4336    [(set_attr "type" "binary")
4337     (set_attr "length" "8")])
4338  
4339 @@ -924,7 +924,7 @@
4340                                     (match_operand:DI 3 "arith11_operand" "rI")))
4341                   (match_operand:DI 4 "register_operand" "r")))]
4342    "TARGET_64BIT"
4343 -  "sub%I3 %3,%2,%%r0\;sub,db %1,%4,%0"
4344 +  "sub%I3,* %3,%2,%%r0\;sub,db %1,%4,%0"
4345    [(set_attr "type" "binary")
4346     (set_attr "length" "8")])
4347  
4348 @@ -946,7 +946,7 @@
4349                   (ltu:DI (match_operand:DI 2 "register_operand" "r")
4350                           (match_operand:DI 3 "register_operand" "r"))))]
4351    "TARGET_64BIT"
4352 -  "sub %2,%3,%%r0\;sub,db %1,%%r0,%0"
4353 +  "sub,* %2,%3,%%r0\;sub,db %1,%%r0,%0"
4354    [(set_attr "type" "binary")
4355     (set_attr "length" "8")])
4356  
4357 @@ -968,7 +968,7 @@
4358                                     (match_operand:DI 3 "register_operand" "r")))
4359                   (match_operand:DI 4 "register_operand" "r")))]
4360    "TARGET_64BIT"
4361 -  "sub %2,%3,%%r0\;sub,db %1,%4,%0"
4362 +  "sub,* %2,%3,%%r0\;sub,db %1,%4,%0"
4363    [(set_attr "type" "binary")
4364     (set_attr "length" "8")])
4365  
4366 @@ -991,7 +991,7 @@
4367                   (leu:DI (match_operand:DI 2 "register_operand" "r")
4368                           (match_operand:DI 3 "int11_operand" "I"))))]
4369    "TARGET_64BIT"
4370 -  "addi %k3,%2,%%r0\;sub,db %1,%%r0,%0"
4371 +  "addi,* %k3,%2,%%r0\;sub,db %1,%%r0,%0"
4372    [(set_attr "type" "binary")
4373     (set_attr "length" "8")])
4374  
4375 @@ -1013,7 +1013,7 @@
4376                                     (match_operand:DI 3 "int11_operand" "I")))
4377                   (match_operand:DI 4 "register_operand" "r")))]
4378    "TARGET_64BIT"
4379 -  "addi %k3,%2,%%r0\;sub,db %1,%4,%0"
4380 +  "addi,* %k3,%2,%%r0\;sub,db %1,%4,%0"
4381    [(set_attr "type" "binary")
4382     (set_attr "length" "8")])
4383  
4384 Index: gcc/config/pa/pa.c
4385 ===================================================================
4386 --- gcc/config/pa/pa.c  (.../tags/gcc_4_5_2_release)    (wersja 169176)
4387 +++ gcc/config/pa/pa.c  (.../branches/gcc-4_5-branch)   (wersja 169176)
4388 @@ -6097,37 +6097,94 @@
4389  }
4390  
4391  /* Return TRUE if INSN, a jump insn, has an unfilled delay slot and
4392 -   it branches to the next real instruction.  Otherwise, return FALSE.  */
4393 +   it branches into the delay slot.  Otherwise, return FALSE.  */
4394  
4395  static bool
4396  branch_to_delay_slot_p (rtx insn)
4397  {
4398 +  rtx jump_insn;
4399 +
4400    if (dbr_sequence_length ())
4401      return FALSE;
4402  
4403 -  return next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn);
4404 +  jump_insn = next_active_insn (JUMP_LABEL (insn));
4405 +  while (insn)
4406 +    {
4407 +      insn = next_active_insn (insn);
4408 +      if (jump_insn == insn)
4409 +       return TRUE;
4410 +
4411 +      /* We can't rely on the length of asms.  So, we return FALSE when
4412 +        the branch is followed by an asm.  */
4413 +      if (!insn
4414 +         || GET_CODE (PATTERN (insn)) == ASM_INPUT
4415 +         || extract_asm_operands (PATTERN (insn)) != NULL_RTX
4416 +         || get_attr_length (insn) > 0)
4417 +       break;
4418 +    }
4419 +
4420 +  return FALSE;
4421  }
4422  
4423 -/* Return TRUE if INSN, a jump insn, needs a nop in its delay slot.
4424 +/* Return TRUE if INSN, a forward jump insn, needs a nop in its delay slot.
4425  
4426     This occurs when INSN has an unfilled delay slot and is followed
4427 -   by an ASM_INPUT.  Disaster can occur if the ASM_INPUT is empty and
4428 -   the jump branches into the delay slot.  So, we add a nop in the delay
4429 -   slot just to be safe.  This messes up our instruction count, but we
4430 -   don't know how big the ASM_INPUT insn is anyway.  */
4431 +   by an asm.  Disaster can occur if the asm is empty and the jump
4432 +   branches into the delay slot.  So, we add a nop in the delay slot
4433 +   when this occurs.  */
4434  
4435  static bool
4436  branch_needs_nop_p (rtx insn)
4437  {
4438 -  rtx next_insn;
4439 +  rtx jump_insn;
4440  
4441    if (dbr_sequence_length ())
4442      return FALSE;
4443  
4444 -  next_insn = next_real_insn (insn);
4445 -  return GET_CODE (PATTERN (next_insn)) == ASM_INPUT;
4446 +  jump_insn = next_active_insn (JUMP_LABEL (insn));
4447 +  while (insn)
4448 +    {
4449 +      insn = next_active_insn (insn);
4450 +      if (!insn || jump_insn == insn)
4451 +       return TRUE;
4452 +
4453 +      if (!(GET_CODE (PATTERN (insn)) == ASM_INPUT
4454 +          || extract_asm_operands (PATTERN (insn)) != NULL_RTX)
4455 +         && get_attr_length (insn) > 0)
4456 +       break;
4457 +    }
4458 +
4459 +  return FALSE;
4460  }
4461  
4462 +/* Return TRUE if INSN, a forward jump insn, can use nullification
4463 +   to skip the following instruction.  This avoids an extra cycle due
4464 +   to a mis-predicted branch when we fall through.  */
4465 +
4466 +static bool
4467 +use_skip_p (rtx insn)
4468 +{
4469 +  rtx jump_insn = next_active_insn (JUMP_LABEL (insn));
4470 +
4471 +  while (insn)
4472 +    {
4473 +      insn = next_active_insn (insn);
4474 +
4475 +      /* We can't rely on the length of asms, so we can't skip asms.  */
4476 +      if (!insn
4477 +         || GET_CODE (PATTERN (insn)) == ASM_INPUT
4478 +         || extract_asm_operands (PATTERN (insn)) != NULL_RTX)
4479 +       break;
4480 +      if (get_attr_length (insn) == 4
4481 +         && jump_insn == next_active_insn (insn))
4482 +       return TRUE;
4483 +      if (get_attr_length (insn) > 0)
4484 +       break;
4485 +    }
4486 +
4487 +  return FALSE;
4488 +}
4489 +
4490  /* This routine handles all the normal conditional branch sequences we
4491     might need to generate.  It handles compare immediate vs compare
4492     register, nullification of delay slots, varying length branches,
4493 @@ -6139,7 +6196,7 @@
4494  output_cbranch (rtx *operands, int negated, rtx insn)
4495  {
4496    static char buf[100];
4497 -  int useskip = 0;
4498 +  bool useskip;
4499    int nullify = INSN_ANNULLED_BRANCH_P (insn);
4500    int length = get_attr_length (insn);
4501    int xdelay;
4502 @@ -6177,12 +6234,7 @@
4503    /* A forward branch over a single nullified insn can be done with a
4504       comclr instruction.  This avoids a single cycle penalty due to
4505       mis-predicted branch if we fall through (branch not taken).  */
4506 -  if (length == 4
4507 -      && next_real_insn (insn) != 0
4508 -      && get_attr_length (next_real_insn (insn)) == 4
4509 -      && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn))
4510 -      && nullify)
4511 -    useskip = 1;
4512 +  useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE;
4513  
4514    switch (length)
4515      {
4516 @@ -6470,7 +6522,7 @@
4517  output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
4518  {
4519    static char buf[100];
4520 -  int useskip = 0;
4521 +  bool useskip;
4522    int nullify = INSN_ANNULLED_BRANCH_P (insn);
4523    int length = get_attr_length (insn);
4524    int xdelay;
4525 @@ -6496,14 +6548,8 @@
4526    /* A forward branch over a single nullified insn can be done with a
4527       extrs instruction.  This avoids a single cycle penalty due to
4528       mis-predicted branch if we fall through (branch not taken).  */
4529 +  useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE;
4530  
4531 -  if (length == 4
4532 -      && next_real_insn (insn) != 0
4533 -      && get_attr_length (next_real_insn (insn)) == 4
4534 -      && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn))
4535 -      && nullify)
4536 -    useskip = 1;
4537 -
4538    switch (length)
4539      {
4540  
4541 @@ -6661,7 +6707,7 @@
4542  output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
4543  {
4544    static char buf[100];
4545 -  int useskip = 0;
4546 +  bool useskip;
4547    int nullify = INSN_ANNULLED_BRANCH_P (insn);
4548    int length = get_attr_length (insn);
4549    int xdelay;
4550 @@ -6687,14 +6733,8 @@
4551    /* A forward branch over a single nullified insn can be done with a
4552       extrs instruction.  This avoids a single cycle penalty due to
4553       mis-predicted branch if we fall through (branch not taken).  */
4554 +  useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE;
4555  
4556 -  if (length == 4
4557 -      && next_real_insn (insn) != 0
4558 -      && get_attr_length (next_real_insn (insn)) == 4
4559 -      && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn))
4560 -      && nullify)
4561 -    useskip = 1;
4562 -
4563    switch (length)
4564      {
4565  
4566 Index: libstdc++-v3/src/bitmap_allocator.cc
4567 ===================================================================
4568 --- libstdc++-v3/src/bitmap_allocator.cc        (.../tags/gcc_4_5_2_release)    (wersja 169176)
4569 +++ libstdc++-v3/src/bitmap_allocator.cc        (.../branches/gcc-4_5-branch)   (wersja 169176)
4570 @@ -49,6 +49,7 @@
4571    {
4572  #if defined __GTHREADS
4573      __mutex_type& __bfl_mutex = _M_get_mutex();
4574 +    __bfl_mutex.lock();
4575  #endif
4576      const vector_type& __free_list = _M_get_free_list();
4577      using __gnu_cxx::__detail::__lower_bound;
4578 Index: libstdc++-v3/ChangeLog
4579 ===================================================================
4580 --- libstdc++-v3/ChangeLog      (.../tags/gcc_4_5_2_release)    (wersja 169176)
4581 +++ libstdc++-v3/ChangeLog      (.../branches/gcc-4_5-branch)   (wersja 169176)
4582 @@ -1,3 +1,16 @@
4583 +2011-01-19  Graham Reed  <greed@pobox.com>
4584 +
4585 +       PR libstdc++/47354
4586 +       * src/bitmap_allocator.cc (free_list::_M_get): Lock mutex.
4587 +
4588 +2010-12-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4589 +
4590 +       Backport from mainline:
4591 +       2010-12-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4592 +
4593 +       * testsuite/lib/libstdc++.exp (v3-build_support): Delete
4594 +       libtestc++.a before creation.
4595 +
4596  2010-12-16  Release Manager
4597  
4598         * GCC 4.5.2 released.
4599 Index: libstdc++-v3/testsuite/lib/libstdc++.exp
4600 ===================================================================
4601 --- libstdc++-v3/testsuite/lib/libstdc++.exp    (.../tags/gcc_4_5_2_release)    (wersja 169176)
4602 +++ libstdc++-v3/testsuite/lib/libstdc++.exp    (.../branches/gcc-4_5-branch)   (wersja 169176)
4603 @@ -586,6 +586,15 @@
4604      }
4605  
4606      # Collect into libtestc++.a
4607 +    # Delete libtestc++.a first.  Mixed 32 and 64-bit archives cannot be
4608 +    # linked on IRIX 6.
4609 +    # Use same procedure as gcc-dg.exp (remove-build-file).
4610 +    if [is_remote host] {
4611 +       # Ensure the host knows the file is gone by deleting there
4612 +       # first.
4613 +       remote_file host delete "./libtestc++.a"
4614 +       }
4615 +    remote_file build delete "./libtestc++.a"
4616      if  [info exists env(AR)] {
4617         set ar $env(AR)
4618      } else {
4619 Index: libffi/ChangeLog
4620 ===================================================================
4621 --- libffi/ChangeLog    (.../tags/gcc_4_5_2_release)    (wersja 169176)
4622 +++ libffi/ChangeLog    (.../branches/gcc-4_5-branch)   (wersja 169176)
4623 @@ -1,3 +1,11 @@
4624 +2010-12-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4625 +
4626 +       Backport from mainline:
4627 +       2010-12-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4628 +
4629 +       * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define.
4630 +       (PRIuPTR): Define.
4631 +
4632  2010-12-16  Release Manager
4633  
4634         * GCC 4.5.2 released.
4635 Index: libffi/testsuite/libffi.call/ffitest.h
4636 ===================================================================
4637 --- libffi/testsuite/libffi.call/ffitest.h      (.../tags/gcc_4_5_2_release)    (wersja 169176)
4638 +++ libffi/testsuite/libffi.call/ffitest.h      (.../branches/gcc-4_5-branch)   (wersja 169176)
4639 @@ -77,6 +77,26 @@
4640  #define PRIuPTR "lu"
4641  #endif
4642  
4643 +/* IRIX kludge.  */
4644 +#if defined(__sgi)
4645 +/* IRIX 6.5 <inttypes.h> provides all definitions, but only for C99
4646 +   compilations.  */
4647 +#if (_MIPS_SZLONG == 32)
4648 +#define PRId64 "lld"
4649 +#define PRIu64 "llu"
4650 +#endif
4651 +/* This doesn't match <inttypes.h>, which always has "lld" here, but the
4652 +   arguments are uint64_t, int64_t, which are unsigned long, long for
4653 +   64-bit in <sgidefs.h>.  */
4654 +#if (_MIPS_SZLONG == 64)
4655 +#define PRId64 "ld"
4656 +#define PRIu64 "lu"
4657 +#endif
4658 +/* This doesn't match <inttypes.h>, which has "u" here, but the arguments
4659 +   are uintptr_t, which is always unsigned long.  */
4660 +#define PRIuPTR "lu"
4661 +#endif
4662 +
4663  /* Solaris < 10 kludge.  */
4664  #if defined(__sun__) && defined(__svr4__) && !defined(PRIuPTR)
4665  #if defined(__arch64__) || defined (__x86_64__)
4666 Index: libjava/classpath/lib/java/security/VMAccessController.class
4667 ===================================================================
4668 Nie można wyświetlić: plik binarny.
4669 svn:mime-type = application/octet-stream
4670 Index: libjava/ChangeLog
4671 ===================================================================
4672 --- libjava/ChangeLog   (.../tags/gcc_4_5_2_release)    (wersja 169176)
4673 +++ libjava/ChangeLog   (.../branches/gcc-4_5-branch)   (wersja 169176)
4674 @@ -1,3 +1,24 @@
4675 +2011-01-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4676 +
4677 +       Backport from mainline:
4678 +       2011-01-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
4679 +
4680 +       * testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation):
4681 +       Add -shared-libgcc to cxxflags for *-*-solaris*.
4682 +       Remove -lsocket.
4683 +
4684 +2010-12-13  Andrew John Hughes  <ahughes@redhat.com>
4685 +
4686 +       PR libgcj/46774
4687 +       * libjava/java/security/VMAccessController.java:
4688 +       (DEFAULT_CONTEXT): Create ProtectionDomain with
4689 +       four argument constructor (arguments are the same
4690 +       as those implied by the two argument constructor).
4691 +       (getContext()): Create ProtectionDomain instances
4692 +       with four argument constructor using a null Principal
4693 +       array (as before) but including the classloader, which
4694 +       was always null before.
4695 +
4696  2010-12-16  Release Manager
4697  
4698         * GCC 4.5.2 released.
4699 Index: libjava/testsuite/libjava.jni/jni.exp
4700 ===================================================================
4701 --- libjava/testsuite/libjava.jni/jni.exp       (.../tags/gcc_4_5_2_release)    (wersja 169176)
4702 +++ libjava/testsuite/libjava.jni/jni.exp       (.../branches/gcc-4_5-branch)   (wersja 169176)
4703 @@ -274,8 +274,10 @@
4704      eval lappend cxxflags "-shared-libgcc -lgcj $libiconv"
4705    }
4706  
4707 +  # Make sure libgcc unwinder is used on 64-bit Solaris 10+/x86 rather than
4708 +  # the libc one.
4709    if { [istarget "*-*-solaris*"] } {
4710 -    lappend cxxflags "-lsocket"
4711 +    lappend cxxflags "-shared-libgcc"
4712    }
4713  
4714    return $cxxflags
4715 Index: libjava/java/security/VMAccessController.java
4716 ===================================================================
4717 --- libjava/java/security/VMAccessController.java       (.../tags/gcc_4_5_2_release)    (wersja 169176)
4718 +++ libjava/java/security/VMAccessController.java       (.../branches/gcc-4_5-branch)   (wersja 169176)
4719 @@ -56,7 +56,7 @@
4720      Permissions permissions = new Permissions();
4721      permissions.add(new AllPermission());
4722      ProtectionDomain[] domain = new ProtectionDomain[] {
4723 -      new ProtectionDomain(source, permissions)
4724 +      new ProtectionDomain(source, permissions, null, null)
4725      };
4726      DEFAULT_CONTEXT = new AccessControlContext(domain);
4727    }
4728 @@ -178,12 +178,13 @@
4729      for (int i = 3; i < classes.length; i++)
4730        {
4731          Class clazz = classes[i];
4732 +        ClassLoader loader = clazz.getClassLoader();
4733  
4734          if (DEBUG)
4735            {
4736              debug("checking " + clazz);
4737              // subject to getClassLoader RuntimePermission
4738 -            debug("loader = " + clazz.getClassLoader());
4739 +            debug("loader = " + loader);
4740            }
4741  
4742          if (privileged && i == classes.length - 2)
4743 @@ -208,7 +209,8 @@
4744          // Create a static snapshot of this domain, which may change over time
4745          // if the current policy changes.
4746          domains.add(new ProtectionDomain(domain.getCodeSource(),
4747 -                                         domain.getPermissions()));
4748 +                                         domain.getPermissions(),
4749 +                                         loader, null));
4750        }
4751  
4752      if (DEBUG)
4753 Index: libcpp/directives.c
4754 ===================================================================
4755 --- libcpp/directives.c (.../tags/gcc_4_5_2_release)    (wersja 169176)
4756 +++ libcpp/directives.c (.../branches/gcc-4_5-branch)   (wersja 169176)
4757 @@ -280,16 +280,17 @@
4758  static void
4759  end_directive (cpp_reader *pfile, int skip_line)
4760  {
4761 -  if (pfile->state.in_deferred_pragma)
4762 -    ;
4763 -  else if (CPP_OPTION (pfile, traditional))
4764 +  if (CPP_OPTION (pfile, traditional))
4765      {
4766        /* Revert change of prepare_directive_trad.  */
4767 -      pfile->state.prevent_expansion--;
4768 +      if (!pfile->state.in_deferred_pragma)
4769 +       pfile->state.prevent_expansion--;
4770  
4771        if (pfile->directive != &dtable[T_DEFINE])
4772         _cpp_remove_overlay (pfile);
4773      }
4774 +  else if (pfile->state.in_deferred_pragma)
4775 +    ;
4776    /* We don't skip for an assembler #.  */
4777    else if (skip_line)
4778      {
4779 Index: libcpp/ChangeLog
4780 ===================================================================
4781 --- libcpp/ChangeLog    (.../tags/gcc_4_5_2_release)    (wersja 169176)
4782 +++ libcpp/ChangeLog    (.../branches/gcc-4_5-branch)   (wersja 169176)
4783 @@ -1,3 +1,10 @@
4784 +2011-11-04  Eric Botcazou  <ebotcazou@adacore.com>
4785 +            Jakub Jelinek  <jakub@redhat.com>
4786 +
4787 +       PR preprocessor/39213
4788 +       * directives.c (end_directive): Call _cpp_remove_overlay for deferred
4789 +       pragmas as well in traditional mode.
4790 +
4791  2010-12-16  Release Manager
4792  
4793         * GCC 4.5.2 released.
This page took 0.418872 seconds and 4 git commands to generate.