| 1 |
/* PR tree-optimization/96696 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2 -masm=att" } */ |
| 4 |
/* { dg-final { scan-assembler-times "\tidivl\t" 2 } } */ |
| 5 |
/* { dg-final { scan-assembler-times "\tdivl\t" 2 } } */ |
| 6 |
/* { dg-final { scan-assembler-not "\ti?mull\t" } } */ |
| 7 |
|
| 8 |
int |
| 9 |
foo (int x, int y) |
| 10 |
{ |
| 11 |
return (x / y) * y; |
| 12 |
} |
| 13 |
|
| 14 |
int |
| 15 |
bar (int x, int y) |
| 16 |
{ |
| 17 |
return x - (x % y); |
| 18 |
} |
| 19 |
|
| 20 |
unsigned |
| 21 |
baz (unsigned x, unsigned y) |
| 22 |
{ |
| 23 |
return (x / y) * y; |
| 24 |
} |
| 25 |
|
| 26 |
unsigned |
| 27 |
qux (unsigned x, unsigned y) |
| 28 |
{ |
| 29 |
return x - (x % y); |
| 30 |
} |