1
2 /* { dg-do compile } */
3 /* { dg-options "-Wuninitialized -O2" } */
4
5 int g;
6 void bar();
7 void blah(int);
8
foo(int n,int l,int m,int r)9 int foo (int n, int l, int m, int r)
10 {
11 int v;
12
13 if (n > 10)
14 v = r;
15
16 if (m) g++;
17 else bar();
18
19 if ( (n > 10) && (l < 100))
20 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
21
22 if ( n > 100 )
23 blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
24
25 return 0;
26 }
27
foo_2(int n,int l,int m,int r)28 int foo_2 (int n, int l, int m, int r)
29 {
30 int v;
31
32 if (n > 10)
33 v = r;
34
35 if (m) g++;
36 else bar();
37
38 if ( n < 10)
39 blah (v); /* { dg-warning "uninitialized" "warning" } */
40
41
42 return 0;
43 }
44