| 1 |
/* PR33315 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-sink" } */ |
| 4 |
|
| 5 |
int num; |
| 6 |
int a[20]; |
| 7 |
|
| 8 |
void test () |
| 9 |
{ |
| 10 |
int i; |
| 11 |
int *ptr; |
| 12 |
ptr = & a[0]; |
| 13 |
i = num; |
| 14 |
if ( i == 1) *(ptr+0) = 0; |
| 15 |
if ( i != 1) *(ptr+0) = 0; |
| 16 |
if ( i == 2) *(ptr+1) = 0; |
| 17 |
if ( i != 2) *(ptr+1) = 0; |
| 18 |
if ( i == 3) *(ptr+2) = 0; |
| 19 |
if ( i != 3) *(ptr+2) = 0; |
| 20 |
} |
| 21 |
|
| 22 |
/* We should sink/merge all stores and end up with a single BB. */ |
| 23 |
|
| 24 |
/* { dg-final { scan-tree-dump-times "MEM\[^\n\r\]* = 0;" 3 "sink1" } } */ |
| 25 |
/* { dg-final { scan-tree-dump-times "<bb " 1 "sink1" } } */ |