| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining -fno-ipa-sra -fdump-tree-optimized -fno-ipa-icf" } */ |
| 3 |
/* { dg-add-options bind_pic_locally } */ |
| 4 |
|
| 5 |
int array[100]; |
| 6 |
|
| 7 |
int t(int); |
| 8 |
|
| 9 |
static int |
| 10 |
i_can_be_propagated_fully (int *a) |
| 11 |
{ |
| 12 |
int i; |
| 13 |
for (i=0;i<50;i++) |
| 14 |
{ |
| 15 |
t(a[i]); |
| 16 |
t(a[i+1]); |
| 17 |
t(a[i+2]); |
| 18 |
t(a[i+3]); |
| 19 |
} |
| 20 |
} |
| 21 |
static int |
| 22 |
i_can_be_propagated_fully2 (int *a) |
| 23 |
{ |
| 24 |
i_can_be_propagated_fully (a); |
| 25 |
i_can_be_propagated_fully (a); |
| 26 |
i_can_be_propagated_fully (a); |
| 27 |
} |
| 28 |
static int |
| 29 |
i_can_not_be_propagated_fully (int *a) |
| 30 |
{ |
| 31 |
int i; |
| 32 |
for (i=0;i<50;i++) |
| 33 |
{ |
| 34 |
t(a[i]); |
| 35 |
t(a[i+1]); |
| 36 |
t(a[i+2]); |
| 37 |
t(a[i+3]); |
| 38 |
} |
| 39 |
} |
| 40 |
int |
| 41 |
i_can_not_be_propagated_fully2 (int *a) |
| 42 |
{ |
| 43 |
int i; |
| 44 |
i_can_not_be_propagated_fully (a); |
| 45 |
for (i=0;i<50;i++) |
| 46 |
{ |
| 47 |
t(a[i] + 1); |
| 48 |
t(a[i+1] + 1); |
| 49 |
t(a[i+2] + 1); |
| 50 |
t(a[i+3] + 1); |
| 51 |
} |
| 52 |
i_can_not_be_propagated_fully (a); |
| 53 |
for (i=0;i<50;i++) |
| 54 |
{ |
| 55 |
t(a[i] + 2); |
| 56 |
t(a[i+1] + 2); |
| 57 |
t(a[i+2] + 2); |
| 58 |
t(a[i+3] + 2); |
| 59 |
} |
| 60 |
i_can_not_be_propagated_fully (a); |
| 61 |
} |
| 62 |
int |
| 63 |
main() |
| 64 |
{ |
| 65 |
int i; |
| 66 |
i_can_be_propagated_fully2 (array); |
| 67 |
i_can_be_propagated_fully2 (array); |
| 68 |
|
| 69 |
for (i = 0; i < 7; i++) |
| 70 |
i_can_not_be_propagated_fully2 (array); |
| 71 |
i_can_not_be_propagated_fully2 (array); |
| 72 |
} |
| 73 |
|
| 74 |
/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully2" 1 "cp" } } */ |
| 75 |
/* { dg-final { scan-ipa-dump-times "Creating a specialized node of i_can_be_propagated_fully\[./\]" 1 "cp" } } */ |
| 76 |
/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully2" "cp" } } */ |
| 77 |
/* { dg-final { scan-ipa-dump-not "Creating a specialized node of i_can_not_be_propagated_fully/" "cp" } } */ |
| 78 |
/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully \\(" "optimized" } } */ |
| 79 |
/* { dg-final { scan-tree-dump-not "i_can_be_propagated_fully2 \\(" "optimized" } } */ |