1 /* PR tree-optimization/61677 - False positive with -Wmaybe-uninitialized
2 { dg-do compile }
3 { dg-options "-O2 -Wall" } */
4
5 void *xmalloc (void);
6
7 struct menu { struct menu *parent; };
8
9 struct jump_key { int offset; };
10
11 void f (struct menu *menu)
12 {
13 int i;
14 struct menu *submenu[8], *location;
15 struct jump_key *jump;
16 location = menu;
17 for (i = 0; menu && i < 8; menu = menu->parent)
18 submenu[i++] = menu;
19 if (location)
20 jump = xmalloc ();
21 while (--i >= 0) {
22 menu = submenu[i];
23 if (location)
24 jump->offset = 42;
25 }
26 }