Debian Codegraph @

gcc/testsuite/gcc.dg/fold-popcount-8a.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3
4 int foo1(unsigned int x, unsigned int y)
5 {
6 int t = __builtin_popcount (x&y);
7 int t1 = __builtin_popcount (x|y);
8 return t + t1;
9 }
10
11 int foo2(unsigned int x, unsigned int y)
12 {
13 int t1 = __builtin_popcount (x|y);
14 int t = __builtin_popcount (x&y);
15 return t + t1;
16 }
17
18 int foo3(unsigned int y, unsigned int x)
19 {
20 int t = __builtin_popcount (x&y);
21 int t1 = __builtin_popcount (x|y);
22 return t + t1;
23 }
24
25 int foo4(unsigned int y, unsigned int x)
26 {
27 int t1 = __builtin_popcount (x|y);
28 int t = __builtin_popcount (x&y);
29 return t + t1;
30 }
31
32 /* { dg-final { scan-tree-dump-not " & " "optimized" } } */
33 /* { dg-final { scan-tree-dump-not " \\| " "optimized" } } */