re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr20701.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-vrp2 -fno-early-inlining" } */
3
4 typedef struct {
5 int code;
6 } *rtx;
7
8 static inline void *zero ()
9 {
10 return 0;
11 }
12 static inline int three ()
13 {
14 return 3;
15 }
16
17 int
18 can_combine_p (rtx insn, rtx elt)
19 {
20 rtx set;
21
22 set = zero ();
23 if (insn->code == three ())
24 set = insn;
25 else
26 {
27 set = elt;
28 if (set == zero ())
29 return 0;
30 }
31
32 if (set == zero ())
33 return 1;
34
35 return 0;
36 }
37
38 /* { dg-final { scan-tree-dump-times "Folding predicate.*to 0" 1 "vrp2" } } */
39 /* { dg-final { cleanup-tree-dump "vrp2" } } */