Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/ccmp_4.c

raw
1 /* { dg-options "-O2" } */
2 /* PR target/100942 */
3
4 void foo(void);
5 int f1(int a, int b, int d)
6 {
7 int c = a < 8 || b < 9;
8 int e = d < 11 || c;
9 if (e) foo();
10 return c;
11 }
12
13 /*
14 We really should get:
15 cmp w0, 7
16 ccmp w1, 8, 4, gt
17 cset w0, le
18 ccmp w2, 10, 4, gt
19 ble .L11
20
21 But we currently get:
22 cmp w0, 7
23 ccmp w1, 8, 4, gt
24 cset w0, le
25 cmp w0, 0
26 ccmp w2, 10, 4, eq
27 ble .L11
28 The middle cmp is not needed.
29 */
30
31 /* We should end up with only one cmp and 2 ccmp and 1 cset but currently we get 2 cmp
32 though. */
33 /* { dg-final { scan-assembler-times "\tccmp\t" 2 } } */
34 /* { dg-final { scan-assembler-times "\tcset\t" 1 } } */
35 /* { dg-final { scan-assembler-times "\tcmp\t" 1 { xfail *-*-* } } } */