summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/20021212-1.c
blob: b89669d75b82554c3a1ae23134ae3862681a798b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* PR optimization/8334 */
/* Verify that GCC produces valid operands
   after simplifying an addition. */

void foo(int m, int n, double *f)
{
  int i, j, k = 1;

  for (j = 0; j < n; j++) {
    for (i = k; i < m; i++) {
      f[i] = (double) (i * j);
      f[i + j] = (double) ((i + 1) * j);
    }
  }
}