This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: odd array subscript is above array bounds error
2009/3/5 Jack Howarth <howarth@bromo.med.uc.edu>:
>
> Manuel,
> ? ?It seems that the simplier testcase must be optimizing away the loop
> at all optimization levels. ?Are there any options that would suppress that
> optimization if one was just looking for array bounds errors with -Warray-bounds?
> ? ? ? ? ? ? ? ? ? ? ? ? ? Jack
>
I don't understand what you mean. The warning is given before the loop
is removed. The warning is not given in your simple testcase because
the array is unused. It has little to do with the loop. If you use the
array (like if you return it), then the warning appears.
Cheers,
Manuel.