OSDN Git Service

PR tree-optimization/51799
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dom-thread-4.c
1 /* { dg-do compile } */ 
2 /* { dg-options "-O2 -fdump-tree-dom1-details" } */
3 struct bitmap_head_def;
4 typedef struct bitmap_head_def *bitmap;
5 typedef const struct bitmap_head_def *const_bitmap;
6 typedef unsigned long BITMAP_WORD;
7 typedef struct bitmap_element_def
8 {
9   struct bitmap_element_def *next;
10   unsigned int indx;
11 } bitmap_element;
12
13
14
15
16
17
18
19
20
21 unsigned char
22 bitmap_ior_and_compl (bitmap dst, const_bitmap a, const_bitmap b,
23                       const_bitmap kill)
24 {
25   unsigned char changed = 0;
26
27   bitmap_element *dst_elt;
28   const bitmap_element *a_elt, *b_elt, *kill_elt, *dst_prev;
29
30   while (a_elt || b_elt)
31     {
32       unsigned char new_element = 0;
33
34       if (b_elt)
35         while (kill_elt && kill_elt->indx < b_elt->indx)
36           kill_elt = kill_elt->next;
37
38       if (b_elt && kill_elt && kill_elt->indx == b_elt->indx
39           && (!a_elt || a_elt->indx >= b_elt->indx))
40         {
41           bitmap_element tmp_elt;
42           unsigned ix;
43
44           BITMAP_WORD ior = 0;
45
46               changed = bitmap_elt_ior (dst, dst_elt, dst_prev,
47                                         a_elt, &tmp_elt, changed);
48
49         }
50
51     }
52
53
54   return changed;
55 }
56 /* The block starting the second conditional has  3 incoming edges,
57    we should thread all three, but due to a bug in the threading
58    code we missed the edge when the first conditional is false
59    (b_elt is zero, which means the second conditional is always
60    zero.  */
61 /* { dg-final { scan-tree-dump-times "Threaded" 3 "dom1"} } */
62 /* { dg-final { cleanup-tree-dump "dom1" } } */
63