https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63197

            Bug ID: 63197
           Summary: tc-m68k.c: Wrong warning "array subscript is below
                    array bounds"
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jbg...@lug-owl.de

Building Binutils's GAS with a recent GCC (ie. 4.9.1) for --target=m68k-linux
fails due to a false warning, which aborts the build since -Werror is used.

Cf. Buildrobot build #351394
(http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=351394):

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

Alan Modra had described it here:
https://sourceware.org/ml/binutils/2014-08/msg00236.html

Reply via email to