aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/analyzer/phi-2.c
blob: 2ab8344cfe27e47d104fb3cb0413e219241e2e3b (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
/* { dg-additional-options "-O1" } */

struct list_head {
  struct list_head *next, *prev;
};

struct mbochs_dmabuf {
  /* [...snip...] */
  struct dma_buf *buf;
  /* [...snip...] */
  struct list_head next;
  /* [...snip...] */
};

void mbochs_close(struct list_head *dmabufs,
		  struct mbochs_dmabuf *dmabuf,
		  struct mbochs_dmabuf *tmp)
{
  /* [...snip...] */
  while (&dmabuf->next != dmabufs)
    {
      dmabuf = tmp;
      tmp = ((struct mbochs_dmabuf *)((void *)(tmp->next.next) - __builtin_offsetof(struct mbochs_dmabuf, next)));
    }

  /* [...snip...] */
}