Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/factor_op_phi-4.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-phiopt1-details -fdump-tree-optimized" } */
3
4 /* PR tree-optimization/112418 */
5
6 /* This is factor_op_phi-1.c but with statements swapped in the inner if. */
7
8 int f(int a, int b, int d, int e)
9 {
10 int c;
11 if (a < 0)
12 {
13 c = d > 0 ? d : -d;
14 a = -a;
15 }
16 else
17 {
18 c = e > 0 ? e : -e;
19 a = a;
20 }
21 return a + c;
22 }
23
24 /* ABS <d> should be able to pull out of the if statement early on in phiopt1. */
25 /* { dg-final { scan-tree-dump "changed to factor operation out from " "phiopt1" } } */
26 /* { dg-final { scan-tree-dump-times "if " 1 "phiopt1" } } */
27 /* { dg-final { scan-tree-dump-times "ABS_EXPR " 1 "phiopt1" } } */
28 /* { dg-final { scan-tree-dump-times "if " 1 "optimized" } } */
29 /* { dg-final { scan-tree-dump-times "ABS_EXPR " 1 "optimized" } } */