Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/phi-opt-40.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-phiopt" } */
3 /* PR tree-optimization/111957 */
4
5 int f(int a)
6 {
7 if (a)
8 return a > 0 ? a : -a;
9 return 0;
10 }
11
12 int f1(int x)
13 {
14 int intmin = (-1u >> 1);
15 intmin = -intmin - 1;
16 if (x != intmin)
17 return x > 0 ? x : -x;
18 return intmin;
19 }
20
21 /* { dg-final { scan-tree-dump-times "if " 1 "phiopt1" } } */
22 /* { dg-final { scan-tree-dump-not "if " "phiopt2" } } */
23 /* { dg-final { scan-tree-dump-times "ABS_EXPR <" 2 "phiopt1" } } */
24 /* { dg-final { scan-tree-dump-times "ABS_EXPR <" 1 "phiopt2" } } */
25 /* { dg-final { scan-tree-dump-times "ABSU_EXPR <" 1 "phiopt2" } } */