| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -fdump-tree-optimized" } */ |
| 3 |
/* PR tree-optimization/105832 */ |
| 4 |
|
| 5 |
void foo(void); |
| 6 |
|
| 7 |
static struct { |
| 8 |
short a; |
| 9 |
signed char b; |
| 10 |
} c; |
| 11 |
|
| 12 |
static signed char d; |
| 13 |
|
| 14 |
int main() { |
| 15 |
signed char g = c.b > 4U ? c.b : c.b << 2; |
| 16 |
for (int h = 0; h < 5; h++) { |
| 17 |
d = (g >= 2 || 1 >> g) ? g : g << 1; |
| 18 |
if (d && 1 == g) |
| 19 |
foo(); |
| 20 |
c.a = 0; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
/* The call of foo should have been removed. */ |
| 25 |
/* { dg-final { scan-tree-dump-not "foo " "optimized" } } */ |