PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / pr62167-run.c
blob37214a3ecee27d6c0f967188b6abc13bd833cbd0
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ftree-tail-merge" } */
4 struct node
6 struct node *next;
7 struct node *prev;
8 };
10 struct node node;
12 struct head
14 struct node *first;
17 struct head heads[5];
19 int k = 2;
21 struct head *head = &heads[2];
23 int
24 main ()
26 struct node *p;
28 node.next = (void*)0;
30 node.prev = (void *)head;
32 head->first = &node;
34 struct node *n = head->first;
36 struct head *h = &heads[k];
38 heads[2].first = n->next;
40 if ((void*)n->prev == (void *)h)
41 p = h->first;
42 else
43 /* Dead tbaa-unsafe load from ((struct node *)&heads[2])->next. */
44 p = n->prev->next;
46 return !(p == (void*)0);