| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized --param logical-op-non-short-circuit=1" } */ |
| 3 |
/* PR tree-optimization/111456 */ |
| 4 |
|
| 5 |
void foo(void); |
| 6 |
static int i; |
| 7 |
static int *j = &i; |
| 8 |
static signed char l; |
| 9 |
static void(a)(signed char) {} |
| 10 |
static short(b)(short c, short d) { return c - d; } |
| 11 |
static short(e)(short f, int g) { |
| 12 |
return f < 0 || g < 0 || g >= 32 ? f : f >> g; |
| 13 |
} |
| 14 |
static short(h)(short f, int g) { return g >= 2 ?: f >> g; } |
| 15 |
static signed char k(signed char m, short n) { |
| 16 |
short o; |
| 17 |
int *p = &i; |
| 18 |
if (!(((m) >= 1) && ((m) <= 1))) { |
| 19 |
__builtin_unreachable(); |
| 20 |
} |
| 21 |
o = e(i, i); |
| 22 |
if (h(1, o)) |
| 23 |
; |
| 24 |
else { |
| 25 |
m = 0; |
| 26 |
for (; m >= -20; m = b(m, 9)) |
| 27 |
if (a(i), n) { |
| 28 |
if (*p) |
| 29 |
; |
| 30 |
else |
| 31 |
foo(); |
| 32 |
; |
| 33 |
} else |
| 34 |
return l; |
| 35 |
} |
| 36 |
return i; |
| 37 |
} |
| 38 |
int main() { k(0 <= 0 > *j, i); } |
| 39 |
|
| 40 |
|
| 41 |
/* { dg-final { scan-tree-dump-not "foo " "optimized" } } */ |
| 42 |
/* { dg-final { scan-tree-dump "return 0;" "optimized" } } */ |
| 43 |
|