| 1 |
/* Check that compare-branch is inverted properly. |
| 2 |
In this case the improved bit test is a side effect of compare-branch |
| 3 |
inversion patterns, even though the branch condition does not get |
| 4 |
inverted here. |
| 5 |
Example: |
| 6 |
mov.b @(14,r9),r0 -> mov.b @(14,r9),r0 |
| 7 |
shll r0 cmp/pz r0 |
| 8 |
subc r0,r0 bt .L192 |
| 9 |
and #1,r0 |
| 10 |
tst r0,r0 |
| 11 |
bt .L195 |
| 12 |
*/ |
| 13 |
/* { dg-do compile } */ |
| 14 |
/* { dg-options "-O2" } */ |
| 15 |
/* { dg-final { scan-assembler-not "shll|subc|and" } } */ |
| 16 |
int |
| 17 |
test_00 (int* p) |
| 18 |
{ |
| 19 |
int nr = 15; |
| 20 |
volatile char* addr = (volatile char*)&p[1]; |
| 21 |
|
| 22 |
if ((addr[(nr >> 3) ^ 7] & (1 << (nr & 7))) == 0) |
| 23 |
return 40; |
| 24 |
else |
| 25 |
return 50; |
| 26 |
} |