OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pr29921-2.c] - Blame information for rev 315

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* 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
 
5
 
6
/* { dg-do compile } */
7
/* { dg-options "-O2 -ffast-math" } */
8
 
9
int
10
foo (float *array, int end)
11
{
12
  int i;
13
  float sum1, sum2;
14
 
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;
26
}
27
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.