| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O3 -Warray-bounds" } */ |
| 3 |
|
| 4 |
struct S { |
| 5 |
int a; |
| 6 |
int b; |
| 7 |
int c; |
| 8 |
int d; |
| 9 |
int e; |
| 10 |
float x[5]; |
| 11 |
float y[5]; // Comment these two lines out to |
| 12 |
float z[5 - 1]; // remove the warning |
| 13 |
}; |
| 14 |
void f(struct S *s, float a[], float **b, float c[]) { |
| 15 |
if ((s->b == 1) && (s->d > 0)) { |
| 16 |
for (int i = 0; i < s->a; i++) { |
| 17 |
if (a[i] != 0.0) { |
| 18 |
for (int j = 0; j < s->d - 1; j++) { |
| 19 |
if ((c[i] >= s->x[j]) && (c[i] <= s->x[j + 1])) { |
| 20 |
b[2*j][i] = s->x[j]; |
| 21 |
break; |
| 22 |
} |
| 23 |
} |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
} |