summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/sparc/sparc-loop-1.c
blob: cb8d007627dab621b1b9ee5fbea4cabd288e118e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR optimization/10157 */
/* Originator: Peter van Hoof <p.van-hoof@qub.ac.uk> */

/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math" } */

/* Verify that the loop optimizer doesn't
   emit invalid reg-to-reg copy insns. */

void g() {
  while(1) {
    int i,n;
    double p,r;
    for( i=0; i < n; i++ )
      if( p > 1. )
        for( i=0; i < n; i++ )
          r += 2.;
  }
}