PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / pr69224.c
blob606b7fee2ae66f6e3c5c8011ffe8501cc09f225b
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -Warray-bounds" } */
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
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;