Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/cond-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-optimized-raw" } */
3
4 int sub(int a, int b, int c, int d) {
5 int e = (a == 0);
6 int f = !e;
7 c = b;
8 d = b - a ;
9 return ((-e & c) | (-f & d));
10 }
11
12 /* In the end we end up with `(a == 0) ? (b - a) : b`
13 which then can be optimized to just `(b - a)`. */
14
15 /* { dg-final { scan-tree-dump-not "cond_expr," "optimized" } } */
16 /* { dg-final { scan-tree-dump-not "eq_expr," "optimized" } } */
17 /* { dg-final { scan-tree-dump-times "minus_expr," 1 "optimized" } } */