This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUILDROBOT] m68k-linux: gas: array subscript is below array bounds

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
> (
> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]