This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [BUILDROBOT] m68k-linux: gas: array subscript is below array bounds
- From: Alan Modra <amodra at gmail dot com>
- To: Jan-Benedict Glaw <jbglaw at lug-owl dot de>
- Cc: binutils at sourceware dot org, Richard Henderson <rth at redhat dot com>, Nick Clifton <nickc at redhat dot com>
- Date: Sun, 24 Aug 2014 13:39:13 +0930
- Subject: Re: [BUILDROBOT] m68k-linux: gas: array subscript is below array bounds
- Authentication-results: sourceware.org; auth=none
- References: <20140824023114 dot GH12042 at lug-owl dot de>
On Sun, Aug 24, 2014 at 04:31:14AM +0200, Jan-Benedict Glaw wrote:
> Hi!
>
> After updating gcc on one of the builders, I found a build
> (http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=345664)
> where gcc complained:
>
> gcc -DHAVE_CONFIG_H -I. -I/home/vaxbuild/repos/binutils_gdb/gas -I. -I/home/vaxbuild/repos/binutils_gdb/gas -I../bfd -I/home/vaxbuild/repos/binutils_gdb/gas/config -I/home/vaxbuild/repos/binutils_gdb/gas/../include -I/home/vaxbuild/repos/binutils_gdb/gas/.. -I/home/vaxbuild/repos/binutils_gdb/gas/../bfd -DLOCALEDIR="\"/home/vaxbuild/build/m68k-linux/_install_/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT tc-m68k.o -MD -MP -MF .deps/tc-m68k.Tpo -c -o tc-m68k.o `test -f 'config/tc-m68k.c' || echo '/home/vaxbuild/repos/binutils_gdb/gas/'`config/tc-m68k.c
> /home/vaxbuild/repos/binutils_gdb/gas/config/tc-m68k.c: In function âmd_assembleâ:
> /home/vaxbuild/repos/binutils_gdb/gas/config/tc-m68k.c:4514:36: error: array subscript is below array bounds [-Werror=array-bounds]
> n = (the_ins.numo - the_ins.fragb[n - 1].fragoff);
> ^
> cc1: all warnings being treated as errors
> make[3]: *** [tc-m68k.o] Error 1
>
>
> On a first glance, the error could be correct for the first loop with
> n=0. OTOH, this code is some 15 years old and seems to be working.
> (And it's too early in the morning *cough*.) So this is just a
> heads-up, maybe totally bogus.
Looks like a false positive. The loop exits with n == the_ins.nfrag,
and we don't enter the loop in the first place if the_ins.nfrag == 0.
--
Alan Modra
Australia Development Lab, IBM