Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr98334.c

raw
1 /* PR rtl-optimization/98334 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fomit-frame-pointer -fno-stack-protector" } */
4 /* { dg-final { scan-assembler-not "\taddl\t" } } */
5 /* { dg-final { scan-assembler-not "\tsubl\t" } } */
6 /* { dg-final { scan-assembler-not "\tleal\t" } } */
7
8 int
9 foo (int i, unsigned int n)
10 {
11 int result = 0;
12 while (n > 0)
13 {
14 result += i;
15 n -= 1;
16 }
17 return result;
18 }
19
20 int
21 bar (int x, int y)
22 {
23 return (int) (y - 1U) * x + x;
24 }
25
26 int
27 baz (int x, int y)
28 {
29 return (y - 1) * x + x;
30 }
31
32 int
33 qux (int x, int y)
34 {
35 return x * (int) (y + 1U) - x;
36 }