gcc/testsuite/gcc.dg/uninit-pr61409.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -Wuninitialized" } */ |
| 3 | |
| 4 | int *rw; |
| 5 | int line_height; |
| 6 | int pixel_width; |
| 7 | int text_cols; |
| 8 | int width1, width2, width3; |
| 9 | |
| 10 | void *pointer; |
| 11 | |
| 12 | void f (int i, int j) |
| 13 | { |
| 14 | void *ptr; |
| 15 | if (i) |
| 16 | { |
| 17 | if (j) |
| 18 | return; |
| 19 | ptr = pointer; |
| 20 | } |
| 21 | pixel_width = 1234 + width1 + 2 * width2 + 2 * width3; |
| 22 | *rw = text_cols + line_height; |
| 23 | if (i) |
| 24 | rw=ptr; /* { dg-bogus "uninitialized" "bogus warning" } */ |
| 25 | } |