re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr20702.c
1 /* PR tree-optimization/20702
2 VRP did not insert ASSERT_EXPRs into dominator dominator children
3 of a basic block ending with COND_EXPR unless the children are also
4 immediate successors of the basic block. */
5
6 /* { dg-do compile } */
7 /* { dg-options "-O2 -fno-tree-dominator-opts -fdump-tree-vrp1-details" } */
8
9 extern void bar (int);
10
11 int
12 foo (int *p, int b)
13 {
14 int a;
15
16 if (b)
17 bar (123);
18 else
19 bar (321);
20
21 a = *p;
22 if (p == 0)
23 return 0;
24
25 return a;
26 }
27
28 /* { dg-final { scan-tree-dump-times "Folding predicate" 1 "vrp1"} } */
29 /* { dg-final { cleanup-tree-dump "vrp1" } } */