Debian Codegraph @

gcc/testsuite/gcc.dg/uninit-31-gimple.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fgimple -O -Wmaybe-uninitialized" } */
3
4 unsigned int __GIMPLE (ssa,startwith("uninit1"))
5 foo (unsigned int v)
6 {
7 /* If v == 2, then undef is used w/o being initialized. */
8 unsigned int undef; /* { dg-warning "may be used uninitialized" } */
9 unsigned int _2;
10 unsigned int _9;
11 unsigned int _10;
12 unsigned int pred2;
13 unsigned int pred1;
14
15 __BB(2):
16 pred2 = v_4(D) & 5u;
17 if (pred2 != 0u)
18 goto __BB3;
19 else
20 goto __BB4;
21
22 /* 'undef' is defined conditionally (under 'v & 5' predicate). */
23 __BB(3):
24 undef_8 = 8u;
25 goto __BB4;
26
27 /* An undef value flows into a phi. */
28 __BB(4):
29 undef_1 = __PHI (__BB2: undef_5(D), __BB3: undef_8);
30 pred1 = v_4(D) & 3u;
31 if (pred1 != 0u)
32 goto __BB5;
33 else
34 goto __BB6;
35
36 /* The phi value is used here (under 'v & 3' predicate). */
37 __BB(5):
38 _9 = undef_1;
39 goto __BB7;
40
41 __BB(6):
42 _10 = v_4(D);
43 goto __BB7;
44
45 __BB(7):
46 _2 = __PHI (__BB5: _9, __BB6: _10);
47 return _2;
48 }