| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fsplit-paths -fdump-tree-split-paths-details " } */ |
| 3 |
/* PR tree-optimization/112402 */ |
| 4 |
/* This is similar to split-path-2.c but instead of the add |
| 5 |
being inside both sides, we have a constant. */ |
| 6 |
|
| 7 |
int |
| 8 |
foo(signed char *p, int n) |
| 9 |
{ |
| 10 |
int s = 0; |
| 11 |
int i; |
| 12 |
|
| 13 |
for (i = 0; i < n; i++) { |
| 14 |
int t; |
| 15 |
if (p[i] >= 0) |
| 16 |
t = 1; |
| 17 |
else |
| 18 |
t = -1; |
| 19 |
s += t; |
| 20 |
} |
| 21 |
|
| 22 |
return s; |
| 23 |
} |
| 24 |
|
| 25 |
/* { dg-final { scan-tree-dump "appears to be a join point for if-convertable" "split-paths" } } */ |
| 26 |
|