| 1 |
/* PR tree-optimization/77664 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-reassoc1-details" } */ |
| 4 |
|
| 5 |
extern void foo (void); |
| 6 |
|
| 7 |
/* { dg-final { scan-tree-dump-times "Optimizing range test \[^\n\r]* and comparison" 6 "reassoc1" } } */ |
| 8 |
|
| 9 |
__attribute__((noinline, noclone)) void |
| 10 |
fn1 (long long int a, unsigned short b, int c) |
| 11 |
{ |
| 12 |
if (a >= 0 && c && a < b) |
| 13 |
foo (); |
| 14 |
} |
| 15 |
|
| 16 |
__attribute__((noinline, noclone)) void |
| 17 |
fn2 (long long int a, unsigned short b, int c) |
| 18 |
{ |
| 19 |
if (a < 0 || c || a >= b) |
| 20 |
foo (); |
| 21 |
} |
| 22 |
|
| 23 |
__attribute__((noinline, noclone)) void |
| 24 |
fn3 (long long int a, unsigned short b) |
| 25 |
{ |
| 26 |
if (a < 0 || b < a) |
| 27 |
foo (); |
| 28 |
} |
| 29 |
|
| 30 |
__attribute__((noinline, noclone)) void |
| 31 |
fn4 (long long int a, unsigned short b) |
| 32 |
{ |
| 33 |
if (a <= b && a >= 0) |
| 34 |
foo (); |
| 35 |
} |
| 36 |
|
| 37 |
__attribute__((noinline, noclone)) void |
| 38 |
fn5 (long long int a, unsigned short b) |
| 39 |
{ |
| 40 |
if (a < 0 | a > b) |
| 41 |
foo (); |
| 42 |
} |
| 43 |
|
| 44 |
__attribute__((noinline, noclone)) void |
| 45 |
fn6 (long long int a, unsigned short b) |
| 46 |
{ |
| 47 |
if (b >= a & a >= 0) |
| 48 |
foo (); |
| 49 |
} |