libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / uninit-pr61677.c
bloba982fae31a47279429bb5438ce2f6ef60ee25e84
1 /* PR tree-optimization/61677 - False positive with -Wmaybe-uninitialized
2 { dg-do compile }
3 { dg-options "-O2 -Wall" } */
5 void *xmalloc (void);
7 struct menu { struct menu *parent; };
9 struct jump_key { int offset; };
11 void f (struct menu *menu)
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;