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

            Bug ID: 65991
           Summary: maybe-unitialized - false positive
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dilyan.palauzov at aegee dot org
  Target Milestone: ---

I have compiled gcc with

../gcc-4.9.2/configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
--enable-threads=posix --enable-nls --enable-interpreter --with-system-zlib
--enable-libgcj-multifile --enable-languages=all --enable-targets=all
--with-system-unwind --without-x --with-linker-hash-style=gnu --enable-multilib
--disable-multilib --with-arch=nocona

export CFLAGS="-pipe -O3 -fno-fat-lto-objects -flto"
export CXXFLAGS="-pipe -O3 -fno-fat-lto-objects -flto"


Then I try to compile binutils (at commit 01a97082d0e9) with

configure --enable-lto --enable-plugins --enable-threads --enable-gold=yes
--with-zlib
CFLAGS='-pipe -O3 -fno-fat-lto-objects -flto'
LDFLAGS='-Wl,-O1 -Wl,-z,relro -Wl,-s'

bintuils utilizies internally -Werror and compiling it fails with LTO error at:

make[2]: Entering directory '/mnt/new/src/gcc/binutil-git/gas'
/bin/sh ./libtool --tag=CC   --mode=link gcc -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wshadow -Werror -I/home/git/binutils-gdb/gas/../zlib
-pipe -O3 -fno-fat-lto-objects -flto  -Wl,-O1 -Wl,-z,relro -Wl,-s -o as-new
app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o
dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o
frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o
messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o
write.o tc-i386.o obj-elf.o atof-ieee.o  ../opcodes/libopcodes.la
../bfd/libbfd.la ../libiberty/libiberty.a   -ldl 
libtool: link: gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow
-Werror -I/home/git/binutils-gdb/gas/../zlib -pipe -O3 -fno-fat-lto-objects
-flto -Wl,-O1 -Wl,-z -Wl,relro -Wl,-s -o as-new app.o as.o atof-generic.o
compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o
flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o
input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o
remap.o sb.o stabs.o subsegs.o symbols.o write.o tc-i386.o obj-elf.o
atof-ieee.o  ../opcodes/.libs/libopcodes.a ../bfd/.libs/libbfd.a
-L/src/gcc/binutil-git/zlib -lz ../libiberty/libiberty.a -ldl
/home/git/binutils-gdb/bfd/compress.c: In function
'bfd_compress_section_contents':
/home/git/binutils-gdb/bfd/compress.c:161:4: error: 'zlib_size' may be used
uninitialized in this function [-Werror=maybe-uninitialized]
    memmove (buffer + compression_header_size,
    ^
/home/git/binutils-gdb/bfd/compress.c:88:7: note: 'zlib_size' was declared here
   int zlib_size;
       ^
lto1: all warnings being treated as errors
lto-wrapper: gcc returned 1 exit status
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.2/../../../../x86_64-unknown-linux-gnu/bin/ld:
lto-wrapper failed
collect2: error: ld returned 1 exit status
Makefile:769: recipe for target 'as-new' failed
make[2]: *** [as-new] Error 1
make[2]: Leaving directory '/mnt/new/src/gcc/binutil-git/gas'


See also https://sourceware.org/bugzilla/show_bug.cgi?id=18313 .

Reply via email to