Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/fre-predicated-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3
4 /* PR tree-optimization/117414 */
5
6 /* Fre1 should figure out that `*aaa != 0`
7 For f0, f1, and f2. */
8
9 void foo();
10 int f(int *aaa, int j, int t)
11 {
12 int b = *aaa;
13 int c = b == 0;
14 int d = t != 1;
15 if (c | d)
16 return 0;
17
18 for(int i = 0; i < j; i++)
19 {
20 if (*aaa)
21 ;
22 else
23 foo();
24 }
25 return 0;
26 }
27
28 int f1(int *aaa, int j, int t)
29 {
30 int b = *aaa;
31 if (b == 0)
32 return 0;
33 if (t != 1)
34 return 0;
35 for(int i = 0; i < j; i++)
36 {
37 if (*aaa)
38 ;
39 else
40 foo();
41 }
42 return 0;
43 }
44
45 /* { dg-final { scan-tree-dump-not "foo " "optimized" } } */
46 /* { dg-final { scan-tree-dump "return 0;" "optimized" } } */