annotate gcc/testsuite/gcc.dg/tree-ssa/pr21294.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR tree-optimization/21294
kono
parents:
diff changeset
2 VRP did not notice that an address of the form &p->i is nonnull
kono
parents:
diff changeset
3 when p is known to be nonnull. In this testcase, noticing that
kono
parents:
diff changeset
4 allows us to eliminate the second "if" statement. */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 /* { dg-do compile } */
kono
parents:
diff changeset
7 /* { dg-options "-O2 -fno-tree-dominator-opts -fdisable-tree-evrp -fdump-tree-vrp1-details" } */
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 struct f {
kono
parents:
diff changeset
10 int i;
kono
parents:
diff changeset
11 };
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 int
kono
parents:
diff changeset
14 foo (struct f *p)
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 if (p != 0)
kono
parents:
diff changeset
17 if (&p->i != 0)
kono
parents:
diff changeset
18 return 123;
kono
parents:
diff changeset
19 return 0;
kono
parents:
diff changeset
20 }
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 /* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */