| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O -fno-ivopts -Wuninitialized" } */ |
| 3 |
|
| 4 |
int *e; |
| 5 |
int f1 (void); |
| 6 |
void f2 (int); |
| 7 |
long f3 (void *, long, int *); |
| 8 |
void f4 (void *); |
| 9 |
int *fh; |
| 10 |
|
| 11 |
void tst (void) |
| 12 |
{ |
| 13 |
int status; |
| 14 |
unsigned char badData[3][3] = { { 7 }, { 16 }, { 23 } }; |
| 15 |
int badDataSize[3] = { 1, 1, 1 }; |
| 16 |
int i; |
| 17 |
|
| 18 |
for (i = 0; i < 3; i++) |
| 19 |
{ |
| 20 |
int emax; |
| 21 |
if (i == 2) |
| 22 |
emax = f1 (); |
| 23 |
status = f3 (&badData[i][0], badDataSize[i], fh); |
| 24 |
if (status) |
| 25 |
{ |
| 26 |
f1 (); |
| 27 |
f1 (); |
| 28 |
f1 (); |
| 29 |
} |
| 30 |
f4 (fh); |
| 31 |
*e = 0; |
| 32 |
f1 (); |
| 33 |
/* When threading the following out of the loop uninit |
| 34 |
analysis needs to pick up the loop exit condition |
| 35 |
to match up with this guard. |
| 36 |
??? This doesn't work reliably when IVOPTs is run. */ |
| 37 |
if (i == 2) |
| 38 |
f2 (emax); /* { dg-bogus "uninitialized" } */ |
| 39 |
} |
| 40 |
} |