| 1 |
/* PR tree-optimization/112994 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 4 |
/* { dg-final { scan-tree-dump-not " / \\\[2389-\\\]" "optimized" } } */ |
| 5 |
|
| 6 |
int f1 (int x) { return (x * 4) / 2; } |
| 7 |
int f2 (int x) { return (x * 56) / 8; } |
| 8 |
int f3 (int x) { return (x * 56) / -8; } |
| 9 |
int f4 (int x) { int y = x * 4; return y / 2; } |
| 10 |
int f5 (int x) { int y = x * 56; return y / 8; } |
| 11 |
int f6 (int x) { int y = x * 56; return y / -8; } |
| 12 |
unsigned f7 (unsigned x) { if (x > ~0U / 6) __builtin_unreachable (); unsigned y = x * 6; return y / 3; } |
| 13 |
unsigned f8 (unsigned x) { if (x > ~0U / 63) __builtin_unreachable (); unsigned y = x * 63; return y / 9; } |