public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* pdp11: 'src' may be used uninitialized in this function
@ 2021-09-04 19:35 Jan-Benedict Glaw
  0 siblings, 0 replies; only message in thread
From: Jan-Benedict Glaw @ 2021-09-04 19:35 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 2752 bytes --]

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

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-04 19:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04 19:35 pdp11: 'src' may be used uninitialized in this function Jan-Benedict Glaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).