Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-pr61869.c
blobef4f43644719afa97c73b722e8815019610711f1
1 /* PR tree-optimization/61869 - Spurious uninitialized warning (lim1 pass,
2 pretty-printed internal var
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 typedef struct data {
7 struct data *next;
8 } data;
10 typedef struct list {
11 unsigned dummy;
12 struct list *next;
13 data *start;
14 int flags;
15 } list;
17 typedef struct iterator {
18 struct data *ptr;
19 unsigned dummy;
20 } iterator;
22 iterator start (list *a) {
23 iterator i = {
24 *(a->flags ? &a->start : 0),
27 return i;
30 void g (iterator *i);
32 void f (list *b)
34 list *a;
35 iterator i; // { dg-bogus "-Wmaybe-uninitialized" }
37 for (a = b; a; a = a->next)
38 for (i = start (a); i.ptr; i.ptr = i.ptr->next)
40 if (i.ptr)
41 return;
44 for (a = b; a; a = a->next)
45 for (i = start (a); i.ptr; i.ptr = i.ptr->next)
46 g(&i);