| 1 |
/* PR c/98592 - ICE in gimple_canonical_types_compatible_p while formatting |
| 2 |
a MEM_REF |
| 3 |
{ dg-do compile } |
| 4 |
{ dg-options "-O2 -Wall" } */ |
| 5 |
|
| 6 |
void f (int); |
| 7 |
|
| 8 |
void vlaNx3_to_pia1 (int n) |
| 9 |
{ |
| 10 |
int a[n][3]; |
| 11 |
|
| 12 |
/* The VLA isn't formatted correctly due to PR 98587. Just verify |
| 13 |
there is no ICE and a warning is issued. */ |
| 14 |
f (((*(int(*)[4])&a[1][2]))[3]); // { dg-warning "\\\[-Wuninitialized" } |
| 15 |
} |
| 16 |
|
| 17 |
void vlaNxN_to_pia1 (int n) |
| 18 |
{ |
| 19 |
int a[n][n]; |
| 20 |
|
| 21 |
/* Same as above. */ |
| 22 |
f (((*(int(*)[4])&a[1][2]))[3]); // { dg-warning "\\\[-Wuninitialized" } |
| 23 |
} |
| 24 |
|
| 25 |
void vlaNxN_to_pvla4xN (int n) |
| 26 |
{ |
| 27 |
int a[n][n]; |
| 28 |
|
| 29 |
/* Same as above. */ |
| 30 |
f (((*(int(*)[4][n])&a[1][2]))[3][4]); // { dg-warning "\\\[-Wuninitialized" } |
| 31 |
} |
| 32 |
|
| 33 |
void vlaN_to_pia2 (int n) |
| 34 |
{ |
| 35 |
int a[n]; |
| 36 |
|
| 37 |
/* Same as above. */ |
| 38 |
f (((*(int(*)[3][4])&a[1]))[2][3]); // { dg-warning "\\\[-Wuninitialized" } |
| 39 |
} |
| 40 |
|
| 41 |
void vlaN_to_pvlaNx4 (int n) |
| 42 |
{ |
| 43 |
int a[n]; |
| 44 |
|
| 45 |
/* Same as above. */ |
| 46 |
f (((*(int(*)[n][4])&a[1]))[1][3]); // { dg-warning "\\\[-Wuninitialized" } |
| 47 |
} |