Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/fre-predicated-4.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 and f1. */
8
9
10 void foo();
11 int f0(int *aaa, int j, int t)
12 {
13 int b = *aaa;
14 if (b == 0 || t == 1)
15 return 0;
16 for(int i = 0; i < j; i++)
17 {
18 if (!*aaa) foo();
19 }
20 return 0;
21 }
22
23 int f1(int *aaa, int j, int t)
24 {
25 int b = *aaa;
26 if (b == 0)
27 return 0;
28 if (t == 1)
29 return 0;
30 for(int i = 0; i < j; i++)
31 {
32 if (!*aaa) foo();
33 }
34 return 0;
35 }
36
37 /* { dg-final { scan-tree-dump-not "foo " "optimized" } } */
38 /* { dg-final { scan-tree-dump "return 0;" "optimized" } } */