| 1 |
/* { dg-do run { target { ! "m68k*-*-* mmix*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* or1k*-*-* pru*-*-*"} } } */ |
| 2 |
|
| 3 |
/* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details --param logical-op-non-short-circuit=1" } */ |
| 4 |
/* { dg-additional-options "-mbranch-cost=2" { target branch_cost } } */ |
| 5 |
|
| 6 |
int test (unsigned int a, int b, int c) |
| 7 |
{ |
| 8 |
if ((a - 43) <= 3 || (a - 75) <= 3) |
| 9 |
return b; |
| 10 |
else |
| 11 |
return c; |
| 12 |
} |
| 13 |
int |
| 14 |
main () |
| 15 |
{ |
| 16 |
volatile int n43, n47, n75, n79; |
| 17 |
n43 = 43; n47 = n43 + 4; n75 = 75; n79 = n75 + 4; |
| 18 |
int i; |
| 19 |
for (i = -10; i <= 100; i++) |
| 20 |
if (test (i, 2, 3) != 3 - ((i >= n43 && i < n47) || (i >= n75 && i < n79))) |
| 21 |
__builtin_abort (); |
| 22 |
return 0; |
| 23 |
} |
| 24 |
|
| 25 |
/* { dg-final { scan-tree-dump-times "Optimizing range tests" 1 "reassoc1" } } */ |