| 1 |
/* PR tree-optimization/69097 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 4 |
/* { dg-final { scan-tree-dump-times "-y" 17 "optimized" } } */ |
| 5 |
|
| 6 |
int |
| 7 |
f1 (int x, int y) |
| 8 |
{ |
| 9 |
if (x == -__INT_MAX__) |
| 10 |
__builtin_unreachable (); |
| 11 |
return x % -y; |
| 12 |
} |
| 13 |
|
| 14 |
int |
| 15 |
f2 (int x, int y) |
| 16 |
{ |
| 17 |
if (x >= -__INT_MAX__ + 1) |
| 18 |
__builtin_unreachable (); |
| 19 |
return x % -y; |
| 20 |
} |
| 21 |
|
| 22 |
int |
| 23 |
f3 (int x, int y) |
| 24 |
{ |
| 25 |
if (y == -2) |
| 26 |
__builtin_unreachable (); |
| 27 |
return x % -y; |
| 28 |
} |
| 29 |
|
| 30 |
int |
| 31 |
f4 (int x, int y) |
| 32 |
{ |
| 33 |
if (y < -1) |
| 34 |
__builtin_unreachable (); |
| 35 |
return x % -y; |
| 36 |
} |
| 37 |
|
| 38 |
int |
| 39 |
f5 (int x, int y) |
| 40 |
{ |
| 41 |
if (y >= 0) |
| 42 |
__builtin_unreachable (); |
| 43 |
return x % -y; |
| 44 |
} |
| 45 |
|
| 46 |
int |
| 47 |
f6 (int x, int y) |
| 48 |
{ |
| 49 |
if (y < -1 || y > 24) |
| 50 |
__builtin_unreachable (); |
| 51 |
return x % -y; |
| 52 |
} |
| 53 |
|
| 54 |
int |
| 55 |
f7 (int x, int y) |
| 56 |
{ |
| 57 |
if (y <= -17 || y >= 0) |
| 58 |
__builtin_unreachable (); |
| 59 |
return x % -y; |
| 60 |
} |
| 61 |
|
| 62 |
int |
| 63 |
f8 (int x, int y) |
| 64 |
{ |
| 65 |
if (y >= -13 && y <= -2) |
| 66 |
__builtin_unreachable (); |
| 67 |
return x % -y; |
| 68 |
} |
| 69 |
|
| 70 |
int |
| 71 |
f9 (int x, int y) |
| 72 |
{ |
| 73 |
return x % -y; |
| 74 |
} |
| 75 |
|
| 76 |
int |
| 77 |
f10 (int x, int y) |
| 78 |
{ |
| 79 |
if (x != -__INT_MAX__) |
| 80 |
return x % -y; |
| 81 |
return 34; |
| 82 |
} |
| 83 |
|
| 84 |
int |
| 85 |
f11 (int x, int y) |
| 86 |
{ |
| 87 |
if (x < -__INT_MAX__ + 2) |
| 88 |
return x % -y; |
| 89 |
return 34; |
| 90 |
} |
| 91 |
|
| 92 |
int |
| 93 |
f12 (int x, int y) |
| 94 |
{ |
| 95 |
if (y != -2) |
| 96 |
return x % -y; |
| 97 |
return 34; |
| 98 |
} |
| 99 |
|
| 100 |
int |
| 101 |
f13 (int x, int y) |
| 102 |
{ |
| 103 |
if (y >= -1) |
| 104 |
return x % -y; |
| 105 |
return 34; |
| 106 |
} |
| 107 |
|
| 108 |
int |
| 109 |
f14 (int x, int y) |
| 110 |
{ |
| 111 |
if (y < 0) |
| 112 |
return x % -y; |
| 113 |
return 34; |
| 114 |
} |
| 115 |
|
| 116 |
int |
| 117 |
f15 (int x, int y) |
| 118 |
{ |
| 119 |
if (y >= -1 && y <= 24) |
| 120 |
return x % -y; |
| 121 |
return 34; |
| 122 |
} |
| 123 |
|
| 124 |
int |
| 125 |
f16 (int x, int y) |
| 126 |
{ |
| 127 |
if (y > -17 && y < 0) |
| 128 |
return x % -y; |
| 129 |
return 34; |
| 130 |
} |
| 131 |
|
| 132 |
int |
| 133 |
f17 (int x, int y) |
| 134 |
{ |
| 135 |
if (y < -13 || y > -4) |
| 136 |
return x % -y; |
| 137 |
return 34; |
| 138 |
} |