1 /* PR middle-end/63477 - Bogus warning with -O3 -Warray-bounds: array
2 subscript is above array bounds
4 { dg-options "-O3 -Warray-bounds" } */
10 int itemList
[MAX_VAL
+ 1];
11 unsigned int numItems
;
14 void FrobList (ItemList
*l
)
18 for (i
= 0; i
< l
->numItems
- 1; i
++)
20 int minVal
= l
->itemList
[i
];
22 unsigned int minIdx
= i
;
25 for (idx
= i
+ 1; idx
< l
->numItems
; ++idx
) {
27 if (l
->itemList
[idx
] < minVal
) /* { dg-bogus "\\\[-Warray-bounds]" } */
29 minVal
= l
->itemList
[idx
];
34 l
->itemList
[i
] = l
->itemList
[minIdx
];