1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fdump-tree-ifcvt-stats-blocks-details" } */
3 
4 float a,b,c,d;
5 
6 float z[1024]; int ok[1024];
7 const float rBig = 150.;
8 
foo()9 void foo()
10 {
11   int i;
12 
13   for (i=0; i!=1024; ++i)
14     {
15       float rR = a*z[i];
16       float rL = b*z[i];
17       float rMin = (rR<rL) ? rR : rL;
18       float rMax = (rR<rL) ? rL : rR;
19       rMin = (rMax>0) ? rMin : rBig;
20       rMin = (rMin>0) ? rMin : rMax;
21       ok[i] = rMin-c<rMax+d;
22     }
23 }
24 
25 /* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "ifcvt" } } */
26 
27 /* We insert into code
28    if (LOOP_VECTORIZED (...))
29    which is folded by vectorizer.  Both outgoing edges must have probability
30    100% so the resulting profile match after folding.  */
31 /* { dg-final { scan-tree-dump-times "Invalid sum of outgoing probabilities 200.0" 1 "ifcvt" } } */
32 /* { dg-final { scan-tree-dump-times "Invalid sum of incoming counts" 1 "ifcvt" } } */
33