annotate gcc/testsuite/gcc.dg/tree-ssa/pr20702.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/20702
kono
parents:
diff changeset
2 VRP did not insert ASSERT_EXPRs into dominator dominator children
kono
parents:
diff changeset
3 of a basic block ending with COND_EXPR unless the children are also
kono
parents:
diff changeset
4 immediate successors of the basic block. */
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 -fdelete-null-pointer-checks" } */
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 extern void bar (int);
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 int
kono
parents:
diff changeset
12 foo (int *p, int b)
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 int a;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 if (b)
kono
parents:
diff changeset
17 bar (123);
kono
parents:
diff changeset
18 else
kono
parents:
diff changeset
19 bar (321);
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 a = *p;
kono
parents:
diff changeset
22 if (p == 0)
kono
parents:
diff changeset
23 return 0;
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 return a;
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* Target disabling -fdelete-null-pointer-checks should not fold checks */
kono
parents:
diff changeset
29 /* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1" { target { ! keeps_null_pointer_checks } } } } */
kono
parents:
diff changeset
30 /* { dg-final { scan-tree-dump-times "Folding predicate" 0 "vrp1" { target { keeps_null_pointer_checks } } } } */