| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-dce4" } */ |
| 3 |
|
| 4 |
void foo1 (int *restrict a, int *restrict b, int *restrict c, |
| 5 |
int *restrict d, int *restrict res, int n) |
| 6 |
{ |
| 7 |
for (int i = 0; i < n; i++) |
| 8 |
res[i] = a[i] ? b[i] : (c[i] ? b[i] : d[i]); |
| 9 |
} |
| 10 |
|
| 11 |
/* After tail-merging (run during PRE) we should end up merging the two |
| 12 |
blocks dereferencing 'b', ending up with two iftmp assigns and the |
| 13 |
iftmp PHI def. */ |
| 14 |
/* { dg-final { scan-tree-dump-times "iftmp\[^\r\n\]* = " 3 "dce4" } } */ |