Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr29921-2.c
blob8cf665eede04eb799154ec1ce2e48e98769cd55d
1 /* With -ffast-math, the latice value for sum2 used to change from NaN to
2 VARYING, in turn causing the lattice value of sum1 * sum2 change from
3 NaN to 0 (since sum1 is believed to be 0 at that moment, and
4 0 * VARYING = 0 with -ffast-math), which caused an ICE. */
6 /* { dg-do compile } */
7 /* { dg-options "-O2 -ffast-math" } */
9 int
10 foo (float *array, int end)
12 int i;
13 float sum1, sum2;
15 sum2 = 0;
16 for (i = 0; i < end; i++)
17 sum2 = sum2+array[i];
18 sum2 = 1./sum2;
19 sum1 = 0.;
20 for (i = 0; i < end; i++)
21 sum1 = sum1+array[i];
22 sum1 = sum1 * sum2;
23 if (-10.0 / sum1 < 5.E-5)
24 end = 0;
25 return end;