Odd warning: array subscript is above array bounds

Mason slash.tmp@free.fr
Tue Oct 17 08:43:00 GMT 2017


On 12/10/2017 18:42, Jeff Law wrote:

> -O3 turns on loop unrolling which often triggers false positives for the
> out-of-bounds array index checks.  I believe there's a number of bugs in
> the BZ database WRT this issue.
> 
> You might consider attaching your testcase to one of them.

[meta-bug] bogus warning when inlining or unrolling: "array subscript is above array bounds"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456

FWIW, I worked around the issue by making the array larger (20 elements).
This inhibits GCC's eagerness to fully unroll the nested loops.

Regards.



More information about the Gcc-help mailing list