summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sparc/ultrasp11.c
blob: 91e64782bd1249653afe11a401778c5e3fb31b58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* PR target/17245 */
/* Origin: <aaronw@net.com> */
/* Testcase by Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de> */

/* { dg-do compile } */
/* { dg-options "-O -mcpu=v9" } */

/* This used to fail on 32-bit Ultrasparc because reload was emitting
   a move insn that doesn't satisfy its constraints.  */

int n; 
double range ;
double bin ;
double wmean;

double f ()
{
  int i ;
  long double W = 0 ;
  for ( i = 0 ; i < n ; i ++) {
    double xi = range;
    double wi = bin;
    W += wi ;
    wmean += ( xi - wmean) * ( wi / W);
  }
}