aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tbaa.c
blob: b336622afd1aa15d8b7aa3729130137542b5936b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* { dg-do assemble } */
/* { dg-options "-O2 -flto -flto-partition=one -fdump-tree-evrp -std=gnu89" } */
/* { dg-require-effective-target lto } */

typedef struct rtx_def *rtx;
typedef struct cselib_val_struct
{
  union
  {
  } u;
  struct elt_loc_list *locs;
}
cselib_val;
struct elt_loc_list
{
  struct elt_loc_list *next;
  rtx loc;
};
static int n_useless_values;
unchain_one_elt_loc_list (pl)
     struct elt_loc_list **pl;
{
  struct elt_loc_list *l = *pl;
  *pl = l->next;
}

discard_useless_locs (x, info)
     void **x;
{
  cselib_val *v = (cselib_val *) * x;
  struct elt_loc_list **p = &v->locs;
  int had_locs = v->locs != 0;
  while (*p)
    {
      unchain_one_elt_loc_list (p);
      p = &(*p)->next;
    }
  if (had_locs && v->locs == 0)
    {
      n_useless_values++;
    }
}
/* { dg-final { scan-tree-dump-times "n_useless_values" 2 "evrp" { xfail *-*-* } } } */