1 /* { dg-options "-Os -fdump-tree-pre-details -fdisable-tree-evrp -fno-tree-dse" } */
2
3 /* Disable tree-evrp because the new version of evrp sees
4 <bb 3> :
5 if (j_8(D) != 2147483647)
6 goto <bb 4>; [50.00%]
7 else
8 goto <bb 5>; [50.00%]
9 <bb 4> :
10 iftmp.2_11 = j_8(D) + 1;
11 <bb 5> :
12 # iftmp.2_12 = PHI <j_8(D)(3), iftmp.2_11(4)>
13
14 EVRP now recognizes a constant can be propagated into the 3->5 edge and
15 produces
16 # iftmp.2_12 = PHI <2147483647(3), iftmp.2_11(4)>
17 which causes the situation being tested to dissapear before we get to PRE. */
18
19 /* Likewise disable DSE which also elides the tail merging "opportunity". */
20
21 #if __SIZEOF_INT__ == 2
22 #define unsigned __UINT32_TYPE__
23 #define int __INT32_TYPE__
24 #endif
25
26 unsigned a;
27 int b, c;
28
29 static int
30 fn1 (int p1, int p2)
31 {
32 return p1 > 2147483647 - p2 ? p1 : p1 + p2;
33 }
34
35 void
36 fn2 (void)
37 {
38 int j;
39 a = 30;
40 for (; a;)
41 for (; c; b = fn1 (j, 1))
42 ;
43 }
44
45 /* { dg-final { scan-tree-dump-times "(?n)find_duplicates: <bb .*> duplicate of <bb .*>" 1 "pre" } } */