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