nvtpx: error: array subscript -1 is below array bounds of 'short int [2][16]'
Hi! Running automated tests again, I found that when building current (2fcfc03459a907c0237ea6e2c6e4ce4871034bed) GCC with a recent GCC, a build (make all-gcc) when ./configure'ed for -target=nvptx-none --enable-werror-always --enable-languages=all --disable-gcov --disable-shared --disable-threads --without-headers fails with: [all 2021-09-04 16:33:59] /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o lra-constraints.o -MT lra-constraints.o -MMD -MP -MF ./.deps/lra-constraints.TPo ../../gcc/gcc/lra-constraints.c [all 2021-09-04 16:34:07] In function 'bool check_and_process_move(bool*, bool*)', [all 2021-09-04 16:34:07] inlined from 'bool curr_insn_transform(bool)' at ../../gcc/gcc/lra-constraints.c:4092:33: [all 2021-09-04 16:34:07] ../../gcc/gcc/lra-constraints.c:1317:56: error: array subscript -1 is below array bounds of 'short int [2][16]' [-Werror=array-bounds] [all 2021-09-04 16:34:07] 1317 | reg_renumber[dregno] = ira_class_hard_regs[dclass][0]; [all 2021-09-04 16:34:07] In file included from ../../gcc/gcc/lra-constraints.c:123: [all 2021-09-04 16:34:07] ../../gcc/gcc/ira.h: In function 'bool curr_insn_transform(bool)': [all 2021-09-04 16:34:07] ../../gcc/gcc/ira.h:85:9: note: while referencing 'target_ira::x_ira_class_hard_regs' [all 2021-09-04 16:34:07]85 | short x_ira_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER]; [all 2021-09-04 16:34:07] | ^ [all 2021-09-04 16:34:07] In function 'bool check_and_process_move(bool*, bool*)', [all 2021-09-04 16:34:07] inlined from 'bool curr_insn_transform(bool)' at ../../gcc/gcc/lra-constraints.c:4092:33: [all 2021-09-04 16:34:07] ../../gcc/gcc/lra-constraints.c:1324:56: error: array subscript -1 is below array bounds of 'short int [2][16]' [-Werror=array-bounds] [all 2021-09-04 16:34:07] 1324 | reg_renumber[sregno] = ira_class_hard_regs[sclass][0]; [all 2021-09-04 16:34:07] In file included from ../../gcc/gcc/lra-constraints.c:123: [all 2021-09-04 16:34:07] ../../gcc/gcc/ira.h: In function 'bool curr_insn_transform(bool)': [all 2021-09-04 16:34:07] ../../gcc/gcc/ira.h:85:9: note: while referencing 'target_ira::x_ira_class_hard_regs' [all 2021-09-04 16:34:07]85 | short x_ira_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER]; [all 2021-09-04 16:34:07] | ^ [all 2021-09-04 16:34:13] cc1plus: all warnings being treated as errors [all 2021-09-04 16:34:13] make[1]: *** [Makefile:1142: lra-constraints.o] Error 1 [all 2021-09-04 16:34:13] make[1]: Leaving directory '/var/lib/laminar/run/gcc-nvptx-none/5/toolchain-build/gcc' [all 2021-09-04 16:34:13] make: *** [Makefile:4407: all-gcc] Error 2 Thanks, Jan-Benedict -- signature.asc Description: PGP signature
pdp11: 'src' may be used uninitialized in this function
Hi Paul, using a recent GCC when building GCC results in a possibly uninitialized access: $ .../gcc/configure --target=pdp11-aout --enable-werror-always --enable-languages=all --disable-gcov --disable-shared --disable-threads --without-headers [...] $ make all-gcc [...] [all 2021-09-04 17:21:14] /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o xcoffout.o -MT xcoffout.o -MMD -MP -MF ./.deps/xcoffout.TPo ../../gcc/gcc/xcoffout.c [all 2021-09-04 17:21:16] /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o pdp11.o -MT pdp11.o -MMD -MP -MF ./.deps/pdp11.TPo ../../gcc/gcc/config/pdp11/pdp11.c [all 2021-09-04 17:21:19] ../../gcc/gcc/config/pdp11/pdp11.c: In function 'bool pdp11_rtx_costs(rtx, machine_mode, int, int, int*, bool)': [all 2021-09-04 17:21:19] ../../gcc/gcc/config/pdp11/pdp11.c:1113:39: error: 'src' may be used uninitialized in this function [-Werror=maybe-uninitialized] [all 2021-09-04 17:21:19] 1113 | *total += pdp11_addr_cost (src, mode, ADDR_SPACE_GENERIC, speed); [all 2021-09-04 17:21:19] | ^~ [all 2021-09-04 17:21:20] cc1plus: all warnings being treated as errors [all 2021-09-04 17:21:20] make[1]: *** [Makefile:2421: pdp11.o] Error 1 [all 2021-09-04 17:21:20] make[1]: Leaving directory '/var/lib/laminar/run/gcc-pdp11-aout/11/toolchain-build/gcc' [all 2021-09-04 17:21:20] make: *** [Makefile:4422: all-gcc] Error 2 The warning seems legit, though hardly reachable in reality. Maybe fix it for sure, though? Thanks, Jan-Benedict -- signature.asc Description: PGP signature
gcc-11-20210904 is now available
Snapshot gcc-11-20210904 is now available on https://gcc.gnu.org/pub/gcc/snapshots/11-20210904/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 11 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch releases/gcc-11 revision 9c3a4753acfa1dde12aa1a935a01b8387ca017ec You'll find: gcc-11-20210904.tar.xz Complete GCC SHA256=2ffeb49b3238e57ff02b1e45a4388dba6208fa98b40472e3e7cca66fcbf02a22 SHA1=b0e64f10992449ebcd57cc3132cb9608c98aed65 Diffs from 11-20210828 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-11 link is updated and a message is sent to the gcc list. Please do not use a snapshot before it has been announced that way.