summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr33833.c
blob: ebdfcb1f81869e07a945182d7be2ddadc60e37b7 (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
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
/* { dg-do compile } */

#define signed
typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
#undef signed

struct list_head
{
  struct list_head *prev;
};
struct prio_array
{
  struct list_head queue[100];
};
struct rq
{
  struct prio_array *active, arrays[2];
} per_cpu__runqueues;

void sched_init (uintptr_t __ptr)
{
  int j, k;
  struct prio_array *array;
  struct rq *rq;
  rq = (&(*( { (typeof (&per_cpu__runqueues)) (__ptr); } )));
  for (j = 0; j < 2; j++)
  {
    array = rq->arrays + j;
    for (k = 0; k < 100; k++)
        (array->queue + k)->prev = array->queue;
  }
}

/* { dg-final { cleanup-tree-dump "vect" } } */