aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr93247-1.c
blob: a3087b81d674aff9c6258953a0fdf72275e20122 (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
44
45
46
47
48
49
/* { dg-do compile } */
/* { dg-additional-options "-march=skylake" { target x86_64-*-* i?86-*-* } } */

typedef struct {
  unsigned num;
} VEC_tree_base;

enum {
  LTO_DECL_STREAM_NAMESPACE_DECL,
  LTO_DECL_STREAM_LABEL_DECL,
  LTO_N_DECL_STREAMS
};

struct lto_tree_ref_encoder {
  VEC_tree_base *trees;
} typedef *lto_out_decl_state_ptr;

typedef struct {
  lto_out_decl_state_ptr vec[1];
} VEC_lto_out_decl_state_ptr_base;

VEC_lto_out_decl_state_ptr_base *a;
int f;
long g;
int
fn1(struct lto_tree_ref_encoder *p1) {
  int i;
  long b;
  i = 0;
  for (; i < LTO_N_DECL_STREAMS; i++) {
    struct lto_tree_ref_encoder c = *p1;
    int d;
    VEC_tree_base *e = c.trees;
    d = e ? e->num : 0;
    b += d;
  }
  return b;
}
int
fn2() {
  lto_out_decl_state_ptr h;
  struct lto_tree_ref_encoder j;
  unsigned k;
  for (; k < f; k++) {
    h = a->vec[k];
    j = *h;
    g += fn1(&j);
  }
}